CS FundamentalsVery hardGATE CS · product placement
A function contains `if x > 5: A()` followed later by `if x < 3: B()`, and x is not changed between them. How many entry-to-exit paths are feasible, and what is V(G)?
- A. 4 feasible paths, V(G) = 3
- B. 3 feasible paths, V(G) = 3
- C. 3 feasible paths, V(G) = 2
- D. 2 feasible paths, V(G) = 3
Correct answer: B. 3 feasible paths, V(G) = 3
Of the 4 structural paths, x > 5 and x < 3 cannot both be true, so 3 are feasible. V(G) = 2 decisions + 1 = 3; basis-path testing can therefore produce an infeasible path, which testers must replace.
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 tester has no reliable way to know the correct output for a complex scientific simulation, so she checks that doubling every input mass…
- In which situation does a suite with 100% decision (branch) coverage still NOT achieve 100% multiple-condition coverage?
- You append line L1 to a tracked file f.txt, run git add f.txt, and then append line L2. Which statement about the three diff commands is…
- main has commits A-B-C-D. feature was created at B and has commits E-F. How many commits do git log main..feature and git log…
- On main (…-C-D) you run git merge feature, where feature has E-F-G, creating merge commit M. Its first parent is D and its second is G…
- On main with tip D (history A-B-C-D) you accidentally run git reset --hard HEAD~2. Which command brings the branch back to D, assuming…