Certopolis

ISTQB Certified Tester Foundation Level

2-value vs 3-value boundary value analysis (ISTQB CTFL)

Boundary value analysis exercises the minimum and maximum values of ordered equivalence partitions. In 2-value BVA each boundary value gives two coverage items: the boundary value and its closest neighbour in the adjacent partition. In 3-value BVA it gives three: the boundary value and both its neighbours. ISTQB's CTFL v4.0 syllabus describes 3-value BVA as the more rigorous.

What is a boundary value?

The boundary values of a partition are its minimum and its maximum. BVA works only for ordered partitions: if two elements belong to a partition, every element between them must belong to it too. A list of unordered choices, such as payment methods, has no boundaries to analyse.

The technique targets boundaries because coding mistakes are most common there. The typical defects are a boundary implemented above or below its intended position, or a boundary left out altogether.

Worked example: 2-value and 3-value BVA

A field accepts whole numbers from 5 to 20. The valid partition has the boundary values 5 and 20. The invalid partitions next to it end at 4 and start at 21.

2-value BVA on the boundary value 5 gives 5 and 4, its closest neighbour in the adjacent partition. On 20 it gives 20 and 21. The coverage items for the valid partition's boundaries are 4, 5, 20 and 21. Coverage is the boundary values exercised divided by all identified boundary values.

3-value BVA on 5 gives 4, 5 and 6. On 20 it gives 19, 20 and 21. The coverage items are 4, 5, 6, 19, 20 and 21. The values 6 and 19 are coverage items but are not boundary values of any partition. Coverage is the boundary values and neighbours exercised divided by all identified boundary values and neighbours.

What does 3-value BVA catch that 2-value BVA misses?

Suppose the lower check should be n >= 5 but is coded as n == 5. The 2-value tests at 4 and 5 both pass: 4 is rejected and 5 is accepted. The 3-value test at 6 is likely to expose the defect, because 6 is wrongly rejected.

That is why the syllabus calls 3-value BVA more rigorous: it may detect defects that 2-value BVA overlooks. The price is more coverage items per boundary.

Where the exam catches people

  • Applying BVA to an unordered set of values: BVA needs ordered partitions.
  • Taking the second 2-value coverage item from inside the same partition: it is the closest neighbour in the adjacent partition. For a valid range of 5 to 20, the lower pair is 4 and 5, not 5 and 6.
  • Believing every 3-value coverage item is a boundary value: the inner neighbours, such as 6 and 19 above, are coverage items but not boundary values.
  • Getting the edge of a range wrong from its wording: 'at least 2 and fewer than 15' means the partition is 2 to 14, so its boundary values are 2 and 14.
  • Believing 2-value and 3-value BVA find the same defects: a comparison coded as equality can pass every 2-value test and fail a 3-value test.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A hotel booking system accepts a stay of at least 2 nights and fewer than 15 nights, counted in whole nights. Using two-value boundary value analysis, which of the following sets contains exactly the coverage items for the length of stay? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: D is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The coverage items are 1, 2, 14 and 15.

    Written from istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf

  2. A shop charges standard prices for orders of 1 to 19 items and bulk prices for orders of 20 items or more. Quantities are whole numbers. In a faulty build the bulk check is coded as 'quantity = 20', so every other quantity gets standard prices. A tester applies boundary value analysis (BVA) to the boundary between the standard and bulk partitions only. Which of the following statements is CORRECT? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: B is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The faulty build charges 19 the standard price and 20 the bulk price, exactly as required, so both tests pass. 3-value BVA gives each boundary value both neighbours: 18, 19 and 20 around 19, and 19, 20 and 21 around 20, so the set is 18, 19, 20 and 21. At 21 the requirement says bulk, but the build grants bulk only at exactly 20, so 21 is charged the standard price and that test fails. 18 is priced correctly, so the extra item that exposes this fault is the one just inside the bulk partition.

    Written from istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf

  3. A field accepts whole numbers from 1 to 10. A tester applies 3-value boundary value analysis to the two boundary values of the valid partition, 1 and 10. Which of the following values is a coverage item but is NOT a boundary value of any partition? Select ONE option.

    Right. In the game that’s Renown for your Test Analysis and Design building.

    Not that one: B is right. In the game your Test Analysis and Design building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The value 2 is one of these coverage items, yet it lies inside the valid partition and is neither its minimum nor its maximum, so it is not a boundary value.

    Written from istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf

Ask for something