top of page

Test Design Techniques Explained: Equivalence Partitioning and Boundary Value Analysis | Amber Insights #017

Nov 9
11 min read
Glass panels separate conceptual data regions, with an orange threshold and nearby markers; Amber Insights Issue 017 by Amber Idumwonyi.

Introduction


An appointment starts exactly 24 hours from now. Should the patient be allowed to book it?


The answer appears straightforward until “now” means the time displayed in the browser, the time the request arrived, or the time the server actually made its decision. A test can use a carefully chosen number and still investigate the wrong rule.


Issue 015 explored how to select meaningful scenarios. Issue 016 developed those scenarios into repeatable cases, including checks just below, at, and just above an illustrative booking threshold. This issue examines the reasoning behind those choices: how to divide a domain, select representatives, and investigate its edges without overstating what the results establish.


Equivalence partitioning and boundary value analysis are useful because they make selection explainable. Their value depends on the Quality Engineer defining the right model before counting its tests.


01. Make the behaviour explicit before selecting values


For this article, equivalence partitioning groups values expected to receive the same relevant treatment. A representative is selected from each identified group. Boundary value analysis, or BVA, investigates the edges of ordered partitions and nearby values. These are complementary ways of choosing test data, rather than substitutes for deciding the expected behaviour.


Start by naming the decision. “Can the patient book?” includes eligibility, availability, timing, and successful allocation. “Does this lead time satisfy the minimum-lead-time rule?” is narrower. A rejection in the first investigation may say little about the second if the patient was ineligible all along.


The QE's first task is therefore to establish the test basis, the observation point, and the conditions held constant. Selecting elegant boundary values comes afterwards.


02. Carry forward the example without promoting an assumption into policy


The appointment-booking criteria in Issues 014–016 are teaching examples, not verified requirements for a real healthcare service. They include preventing double allocation and producing a confirmation after a successful booking. They do not establish a real organisation's eligibility policy or booking interface.


We retain illustrative rule W1 from Issues 015 and 016: booking is permitted when the slot starts at least 24 hours after the server's booking-decision time, measured in UTC at one-second precision. W1 remains an illustrative extension, not an agreed requirement inherited from Issue 014.


For this investigation, let d be the whole number of elapsed seconds between the controlled booking-decision instant and the slot-start instant. Twenty-four hours is 86,400 seconds. Within this model, the lead-time condition is satisfied when d ≥ 86,400.


We assume a synthetic eligible patient, a fresh available slot for every booking attempt, a controlled decision clock, and an authorised way to observe the timing decision. The interface must accept or construct the chosen instants without silently changing their precision. These are test-design dependencies to confirm, not facilities we claim exist in an application.


Passing the timing condition does not guarantee that a booking succeeds. A separate availability or allocation decision can still prevent it. Where a real implementation exposes only an overall rejection, the test needs diagnostic evidence before attributing the result to W1.


03. Partition by meaningful treatment


For the single timing predicate, divide the integer-second domain into two groups:

Partition

Domain

Representative

Expected timing decision under W1

P-short

d ≤ 86,399

43,200 seconds, or 12 hours

Minimum lead time not satisfied.

P-ready

d ≥ 86,400

172,800 seconds, or 48 hours

Minimum lead time satisfied.

The two groups do not overlap, and leave no integer-second value unassigned. Their definitions, rather than the convenient examples, determine membership. The 12-hour and 48-hour choices are interior representatives; the threshold checks come later.


Calling the first group “invalid” would be ambiguous. A well-formed appointment time can be unacceptable under a business rule. A malformed timestamp may never reach that rule. Keep representation validity separate from business acceptability.


Negative lead times currently belong to P-short because they fail this predicate. That does not mean a real service should treat a past appointment and a future appointment that is too soon identically in every respect. If the contract defines different messages or recovery actions, the relevant model needs separate groups for those outcomes.


Similarly, a missing timestamp, an impossible date, or an unsupported time-zone representation needs its own investigation. Their required treatment is not specified by W1.

Record that gap rather than assigning an invented error code.


The equivalence judgement is always tied to the behaviour being examined. Two values can be equivalent for a Boolean timing decision and different for validation, display, or recovery.


04. Use representatives to challenge the model


Suppose the decision instant is fixed at 2030-01-10 10:00:00 UTC. A slot at 22:00:00 that day provides the 12-hour representative. A slot at 10:00:00 two days later provides the 48-hour representative.


For the first check, retain evidence that the patient and slot satisfy the other relevant conditions, then observe that W1 rejects the lead time. For the second, observe that W1 permits the lead time. A successful booking can provide additional evidence, but an unrelated infrastructure failure should not be relabelled as a timing-rule failure.


If the 48-hour value behaves differently from another value in P-ready, investigate the reason.


There may be an undocumented maximum advance window, a date-range restriction, a precision conversion, or a defect. The response is to refine the model from evidence, not to keep calling the values equivalent because a spreadsheet groups them together.


A representative is a deliberate sample from an argued model. It is not proof that every member of that group behaves correctly.


05. Name the boundary criterion precisely


At one-second precision, the largest member of P-short is 86,399, and the smallest member of P-ready is 86,400. Both are partition boundary values.


ISTQB's 2-value BVA exercises each boundary value and its nearest neighbour in the adjacent partition. Its 3-value BVA also exercises the neighbour on the other side of each boundary value.


Shared values need only appear once in the resulting set. State which criterion and domain your selection uses.


Applied to our two adjacent integer partitions:

Selection

Distinct lead-time values in seconds

Purpose in this example

2-value BVA

86,399 and 86,400

Exercise both sides of the transition.

3-value BVA

86,398; 86,399; 86,400; 86,401

Include both neighbours of both partition boundary values.

For the boundary value 86,399, its neighbours are 86,398 and 86,400. For 86,400, they are 86,399 and 86,401. Their union contains four distinct values. “3-value” describes the selection around each boundary value; it does not promise three tests for the entire feature.


Issue 016's examples used 86,399, 86,400, and 86,401. Those remain useful checks around the acceptance threshold. This issue makes the chosen coverage convention explicit and adds 86,398 for the full 3-value set under the partition model above. We are extending the teaching set, not changing W1 or claiming the earlier examples were executed.

For illustrative W1, P-short ends at 86,399 seconds and P-ready starts at 86,400. The full 3-value neighbourhood is 86,398 to 86,401 inclusive.
Figure 1. A magnified view around the W1 transition. Values are discrete whole seconds; the four selected neighbours are not the whole input domain.yghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhg

06. Specify what “next to” means in the system


With the same controlled decision instant, the four boundary cases are:

Design ID

Slot start in UTC

Lead time

Expected W1 result

BV-017-01

2030-01-11 09:59:58

86,398 seconds

Condition not satisfied.

BV-017-02

2030-01-11 09:59:59

86,399 seconds

Condition not satisfied.

BV-017-03

2030-01-11 10:00:00

86,400 seconds

Condition satisfied.

BV-017-04

2030-01-11 10:00:01

86,401 seconds

Condition satisfied.

Use a fresh slot for each attempt, as Issue 016 required. Otherwise, one successful booking can consume the next test's slot and conceal the timing behaviour.


One second is the neighbour distance because our model explicitly uses whole seconds. It is not a universal testing constant. If a service accepts milliseconds, define what happens to subsecond input: reject it, retain it, or normalise it according to an agreed rule.


Rounding before comparison can move an input across the threshold; the QE should identify where that conversion occurs and test it separately.


Likewise, “24 elapsed hours” and “the same local clock time tomorrow” are different possible policies. W1 chooses the former. Do not quietly substitute calendar arithmetic or a local display for the UTC decision instants.


Python's documentation distinguishes aware and naive date-time objects and recommends aware objects for UTC representation; that is, implementation guidance, not a source for the business rule.


Hold the decision instant fixed where the test requires it. Setting a slot to “now plus 24 hours” in a test client, then allowing time to pass before the server evaluates it, can accidentally produce a below-threshold case. Record the actual decision instant and inputs so the observation remains interpretable.


07. Ask which plausible mistake each value could reveal


Consider three hypothetical implementations of the timing predicate. They are deliberately faulty teaching models, not defects found in a live product.

Hypothetical mistake

Behaviour that exposes it

Discriminating input

Use d > 86,400

Rejects the exact permitted threshold.

86,400 should satisfy W1.

Use d ≥ 86,399

Permits a value that is one second too soon.

86,399 should fail W1.

Use d == 86,400

Accepts only the exact threshold, rejecting later slots.

86,401 should satisfy W1.

The equality-only implementation would agree with W1 at 86,399 and 86,400. Adding 86,401 distinguishes them. An interior representative, such as 172,800 would expose it too. The techniques can overlap in the mistakes they reveal; their rationale still differs.


This is a useful review habit: describe a plausible wrong implementation that the selected check would distinguish from the intended behaviour. If none can be articulated, investigate whether the value adds meaningful information or merely increases the row count.


Do not turn that habit into a complete defect catalogue. Representation limits, different execution paths, and interactions can reveal failures beyond these three examples. A sound local selection does not establish that the application is free of other defects.


08. Keep the data model separate from the automation


The boundary table can drive a parameterised check. pytest supports supplying explicit argument sets to a test function. The following original example checks only a small supplied teaching model.

import pytest
from w1_model import w1_accepts

@pytest.mark.parametrize("lead_seconds, expected", [
    (86398, False),
    (86399, False),
    (86400, True),
    (86401, True),
])
def test_w1_boundary_model(lead_seconds, expected):
    assert w1_accepts(lead_seconds) is expected

The companion file defines w1_accepts as return lead_seconds >= 86400 for integer inputs. That makes the example runnable and its scope visible. It does not call a booking service, parse a timestamp, control a real server clock, or inspect allocations. No business rule for other input types is introduced by this model.


The expected values are written explicitly so a reviewer can inspect their relationship to W1. Generating the expected result by calling the same function under test would make the assertion circular. Even a separately written oracle deserves review against the requirement rather than automatic trust.


Property-based testing can add generated examples and useful invariants. Hypothesis, for example, uses strategies to supply values to tests. Selecting a suitable domain and a valid property remains a design responsibility. More generated values cannot resolve an undecided rule.


For a product test, replace the model observation with an authorised application interface and establish the clock, fixture, and evidence controls described earlier. Retain these design identifiers so a result can be traced to the exact selection that was executed.


09. Covering individual factors does not cover their interactions


A real booking decision may depend on lead time, patient eligibility, and slot availability. Testing a representative from each group of each factor is useful, but it does not exercise every combination. ISTQB calls the individual-factor criterion Each Choice and distinguishes it from combination coverage.


For this example, an ineligible patient could be rejected before the timing comparison occurs. A below-threshold time combined with an unavailable slot could produce the correct overall rejection while the timing rule is broken.


Start the W1 checks with other conditions satisfied so the intended observation is reachable. Then select interaction checks where the risks justify them.


Do not assume the real implementation's validation order. Establish observability with engineering, and treat an unobservable internal decision as an evidence limitation. A user-facing check can still be valuable without claiming to isolate every internal predicate.


The companion register includes separate design gaps for representation, clock precision, and interactions. Suggested owners identify who needs to resolve each gap; they are illustrative roles, not assignments to an actual delivery team.


Issue 018 will develop decision tables and state-transition testing for more complex rules. This issue does not pretend that a one-dimensional number line models the whole booking journey.

A stated rule and domain lead to partitions, a named boundary criterion, controlled execution and scoped evidence. Unresolved decisions return to clarification.
Figure 2. Selection needs a defined domain, an observable rule, and controlled execution before it can support a conclusion. Unresolved decisions return to clarification.


10. Report coverage against the model that produced it


For EP, identify the partitions in the denominator; for BVA, identify the boundary coverage items and the chosen variant. A coverage percentage describes exercised items in that model, not product quality or completeness.


The four W1 boundary cases here are designed, not executed against a product. Four selected values out of four intended values is a design-selection statement. It is not 100% executed BVA coverage of an application.

Design ID

Selection basis

Input or dependency

Expected result or decision

Product execution

Suggested owner

EP-017-01

P-short interior

d=43,200 seconds

W1 condition not satisfied

Not run

QE / Product Owner

EP-017-02

P-ready interior

d=172,800 seconds

W1 condition satisfied; other booking gates separate

Not run

QE / Product Owner

BV-017-01

Full 3-value set for both boundaries

d=86,398 seconds; fixed decision clock

W1 condition not satisfied

Not run

QE / Engineering Lead

BV-017-02

Full 3-value set for both boundaries

d=86,399 seconds; fixed decision clock

W1 condition not satisfied

Not run

QE / Engineering Lead

BV-017-03

Full 3-value set for both boundaries

d=86,400 seconds; fixed decision clock

W1 condition satisfied

Not run

QE / Engineering Lead

BV-017-04

Full 3-value set for both boundaries

d=86,401 seconds; fixed decision clock

W1 condition satisfied

Not run

QE / Engineering Lead

GAP-017-01

Representation contract

Missing/malformed/unsupported timestamp

Required handling unresolved; not defined by W1

Decision blocked; not run

Product Owner / Engineering Lead

GAP-017-02

Precision and observation

Real clock control and subsecond handling

Confirm precision contract and observable decision

Dependency unresolved; not run

Engineering Lead / QE

GAP-017-03

Interactions

Eligibility and availability with lead time

Select combinations and observable outcomes from real rules

Scope unresolved; not run

Product Owner / QE

The supplied local model checks have a different evidence scope: they exercise an intentionally small Python predicate and verify the teaching data. Their results cannot be transferred to a booking system. Keep those local verification results separate from the product execution column in the editable register.


An honest future product report would identify the W1 version, integer-second domain, controlled decision time, four selected values, actual observations, and remaining gaps. It would state that eligibility interactions, timestamp parsing, time-zone presentation and concurrent allocation need their own evidence. It would also say whether the real service has adopted W1 at all.


If the policy later changes, retain the old results against the old rule. Revise the partition definitions and expected outcomes, then perform new checks. Editing the denominator or expected result must not silently convert earlier evidence into a pass against the changed requirement.


11. Review the selection as an engineering argument


Before accepting a set of data, ask the designer to explain the rule in ordinary language, identify the domain and precision, and show where every selected value belongs. Then ask what observation would distinguish the correct behaviour from a plausible mistake.


The QE should be able to explain why values are grouped, why an edge is inclusive or exclusive, which other conditions are controlled, and which conclusions remain unsupported. Missing answers are useful findings: they tell the team where a policy decision, better observation or a different technique is needed.


For the booking example, the critical work happened before automation: recognising that W1 is illustrative, defining the integer domain, separating timing from overall booking success and checking both sides of the transition. The script records those choices; it does not establish that they are sound.


Good test data is defensible. It gives another person enough reasoning to challenge the model, reproduce the investigation, and understand the limits of the result.


About the author

Amber Idumwonyi is a senior Quality Engineering leader and founder of LEMP. Her work spans enterprise software delivery, UK public-sector technology programmes, test strategy, automation, accessibility, governance, and technology workforce development. Amber Insights shares practical Quality Engineering knowledge for technology professionals and those developing their skills.


Read More:

Comments


bottom of page