CS FundamentalsHardTCS NQT · GATE CS
A function is:
A function is:
if (a > 0) x = 1; if (b > 0) y = 1;What is the minimum number of test cases for 100% branch (decision) coverage?
- A. 1
- B. 3
- C. 2
- D. 4
Correct answer: C. 2
One test with a>0 and b>0 takes both true branches, and one with both false takes both false branches, so 2 tests cover all four branch outcomes.
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 system accepts an age from 18 to 60 inclusive. Using equivalence partitioning, what is the minimum number of test cases to cover all…
- A Scrum team completed 24, 30 and 27 story points in its last three sprints. The remaining backlog is 162 points. Using average velocity…
- A developer checks out a specific commit by its hash and makes two new commits, then switches to main without creating a branch. What is…
- In Basic COCOMO (organic mode, Effort = 2.4 x (KLOC)^1.05 person-months), what is the approximate effort for a 10 KLOC project?
- A task has optimistic 4 days, most likely 6 days and pessimistic 14 days. What is the PERT expected duration?
- Which deployment strategy releases a new version to a small subset of users first and widens the rollout gradually while monitoring?