About

4.2 Checking a Given Test Set

Theory: Checking a Given Test Set

Building an MC/DC table is half the skill. The other half, and a favourite exam format, is being handed a set of rows and asked: is this a test set? Is it minimum? This lesson returns to A AND (B OR C) from 3.5, adds two speed skills the professor showed in class, and turns the checking into a fixed two-question routine.

Here is the completed table again (minimum sets: {2, 5, 6, 7} and {3, 5, 6, 7}):

RowABCResultA variesB variesC varies
1FFFF
2FFTF6
3FTFF7
4FTTF8
5TFFF76
6TFTT25
7TTFT35
8TTTT4

Skill 1: Fill the Result Column Fast

The professor used masking (3.4) to save time. In A AND (B OR C), A is joined by AND to the rest:

It is like a two-lock door: if the first lock is shut, you do not need to inspect the second one. Splitting the table at the variable that changes slowest (A, every 4 rows) turns an 8-row calculation into two very short ones.

Skill 2: Start with the Columns That Give No Choice

Columns B and C have only one pair each. A column with only one pair gives you no choice: that pair must be in every answer. So rows 5, 6 and 7 are in every minimum set, and after that you only need to add one row from an A pair.

The general habit: start with the column that has the fewest pairs. It has no choice, so it is the safest place to begin.

Can You Give a Non-Minimum Test Set?

The professor asked this in class. The easiest way: take one pair from each column and do not care about overlap.

It has 5 rows instead of 4. It is a real test set, but it is not minimum.

Checking Sets That Someone Gives You

Then the professor gave sets and asked: is this a test set? Check each extended column for a whole pair inside the set:

Set of rowsA pair inside?B pair inside?C pair inside?RowsVerdict
{4, 5, 6, 7, 8}yes, {4, 8}yes, {5, 7}yes, {5, 6}5Test set, not minimum
{2, 4, 5, 6, 7}yes, {2, 6}yes, {5, 7}yes, {5, 6}5Test set, not minimum
{3, 4, 5, 7, 8}yes, {3, 7}yes, {5, 7}no, row 6 missing5Not a test set

Look at the last set. Column C has only one pair, {5, 6}. Row 6 is missing, so column C has no pair. That means the set is not an MC/DC test set at all, even though it has plenty of rows.

How to Check Any Test Set: Two Questions

The exam often gives you a set and asks you to check it. Always ask these two questions, in this order:

Diagram loads as you scroll.

  1. Is it a test set? Look at every extended column. Is there at least one full pair inside the set? If any column has no pair, the answer is no. Stop here.
  2. Is it minimum? Count the rows. Exactly n+1n + 1 rows means minimum. More rows means not minimum.

Exam radar: the size trap. A set can have the correct size (n+1n + 1 rows) and still not be a test set. The size tells you nothing until you have checked the pairs. The past exam question in 4.3 is exactly this trap.

How to write the answer: answer the question first, then justify it per column. For example: “No. {3, 4, 5, 7, 8} is not an MC/DC test set, because condition C has no independence pair: its only pair is {5, 6}, and row 6 is not in the set.” Name the failing column and the missing row.


Worked Examples

Exercise 1

For A AND (B OR C), is {2, 3, 5, 6, 7} a test set? Is it minimum?

Show solution ↓
Solution

Question 1 (pairs). A: {2, 6} is inside (and so is {3, 7}) ✓. B: {5, 7} is inside ✓. C: {5, 6} is inside ✓. Every column has a whole pair, so yes, it is a test set.

Question 2 (size). It has 5 rows, but n+1=3+1=4n + 1 = 3 + 1 = 4. So it is not minimum. (Removing either row 2 or row 3 gives a minimum set.)

Exercise 2

For A AND (B OR C), is {3, 4, 5, 7, 8} a test set?

Show solution ↓
Solution

No. Column C has only one pair, {5, 6}, and row 6 is missing. So condition C has no independence pair, and the set does not satisfy MC/DC. Columns A ({3, 7}, {4, 8}) and B ({5, 7}) are fine, but one failing column is enough. Since Question 1 already fails, there is no need to look at the size.

Exercise 3

A classmate proposes {2, 3, 5, 6} for A AND (B OR C), saying “it has n+1=4n + 1 = 4 rows, so it is a minimum test set.” Check the claim.

Show solution ↓
Solution

Check the pairs before the size.

  • A: {2, 6} inside ✓.
  • B: the only pair is {5, 7}, and row 7 is missing ✗.
  • C: {5, 6} inside ✓.

Not a test set, so it cannot be a minimum test set either. This is the size trap: 4 rows is the right size, but the size means nothing until every column has a pair. Rows 2 and 3 both come from A pairs, so one row is wasted; the classmate should have started from the no-choice columns B and C (forcing 5, 6, 7) and added only one A row.

Exercise 4

Use masking to fill the result column of A OR (B AND C) quickly, without evaluating each row in full.

Show solution ↓
Solution

A is joined to the rest by OR.

  • When A is true (rows 5–8), the whole result is true whatever B and C are: T, T, T, T.
  • When A is false (rows 1–4), the result is just B AND C, which follows the AND pattern on (B, C) = FF, FT, TF, TT: F, F, F, T.

So the result column, rows 1 to 8, is F, F, F, T, T, T, T, T. Check row 4: (F, T, T) → F OR (T AND T) = T ✓.

Exercise 5

For A OR (B AND C) the pairs are A {1, 5}, {2, 6}, {3, 7}; B {2, 4}; C {3, 4}. Check each set with the two questions:

(a) {1, 2, 3, 4, 5}   (b) {2, 3, 4, 5}   (c) {2, 3, 4, 7}

Show solution ↓
Solution

Here n=3n = 3, so a minimum set has 4 rows.

  • (a) {1, 2, 3, 4, 5}: A has {1, 5} ✓, B has {2, 4} ✓, C has {3, 4} ✓. Test set, not minimum (5 rows).
  • (b) {2, 3, 4, 5}: B {2, 4} ✓ and C {3, 4} ✓, but A needs {1, 5}, {2, 6} or {3, 7}: row 5’s partner 1 is missing, and 6 and 7 are missing. Not a test set, even though it has 4 rows (the size trap).
  • (c) {2, 3, 4, 7}: A {3, 7} ✓, B {2, 4} ✓, C {3, 4} ✓, and 4 rows. Minimum test set.
Exercise 6

For (A OR B) AND C (pairs: A {2, 6}; B {2, 4}; C {3, 4}, {5, 6}, {7, 8}), give one non-minimum test set, and explain which column you should start from when looking for a minimum one.

Show solution ↓
Solution

Non-minimum set. Take one pair from each column without caring about overlap, e.g. A {2, 6} + B {2, 4} + C {7, 8} = {2, 4, 6, 7, 8}: 5 rows, every column has a whole pair, so it is a test set but not minimum.

Where to start. Start with the columns that give no choice: A and B each have only one pair, so rows 2, 4 and 6 are forced. Then add a C pair that reuses a forced row: {3, 4} (add 3) or {5, 6} (add 5). The minimum sets are {2, 3, 4, 6} and {2, 4, 5, 6}.