Skip to content
IRC-Coding IRC-Coding
Test Case Design Equivalence Partitioning Boundary Value Analysis Branch Coverage Path Coverage Statement Coverage

Test Case Design: Equivalence Classes & Boundary Value Analysis

Master test case design methods: equivalence partitioning, boundary value analysis, branch coverage, and code coverage techniques with practical examples.

S

schutzgeist

2 min read
Test Case Design: Equivalence Classes & Boundary Value Analysis

Test Case Determination

This article is a term explanation for test case determination – including exam questions and tags.

In a Nutshell

  • Equivalence classes: groups inputs that behave the same way
  • Boundary value analysis: tests exactly at the boundaries (min, max, min±1, max±1)
  • Branch/path coverage: ensures that every code path is executed

Compact Technical Description

Equivalence Classes

Divides input ranges into classes for which the system responds identically. One test case per class.

Boundary Value Analysis

Tests exactly at the boundaries and immediately next to them – errors often occur at boundaries.

Branch Coverage

Every branch (if/else) must be executed at least once with True and False.

Path Coverage

Every possible combination of branches is tested (time-consuming).

Statement Coverage

Every line of code must be executed at least once.

Exam-Relevant Key Points

  • Equivalence classes: form valid/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: execute every line
  • Whitebox: knowledge of internal structure
  • Blackbox: access only through interfaces

Core Components

  1. Equivalence class formation
  2. Boundary value analysis
  3. Branch coverage
  4. Path coverage
  5. Statement coverage
  6. Test case catalog
  7. Coverage analysis
  8. Tools (coverage tools)
  9. Risk-based prioritization
  10. 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)

Typical Exam Questions (with Short Answers)

  1. What is an equivalence class? A group of inputs with the same expected behavior.
  2. Why boundary value analysis? Errors often occur at boundaries.
  3. Branch coverage vs. statement coverage? Branch: all if/else paths; statement: every line.
  4. Path coverage? Test all possible path combinations (very time-consuming).

Most Important Sources

  1. https://www.istqb.org
  2. https://junit.org/junit5/docs/current/user-guide/
  3. https://testing.googleblog.com
Back to Blog
Share: