Exercise 2: Test Coverage With a Fourth Independent Condition — Possible Solution ==================================================================== IDENTIFYING THE RELEVANT PRINCIPLE ------------------------------ Per this chapter's own Step 7, the original three-condition rule (Admin, Owner, Locked) needed 2 x 2 x 2 = 8 test cases for full coverage, using the multiplication principle: each of the three conditions independently has 2 possible states (true or false), and the total number of combinations is the product of each condition's own number of possibilities. APPLYING THE SAME REASONING WITH A FOURTH CONDITION ------------------------------ Adding AccountActive as a fourth independent boolean condition adds one more factor of 2 to the multiplication principle's own product: 2 x 2 x 2 x 2 = 2^4 = 16 So 16 test cases are now needed for full coverage of the rule's own logic. WHY THIS FOLLOWS DIRECTLY FROM THE MULTIPLICATION PRINCIPLE, NOT A SEPARATE RULE ------------------------------ Per this chapter's own Chapter 9 material, "if one choice can be made in m ways and a second independent choice in n ways, the two together can be made in m x n ways." Each additional independent boolean condition is simply one more "choice" (true or false) that combines multiplicatively with all the others - going from three conditions to four doesn't require a new formula, only one more factor of 2 applied to the existing product. WHY "INDEPENDENT" MATTERS FOR THIS CALCULATION TO BE VALID ------------------------------ This doubling only holds because each condition is assumed independent of the others - if AccountActive were somehow logically forced to be true whenever Admin is true (for example), some of the 16 combinations would be impossible to actually construct, and the true number of meaningfully distinct test cases would be smaller. For four genuinely independent boolean conditions, though, all 16 combinations are real, distinct scenarios worth testing. WHY THIS WORKS AS AN ANSWER ------------------------------ It applies this chapter's own multiplication principle directly by adding one more factor of 2 to the existing three-condition calculation, explains why this follows from the same underlying rule rather than requiring new reasoning, and notes the independence assumption the calculation actually depends on.