CS FundamentalsVery hardProduct company interview · GATE level
What is the minimum number of test cases that achieves MC/DC (unique-cause modified condition/decision coverage: for every condition, two tests that differ only in that condition and give different decision outcomes) for the decision (A || B) && (C || D)?
- A. 4
- B. 5
- C. 8
- D. 16
Correct answer: B. 5
MC/DC for n independent conditions needs at least n + 1 tests, here 5, and a brute-force search over all subsets of the 16 combinations confirms that 5 suffice and 4 do not. One minimal set, written as values of A B C D: 0001 (false), 0100 (false), 0101 (true), 0110 (true), 1001 (true). The pairs 0001/1001 show A, 0001/0101 show B, 0100/0110 show C and 0100/0101 show D - each pair differs in exactly one condition and flips the outcome. 4 tests cannot supply four such pairs; 16 is exhaustive testing and 8 is the common overestimate of two fresh tests per condition.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A configuration test has four parameters: browser (4 values), OS (3 values), language (2 values) and network (2 values). What is the…
- The tests (x = 3, y = 4) and (x = -2, y = 7) are run on this function. What statement, branch (decision) and condition coverage do they…
- Basic COCOMO for a semi-detached project uses Effort = 3.0 x KLOC^1.12 person-months and Development time = 2.5 x Effort^0.35 months. For…
- Intermediate COCOMO for an organic project uses Effort = 3.2 x KLOC^1.05 x EAF, where EAF is the product of the cost-driver multipliers. A…
- Function point counts with weights in brackets: external inputs - 6 simple (3), 4 average (4), 2 complex (6); external outputs - 5 average…
- A system is estimated at 300 function points, and the chosen language averages 53 lines of code per function point. Using basic COCOMO for…