Domain Testing: ON and OFF Points (ISTQB CTAL-TA Data-Based Test Techniques)
Overview
Domain testing is one of the data-based test techniques in the ISTQB Advanced Level Test Analyst (CTAL-TA) syllabus. It generalizes equivalence partitioning and boundary value analysis. It works for single variables and also for multidimensional input spaces, where several variables jointly define a valid region (a domain). The central idea is to pick precise test points relative to each boundary. These are the ON points and OFF points, supported by IN and OUT points. Exam questions in this area are very mechanical. If you master the rules below, they become easy marks.
1. Why Domain Testing Is Important
Defects cluster at boundaries. Developers often write < instead of <=, use a wrong constant, or combine variables incorrectly in a condition. Domain testing is valuable for four reasons:
- It finds boundary (domain) defects systematically. These include closure defects (wrong operator), shifted boundaries (wrong constant) and tilted boundaries (wrong coefficient in a multi-variable condition). It also covers missing or extra boundaries.
- It handles several variables at once. Classic BVA treats each variable separately. Domain testing can test conditions such as x + y <= 10 or income - expenses > 500.
- It is efficient. A small, well-defined set of points per boundary detects most boundary faults, which keeps the number of tests low.
- It is precise and measurable. Coverage can be defined as the proportion of required ON and OFF points actually tested.
2. What Domain Testing Is: Key Terms
- Domain: a region of the input space in which the system behaves the same way, such as a partition. It is bounded by one or more boundaries defined by conditions.
- Boundary: the border of a domain, defined by a condition such as x >= 18, x < 100 or x + y <= 10.
- Closed boundary: the points on the boundary belong to the domain. The operators are <=, >= or =.
- Open boundary: the points on the boundary do NOT belong to the domain. The operators are < or >.
- ON point: a value that lies exactly on the boundary. It is defined by the boundary equation, NOT by whether it is valid.
- OFF point: a value as close as possible to the ON point but not on the boundary, lying on the other side of the boundary. 'As close as possible' depends on the precision of the data, for example 1 for integers or 0.01 for money.
- IN point: a value inside the domain that is not on any boundary, typically used for the other variables.
- OUT point: a value outside the domain that is not on any boundary.
3. How It Works: The Core Rules
Rule A: The ON point is always on the boundary.
Take the boundary expression and replace the operator with '='. Any value satisfying that equation is an ON point.
Rule B: Closure decides on which side the ON and OFF points fall.
- Closed boundary (<=, >=): the ON point is inside the domain (valid). The OFF point is outside the domain (invalid).
- Open boundary (<, >): the ON point is outside the domain (invalid). The OFF point is inside the domain (valid).
Memory aid: the OFF point always has the opposite domain membership to the ON point.
Rule C: Distance equals precision.
The OFF point is one smallest step (epsilon) away from the ON point. For integers this is 1. For values with two decimals it is 0.01. Always check the stated precision in the question.
Rule D: Equality boundaries.
For a condition like x = 0, the ON point is 0. There are two OFF points, one on each side: -1 and 1 for integers. This is because the domain can be exited in both directions.
Rule E: Simplified strategy.
For each boundary, test one ON point and one OFF point. For multidimensional linear boundaries, a stronger variant uses several ON points (often one per dimension) plus one OFF point. This variant also detects tilted boundaries. Variables not involved in the boundary under test should take IN (typical valid) values. That way a failure can be attributed to the boundary being tested.
4. Worked Examples
Example 1: closed boundary, integers. Requirement: age >= 18 is accepted.
- ON = 18, which is in the domain (accepted).
- OFF = 17, which is outside (rejected).
Example 2: open boundary, integers. Requirement: quantity < 100 is accepted.
- ON = 100. This is the boundary value, and it is outside the domain (rejected).
- OFF = 99, which is inside (accepted).
This is the classic exam trap: the ON point here is an invalid value.
Example 3: decimals. Requirement: amount <= 50.00, precision 0.01.
- ON = 50.00, which is valid.
- OFF = 50.01, which is invalid.
Example 4: two-dimensional boundary. Requirement: integers x and y, with discount granted when x + y <= 10.
- ON points satisfy x + y = 10, for example (4,6) or (7,3). They are valid, because the boundary is closed.
- OFF point: the closest point not on the boundary, on the invalid side, for example (4,7), where x + y = 11.
- If the condition were x + y < 10, the same ON points (sum = 10) would be invalid. The OFF point would then be sum = 9, for example (4,5), which is valid.
Example 5: equality. Requirement: code = 5 triggers the special route.
- ON = 5.
- OFF = 4 and 6.
Example 6: range with two boundaries. Requirement: 10 <= x < 20, integers.
- Lower boundary (closed): ON = 10 (valid), OFF = 9 (invalid).
- Upper boundary (open): ON = 20 (invalid), OFF = 19 (valid).
- Total: 4 test values.
5. Which Defects ON and OFF Points Detect
- Closure defect (for example >= coded as >): the ON point gives the wrong result.
- Shifted boundary (for example 18 coded as 19 or 17): either the ON point or the OFF point gives the wrong result.
- Tilted boundary (wrong coefficient, as in x + 2y instead of x + y): needs several ON points along the boundary.
- Missing boundary: the OFF point is processed as if it were inside the domain.
- Extra boundary: IN points detect it, because they unexpectedly fail.
6. Relationship to Other Techniques
Domain testing extends equivalence partitioning, since domains are partitions. It also extends boundary value analysis. For one-dimensional integer domains, ON and OFF points resemble 2-value BVA. The difference is that domain testing defines points relative to the boundary condition, not relative to the 'last valid value'. That is why open boundaries produce an invalid ON point. Unlike BVA, domain testing also applies naturally to conditions with several variables.
Exam Tips: Answering Questions on Domain Testing: ON and OFF Points
Tip 1: Find the operator first. Underline <, <=, >, >= or =. This tells you whether the boundary is open or closed, and the whole answer depends on it.
Tip 2: The ON point is the boundary value, whether or not it is valid. Distractors often offer '99' as the ON point for x < 100. That is wrong: the ON point is 100.
Tip 3: The OFF point lies on the opposite side from the ON point. If the ON point is valid, the OFF point is invalid, and vice versa.
Tip 4: Check the precision. Look for wording such as 'integer', 'two decimal places' or 'whole euros'. An OFF point of 50.1 is wrong if the precision is 0.01.
Tip 5: For equality conditions, expect two OFF points.
Tip 6: Count test cases carefully. With the simplified strategy, count 1 ON + 1 OFF per boundary. A range with two boundaries gives 4 values. Check whether the question allows shared or combined points, and whether IN points must be added.
Tip 7: In multidimensional questions, substitute the values into the expression. Verify that the ON candidates make the expression exactly equal to the constant. Verify that the OFF candidate misses it by one precision step on the correct side.
Tip 8: Keep the other variables at IN values. When a scenario has several conditions, the correct test for one boundary keeps all other variables at typical valid values.
Tip 9: Link points to defect types. If asked which point reveals a >= versus > mistake, the answer is the ON point. A shifted constant is revealed by the ON or the OFF point.
Tip 10: Eliminate options systematically. First remove answers whose 'ON point' is not on the boundary. Then remove answers whose OFF point is on the wrong side or at the wrong distance. Usually only one option remains.
Quick Summary
- ON = on the boundary.
- OFF = nearest point not on the boundary, with opposite membership.
- Closed boundary: ON is valid, OFF is invalid.
- Open boundary: ON is invalid, OFF is valid.
- Equality: one ON point and two OFF points.
- Distance is the data precision.
- Other variables take IN values.