Identifying Test Condition and Design Test Cases
Test Conditions
A test condition is an item or event that could be verified by one or more test cases, such as a function, transaction, feature, quality attribute, or structural element.
Test conditions are typically identified by analysing:
- Requirements and specifications documents.
- Risk analysis results.
- Architecture and design documents.
- Business processes and use cases.
Designing Test Cases
Once test conditions are identified, they are used to design test cases — a set of preconditions, inputs, actions, and expected results that verify a specific test condition.
- Test Case ID: A unique identifier.
- Preconditions: The state the system must be in before executing the test.
- Test Steps: The exact actions to perform.
- Test Data: The specific inputs used.
- Expected Result: The anticipated outcome if the software works correctly.
Traceability
Good test design maintains traceability between requirements, test conditions, and test cases, ensuring every requirement is covered by at least one test case.
From One Requirement to Conditions to Cases
Take a single requirement: "A registered user can log in with email and password. After three failed attempts, the account is locked for a period of time." Reading it carefully gives several separate test conditions:
- Login succeeds with a valid email and password.
- Login fails with a wrong password.
- Login fails with an unregistered email.
- The account locks after the third consecutive failure.
- A locked account cannot log in even with the correct password.
- The failure counter resets after a successful login.
Each condition is something that can be true or false about the system. Several test cases can verify one condition; for example, condition 2 could be checked with a wrong password, an empty password, and a password with different letter case.
Writing the Cases Out
| ID | Condition | Preconditions | Steps and data | Expected result |
|---|---|---|---|---|
| TC-LOGIN-01 | 1 | User asha@test.com exists and is active | Enter asha@test.com and correct password, click Login | Dashboard opens showing the user's name |
| TC-LOGIN-02 | 2 | Same user, zero failed attempts | Enter correct email and wrong password | Error "Invalid email or password"; user stays on login page |
| TC-LOGIN-04 | 4 | Same user, two failed attempts already | Enter wrong password a third time | Message says account is locked; lock is recorded |
| TC-LOGIN-06 | 6 | User has two failed attempts | Log in successfully, log out, enter one wrong password | Account is not locked; one failure counted |
Notice that the expected results are specific and checkable. "Login should work properly" is not an expected result; "the dashboard opens showing the user's name" is.
Techniques That Help You Find Conditions
- Equivalence partitioning and boundary values for any field with ranges, lengths or formats.
- Decision tables when several conditions combine, such as user type plus coupon plus payment method.
- State transition analysis when the system moves between states, as in the active, locked and unlocked account above.
- Use case and scenario walkthroughs for end-to-end flows across screens.
- Error guessing based on past defects in similar features.
Common Weaknesses in Test Design
- Writing only positive cases. Negative and edge cases tend to find more defects.
- Steps that depend on the previous test having run. Each case should set up its own preconditions so it can run alone.
- Hard-coding data that changes, such as today's date, without noting it.
- Combining many checks in one case, so a single failure hides the status of everything else.
- Leaving conditions undocumented and jumping straight to cases, which makes coverage gaps invisible.
Review checklist: every requirement has conditions, every condition has at least one case, each case has clear preconditions and one main purpose, and expected results can be judged pass or fail without guessing.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.