CS FundamentalsHardTCS NQT · Infosys interview pattern
What is the minimum number of test cases needed to achieve MC/DC (modified condition/decision coverage) for the decision if (A && B)?
- A. 3
- B. 2
- C. 4
- D. 1
Correct answer: A. 3
Each condition must be shown to independently change the outcome. With (T, T) → true, (F, T) → false shows A’s effect and (T, F) → false shows B’s effect: 3 tests. 2 achieves only decision coverage; 4 is exhaustive combination testing. In general MC/DC needs n + 1 tests for n conditions.
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 method in class Invoice spends most of its code reading fields of a Customer object (name, address, discount tier) and barely uses…
- Tasks and durations (days): A 3; B 4 (after A); C 2 (after A); D 5 (after B and C); E 1 (after C). What is the total slack (float) of task…
- A form has 3 parameters — browser (3 options), OS (3 options) and language (3 options). Exhaustive testing needs 27 combinations. What is…
- A new app version is first served to 5% of users while error rates and latency are watched; if the metrics stay healthy, the share is…
- According to Semantic Versioning precedence rules, which list is in correct ascending order?
- Counting every simple condition of a compound boolean expression as a separate decision (each && / || adds one), what is the cyclomatic…