Test case is the backbone of any testing project. The art of software testing is to write the right test case. Firstly it’s not about how you write it, but rather what scenarios you are writing for. After that, we need to closely tie our test cases with test design and test execution.
Let’s explore how to write test cases in the most strategic fashion.
A test case is a specific set of conditions or variables under which a tester determines whether a system, software application, or one of its features is working as intended.
Here’s an example. You are testing the Login pop-up of Etsy, one of the leading E-commerce platforms currently. You’ll need several test cases to check if all features of this page are working smoothly.
Brainstorming time: what features do you want to test for this Login pop-up?
Let’s list down some of them:
That’s just a quick and immediate list. As a matter of fact, the more complex a system is, the more test cases are needed.
Before you write a test case, ask yourself 3 questions:
Once all of those 3 questions have been answered, you can start the test case design and eventually test authoring. It’s safe to say that 80% of writing a test case belongs to the planning and designing part, and only 20% is actually scripting. Good test case design is key to achieving good test coverage.
Let’s start with the first steps.
Why we need to design before we write though?
It's simple. There are way more things to test than it appears. Taking from the example above, the Login page alone has required you 10 test cases to almost cover all scenarios. You need techniques to list down all test cases in a given scenario before you start writing those tests.
First question: do you have access to the internal code?
You are doing black box testing if you don’t have access to internal code. The entire system is essentially a black box. You can only see and test what the system is programmed to show you.
When testers don’t need to understand the algorithm, they can concentrate on determining whether the software meets user expectations. They must explore and learn about the system to generate test case ideas. However, this approach can result in limited test coverage, as some features with non-obvious behavior might be overlooked.
In that case, here are some techniques for you to design your test cases:
1. Equivalence Class Testing: you divide input data into groups where all values in a group should be treated the same way by the system.
2. Boundary Value Analysis: this is a more granular version of equivalence class testing. Here you test values at the edges of input ranges to find errors at the boundaries.
3. Decision Table Testing: you use a table to test different combinations of input conditions and their corresponding actions or results.
Rule
Rule-1
Rule-2
Rule-3
Rule-4
Rule-5
Rule-6
Conditions