What a requirements-based test case contains
A test case is useful when someone else can run it and reach the same verdict. For hardware and embedded products that means every test case names the requirement it verifies, the state the device must be in, the exact input, the steps and the result that decides pass or fail.
| Field | What it holds |
|---|---|
| Test case ID | A unique, stable identifier, for example TC-F-001 for a functional test and TC-S-001 for a system test. |
| Title | What is tested, in one line. |
| Requirement reference | The ID of the requirement (or requirements) it verifies. This is what makes traceability possible. |
| Test type | Functional, system or non-functional. |
| Category | Positive (valid input, expected behaviour), negative (invalid input or a fault) or boundary (at or just beyond a limit). |
| Priority | How important the test is, usually from the risk of the requirement. |
| Objective | The behaviour the test proves. |
| Preconditions | The state of the device and the test bench before the first step. |
| Test data | The exact values used. |
| Steps | Numbered actions, one action per step. |
| Expected result | Observable and measurable: a value, a message, a signal, a time. |
| Status | Not executed, pass, fail or blocked, filled in when the test is run. |
The free functional and system test case templates linked at the end of this article use exactly these columns.
Step 1: make the requirement testable
Before writing a test, read the requirement as a tester. A testable requirement describes one behaviour, has a measurable acceptance criterion and states its limits. Take two requirements from an infotainment sample project:
- SYS-AUD-004: "Bass and treble shall be adjustable from -10 to 10 in steps of 1." Testable: the range and the step are stated.
- SYS-AUD-005: "The system shall apply the last selected audio profile within 2 seconds after ignition ON." Testable, but it raises a question: what happens on the very first ignition, when no profile was ever selected?
Write such questions down and get them answered before the tests are final. An unanswered question is a test that cannot be judged.
Step 2: find the inputs, the outputs and the limits
List what the requirement takes in, what it produces and where its limits are. The limits are where most defects hide.
| Requirement | Input | Valid range | Output to observe |
|---|---|---|---|
| SYS-AUD-003 (profile name) | Name length and characters | 3 to 20 characters; letters, digits and spaces | Name accepted or rejected |
| SYS-AUD-004 (bass, treble) | Bass or treble value | -10 to 10, steps of 1 | Applied setting |
| SYS-AUD-006 (speed lock-out) | Vehicle speed | Touch-screen changes allowed up to 5 km/h; blocked above | Touch-screen change accepted or blocked |
Step 3: write positive, negative and boundary cases
Split every input into equivalence partitions (values the system should treat the same way) and test each partition once. Then test the boundaries: the first and last valid value and the first invalid value on each side.
| Category | Value | Expected |
|---|---|---|
| Boundary (invalid) | 2 characters | Rejected |
| Boundary (valid) | 3 characters | Accepted |
| Positive | 10 characters, letters and a space | Accepted |
| Boundary (valid) | 20 characters | Accepted |
| Boundary (invalid) | 21 characters | Rejected |
| Negative | "Rock!" (a character that is not allowed) | Rejected |
Read the wording of a limit carefully. SYS-AUD-006 blocks changes while the speed exceeds 5 km/h, so 5 km/h itself is still allowed. The boundary tests are therefore at 5 km/h (change accepted) and just above it, for example 6 km/h (change blocked), plus the speed resolution your bench can actually set.
Step 4: write the test case
A functional boundary test for SYS-AUD-004, written out in full:
| Field | Value |
|---|---|
| Test case ID | TC-F-001 |
| Title | Bass accepts its upper limit of 10 and stops there |
| Requirement reference | SYS-AUD-004 |
| Test type / category / priority | Functional / Boundary / High |
| Objective | Show that bass can be set to 10 and that the control does not go beyond 10 |
| Preconditions | Head unit on; Settings > Audio open; bass at 9 |
| Test data | Bass 9 → 10 → one more step up |
| Steps | 1. Press bass + once. 2. Read the displayed value. 3. Press bass + once more. 4. Read the displayed value. |
| Expected result | Step 2 shows 10. Step 4 still shows 10; no value above 10 is applied. |
And a system test for an embedded requirement from a bootloader and OTA sample project, REQ 4: "After an update the new image shall confirm itself within 30 seconds of start-up; otherwise the bootloader shall roll back to the previous slot on the next reset."
| Field | Value |
|---|---|
| Test case ID | TC-S-001 |
| Title | An update that never confirms itself is rolled back on the next reset |
| Requirement reference | REQ 4 |
| Test type / category / priority | System / Negative / High |
| Preconditions | Device running image version N in slot A; an update image N+1 that is built not to confirm itself |
| Steps | 1. Install N+1 (written to slot B). 2. Let it start and wait longer than 30 seconds. 3. Reset the device. 4. Read the running version and the active slot. |
| Expected result | After step 3 the device runs version N from slot A; the update status reports rolled back. |
Agree the timing tolerance before the test is run: "within 30 seconds" needs a stated measurement method and resolution, otherwise a confirmation at 30.2 s cannot be judged.
Step 5: trace every test to its requirement
A requirements traceability matrix (RTM) lists every requirement with the tests that verify it. It answers the question a reviewer will ask: which requirements are not tested yet?
| Requirement | Test cases | Positive | Negative | Boundary | Status |
|---|---|---|---|---|---|
| SYS-AUD-003 | TC-F-010 … TC-F-015 | 1 | 1 | 4 | Covered |
| SYS-AUD-004 | TC-F-001, TC-F-002 | 0 | 0 | 2 | Partially covered |
| SYS-AUD-008 | — | 0 | 0 | 0 | Not covered |
A practical rule: call a requirement covered when it has at least one positive test and at least one negative or boundary test. SYS-AUD-004 above has boundary tests only, so a positive test (for example bass set to 0) is still missing.
Common mistakes
- Testing only the happy path: no negative or boundary cases.
- Expected results that cannot be measured, such as "works correctly".
- Several behaviours in one test case, so a failure does not say what broke.
- Missing preconditions, so the test only passes on the bench of the person who wrote it.
- Tests that name no requirement, so coverage cannot be shown.
- Off-by-one limits: "exceeds 5" and "at least 5" need different boundary values.
Checklist
- Every requirement is testable: one behaviour, a measurable criterion, stated limits
- Open questions are written down and answered
- Each input is split into valid and invalid partitions
- Boundaries are tested on both sides
- Every test case has preconditions, exact test data, numbered steps and a measurable expected result
- Every test case names its requirement
- The traceability matrix shows no requirement without a positive and a negative or boundary test
Do it faster with MithraTiny Test Case Generator Agent
Turn requirements into functional and system test cases, with a traceability matrix and a coverage report.
Sources
- ISO/IEC/IEEE 29119-4, Software and systems engineering — Software testing — Part 4: Test techniques. ISO/IEC/IEEE, Equivalence partitioning and boundary value analysis.
Related
By MithraTiny AI Labs · Published 2026-11-25