Test case design techniques in software engineering refer to how we set up a test case which is a set of activities needed to test a specific function after a software development process. Using the right test case design methods will set a strong foundation for the project, increasing productivity and accuracy. Otherwise, you may fail to identify bugs and defects in the software testing process.
As it is critical that your test cases are designed well, let’s learn about the most popular test case design methods with examples in software testing.
Categories of Software Testing Techniques
Test techniques are categorized into black-box, white-box, and experience-based.
In this tutorial, we will guide you through the Black-box testing with 5 major test case design techniques:
- Boundary Value Analysis (BVA)
- Equivalence Class Partitioning
- Decision Table based testing
- State Transition
- Error Guessing
5 Important Test Case Design Techniques
1. Boundary Value Analysis (BVA)
Boundary value analysis is a black-box testing technique to test the boundaries between partitions instead of testing multiple values in the equivalence region. This is because we often find a large number of errors at the boundaries rather than the center of the defined input values, and we suppose that if it is true for boundary values, it is true for the whole equivalence region. Also, BVA is considered an additional test case design type for equivalence classification.
Guide to Boundary Value Analysis design: Select input variable values at their minimum/maximum, just below the minimum/maximum, just above the minimum/maximum, a nominal value (optional).
Boundary Value Analysis (BVA) test case design technique
Example: Valid age values are between 20 – 50.
- Minimum boundary value is 20
- Maximum boundary value is 50
- Take: 19, 20, 21, 49, 50, 51
- Valid inputs: 20, 21, 49, 50
- Invalid inputs: 19, 51
So, test cases will look like:
- Case 1: Enter the value 19: Invalid
- Case 2: Enter number 20: Valid
- Case 3: Enter number 50: Valid
- Case 4: Enter number 51: Invalid
Boundary Value Analysis test case design example
You might also concern: How to choose the right test automation framework?
2. Equivalence Class Partitioning
Equivalent Class Partitioning (or Equivalent Partitioning) is a test case design method that divides the input domain data into various equivalence data classes, assuming that data in each group behaves the same. From that, we will design test cases for representative values of each class that can stand for the result of the whole class.
The concept behind the Equivalent Partitioning testing technique is that the test case of a typical value is equal to the tests of the rest values in the same group. Hence, it helps reduce the number of test cases designed and executed.
Steps to design Equivalent Partitioning test case:
- Define the equivalence classes
- Define the test cases for each class
Example: Valid usernames are within 5 – 20 text-only characters.
Equivalence Class Partitioning test cases design example
So, test cases will look like:
- Case 1: Enter within 5 – 20 text characters: Pass
- Case 2: Input <3 characters: Display error message “Username must be from 5 – 20 characters”
- Case 3: Enter >20 characters: Display error message “Username must be from 5 – 20 characters”
- Case 4: Leave blank or no-text characters: Display error message “Invalid username”
3. Decision Table
Decision Table is a software testing technique based on cause-effect relationships, also called a cause-effect table, used to test system behavior in which the output depends on a large combination of input. For instance, navigate a user to the homepage if all blanks/specific blanks in the log-in section are filled in.
First and foremost, you need to identify the functionalities where the output responds to different input combinations. Then, for each function, divide the input set into possible smaller subsets that correspond to various outputs.
For every function we will create a decision table. A table consists of 3 main parts:
- A list of all possible input combinations
- A list of corresponding system behavior (output)
- T (True) and F (False) stand for the correctness of input conditions.
Example:
- Function: A user will be navigated to the homepage if successfully log in.
- Conditions for success log in: correct username, password, captcha.
- In the Input section: T & F stands for the correctness of input information.
- In the Output section: T stands for the result when the homepage is displayed, F stands for the result when an error message is shown.
Look at the image below for more details.
Decision table test cases design example
So, test cases will look like:
- Enter correct username, password, captcha: Pass
- Enter wrong username, password, captcha: Display error message.
- Enter correct username, wrong password and captcha: Display error message.
- Enter correct username, password and wrong captcha: Display error message.
4. State Transition
State Transition is another way to design test cases in black-box testing, in which changes in the input make changes to the state of the system and trigger different outputs. In this technique, testers execute valid and invalid cases belonging to a sequence of events to evaluate the system behavior.
For example: When a user logs into an e-banking app on his mobile phone, if he enters the wrong password 3 times in a row, his account will be blocked. That means he will be able to log in if he enters the correct password at the 1st, 2nd, 3rd try, and the state will be transitioned into Access Accepted. Look at the diagram in the image below.
State transition diagram example – Test cases design techniques
The State Transition technique is often used to test the functions of the Application Under Test (AUT) when the change to the input makes up changes in the state of the system and produces distinct outputs.
5. Error Guessing
In the Error Guessing testing technique, test cases are designed mostly based on experiences of the test analysts. He/she will try to guess and assume the possible errors or error-prone situations which can prevail in the code; hence the test designers must be skilled and experienced testers.
In Error Guessing, the test cases could be based on:
- Previous experience of testing related/similar software products.
- Understanding of the system to be tested.
- Knowledge of common errors in such applications.
- Prioritized functions in the requirement specification documents (to not miss them).
Which Test Case Design Techniques for You to Go With?
We’ve gone through 5 important test case design techniques in black-box testing. Let’s summarize them once again:
- Boundary Value Analysis (BVA): Test the boundaries between partitions with the assumption that they stand for the behavior of corresponding equivalence regions.
- Equivalence Class Partitioning: Divide the input domains into smaller equivalence data classes and design test cases for each.
- Decision Table: used when the output responds to varied combinations of input.
- State Transition: used when there’s a sequence of input events that can change the state of the system and produce different output.
- Error Guessing: based on experience, knowledge, intuition to predict the error and defects which can prevail in the code, often used after another formal testing technique.
That’s LQA guide on how to write test cases for better test execution. Don’t hesitate to contact us if you need further assistance regarding software testing!
- Website: https://www.lotus-qa.com/
- Tel: (+84) 24-6660-7474
- Fanpage: https://www.linkedin.com/company/lqa/
Frequently Asked Questions about Test Case Design Techniques
What are test case design techniques and why are they important?
Test case design techniques are systematic methods used to create test cases that effectively validate software functionality. These techniques help ensure comprehensive testing coverage and the detection of potential defects. They are important because they guide testers in designing tests that target specific aspects of the software, thereby increasing the likelihood of identifying hidden issues before the software is released.
What are some common test case design techniques?
Universal test case design techniques are Boundary value analysis, Equivalence class partitioning, Decision table, State transition, Error guessing.
How do you choose the right test case design technique?
The choice of test case design technique depends on factors such as the complexity of the software, the project’s requirements, available resources, and the specific types of defects that are likely to occur. It’s often beneficial to use a combination of techniques to ensure comprehensive coverage. The technique chosen should align with the goals of testing, the critical functionalities of the software, and potential risks involved.