Test Case Development
Test Case Development
A test case is a detailed procedure that fully tests a feature or an aspect of a feature. While the test plan describes what to test, a test case describes how to perform a particular test. You need to develop test cases for each test listed in the test plan.
As a tester, the best way to determine the compliance of the software to requirements is by designing effective test cases that provide a thorough test of a unit. Various test case design techniques enable testers to develop effective test cases. Besides, implementing the design techniques, every tester needs to keep in mind general guidelines that will aid in test case design:
- The purpose of each test case is to run the test in the simplest way possible. [Suitable techniques - Specification derived tests, Equivalence partitioning]
- Concentrate initially on positive testing i.e. the test case should show that the software does what it is intended to do. [Suitable techniques - Specification derived tests, Equivalence partitioning, State-transition testing]
- Existing test cases should be enhanced and further test cases should be designed to show that the software does not do anything that it is not specified to do i.e. Negative Testing [Suitable techniques - Error guessing, Boundary value analysis, Internal boundary value testing, State-transition testing]
- Where appropriate, test cases should be designed to address issues such as performance, safety requirements and security requirements [Suitable techniques - Specification derived tests]
- Further test cases can then be added to the unit test specification to achieve specific test coverage objectives. Once coverage tests have been designed, the test procedure can be developed and the tests executed [Suitable techniques - Branch testing, Condition testing, Data definition-use testing, State-transition testing]
The manner in which a test case is depicted varies between organizations. Anyhow, many test case templates are in the form of a table, for example, a 5-column table with fields:
Test case ID
Test case description
Test dependency/ setup
Input data requirements/ steps
Test Case Design Techniques
Black box (functional)
White box (structural)
-Partitioning boundary value
-Data definition- Use testing
-Internal boundary value testing
Specification Derived Tests
As the name suggests, test cases are designed by walking through the relevant specifications. It is a positive test case design technique.
Equivalence partitioning is the process of taking all of the possible test values and placing them into classes (partitions or groups).
Test cases should be designed to test one value from each class. Thereby, it uses the fewest test cases to cover the maximum input requirements.
Boundary Value Analysis
This is a selection technique where the test data are chosen to lie along the boundaries of the input domain or the output range.
This technique is often called as stress testing and incorporates a degree of negative testing in the test design by anticipating that errors will occur at or around the partition boundaries.
State Transition Testing
As the name suggests, test cases are designed to test the transition between the states by creating the events that cause the transition.
In branch testing, test cases are designed to exercise control flow branches or decision points in a unit.
This is usually aimed at achieving a target level of Decision Coverage. Branch Coverage, need to test both branches of IF and ELSE.
All branches and compound conditions (e.g. loops and array handling) within the branch should be exercised at least once.
The object of condition testing is to design test cases to show that the individual components of logical conditions and combinations of the individual components are correct.
Test cases are designed to test the individual elements of logical expressions, both within branch conditions and within other expressions in a unit.
Data Definition – Use Testing
Data definition-use testing designs test cases to test pairs of data definitions and uses.
Data definition is anywhere that the value of a data item is set. Data use is anywhere that a data item is read or used.
The objective is to create test cases that will drive execution through paths between specific definitions and uses.
Internal Boundary Value Testing
In many cases, partitions and their boundaries can be identified from a functional specification for a unit, as described under equivalence partitioning and boundary value analysis above.
However, a unit may also have internal boundary values that can only be identified from a structural specification.
It is a test case design technique where the testers use their experience to guess the possible errors that might occur and design test cases accordingly to uncover them.
Using any or a combination of the above-described test case design techniques; you can develop effective test cases.
What is a Use Case?
A use case describes the system’s behavior under various conditions as it responds to a request from one of the users. The user initiates an interaction with the system to accomplish some goal.
Different sequences of behavior, or scenarios, can unfold, depending on the particular requests made and conditions surrounding the requests.
The use case collects together those different scenarios.
Use cases are popular largely because they tell coherent stories about how the system will behave in use.
The users of the system get to see just what this new system will be and get to react early.