Test Case Specification
This article is a glossary entry on test case specification, including exam questions and tags. This topic was important in my AP2 exam and I see it come up frequently in assessments.
In a Nutshell
- Equivalence classes: groups inputs that behave the same way
- Boundary value analysis: tests at exact limits (min, max, min±1, max±1)
- Branch/path coverage: ensures every code path gets executed
Technical Definition
Equivalence Classes
Divides input ranges into classes where the system behaves identically. One test case per class.
Boundary Value Analysis
Tests at the exact boundaries and just beyond them — errors commonly occur at boundaries.
Branch Coverage
Every branch (if/else) must execute at least once for both True and False conditions.
Path Coverage
Every possible combination of branches gets tested (resource-intensive).
Statement Coverage
Every line of code must execute at least once.
Key Exam Topics
- Equivalence classes: identify valid and invalid classes
- Boundary value analysis: test min, max, min-1, max+1
- Branch coverage: cover all if/else paths
- Path coverage: execute all paths (theoretically)
- Statement coverage: run every line
- White-box: knowledge of internal structure
- Black-box: testing only through interfaces
Core Components
- Equivalence class partitioning
- Boundary value analysis
- Branch coverage
- Path coverage
- Statement coverage
- Test case catalog
- Coverage analysis
- Tools (coverage tools)
- Risk-based prioritization
- Documentation
Practical Example (Age Validation)
// Rule: Age must be between 18 and 65
// Equivalence classes:
// - valid: [18, 65]
// - invalid: <18, >65
// Boundary value analysis:
// 17, 18, 19 (lower boundary)
// 64, 65, 66 (upper boundary)
// Test cases:
// - 17 (invalid)
// - 18 (valid, boundary)
// - 19 (valid)
// - 64 (valid)
// - 65 (valid, boundary)
// - 66 (invalid)
Common Exam Questions (Quick Answers)
- What is an equivalence class? A group of inputs with identical expected behavior.
- Why use boundary value analysis? Errors frequently occur at boundaries.
- Branch coverage vs. statement coverage? Branch: all if/else paths; statement: every line.
- Path coverage? Test all possible path combinations (very time-consuming).
Key Resources
- https://www.istqb.org
- https://junit.org/junit5/docs/current/user-guide/
- https://testing.googleblog.com



