Back to the 2025 paper

Module 4: Software Testing

20257m

Explain boundary value analysis and equivalence class testing in functional testing? How do they help?

Worked SolutionAI Assisted

Boundary Value Analysis & Equivalence Class Testing (Functional Testing)

Both are black-box (functional) testing techniques that design test cases from the input specifications without looking at internal code.

Equivalence Partitioning (Equivalence Class Testing)

Idea: Partition the input domain into classes such that all values in one class are expected to be treated identically by the program (same output/behaviour). Then test one representative value from each class — this drastically reduces the number of test cases while keeping high coverage.

Rules for partitioning:

  • Valid equivalence classes — inputs the system should accept.
  • Invalid equivalence classes — inputs the system must reject.

Example: A field accepts integers 1–100.

  • Valid class: {1 ≤ x ≤ 100} → test one value, e.g., 50.
  • Invalid class 1: {x < 1} → test, e.g., 0 (or −5).
  • Invalid class 2: {x > 100} → test, e.g., 200.
  • (Non-integers form further invalid classes.)

Benefit: systematic coverage of the whole input domain with minimal test cases; it reveals the presence of "class-wide" defects (a whole category of inputs mishandled).

Boundary Value Analysis (BVA)

Idea: Experience shows errors concentrate at the boundaries of input ranges (off-by-one mistakes are the most common defect). BVA therefore tests the values on and immediately around each boundary: minimum, just-above-minimum, just-below-maximum, maximum (and, depending on the flavour, also nominal interior values).

For the range [1, 100]:

  • Test 1, 2 (lower boundary + just above),
  • Test 99, 100 (just below max + max),
  • Optionally 0 and 101 (just outside, invalid).

Benefit: catches off-by-one and boundary-handling errors that equivalence partitioning alone would miss; extremely cost-effective because most real defects sit at boundaries.

How they help

  • High fault-detection per test case — both techniques target where defects actually cluster (representative classes + edges).
  • Reduced test count — instead of exhaustive input testing, a few well-chosen values cover the domain.
  • Complementary — equivalence partitioning provides representative coverage inside the classes; BVA adds coverage at the edges, so used together they give strong functional coverage.

Example summary (input 1–100)

Technique Test values
Equivalence classes 50 (valid), 0 & 101 (invalid)
BVA 1, 2, 99, 100 (and 0, 101 as boundaries)

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.