CS FundamentalsHardGATE CS · Software Engineering · Advanced
The control-flow graphs of a program's two separate routines have E = 16, N = 13 and E = 9, N = 8 edges and nodes respectively (each graph has one entry and one exit and is connected, and the routines are not linked by call edges). By McCabe's formula V(G) = E - N + 2P applied to the combined graph with P connected components, how many linearly independent paths does the program have in total, and what is the V(G) of the larger routine alone?
- A. 8 in total, 5 for the larger routine
- B. 8 in total, 4 for the larger routine
- C. 6 in total, 5 for the larger routine
- D. 10 in total, 5 for the larger routine
Correct answer: A. 8 in total, 5 for the larger routine
Combined: E = 25, N = 21, P = 2, so V = 25 - 21 + 4 = 8, which equals the sum of the routines' own values (5 + 3). The larger routine alone has 16 - 13 + 2 = 5. Using P = 1 for the combined graph undercounts by 1.
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 project has these activities (duration in days; predecessors): A (3; none), B (4; none), C (5; A), D (2; A, B), E (6; B), F (4; C, D), G…
- The critical path of a project has four activities with (optimistic, most likely, pessimistic) durations in days: (2, 4, 8), (3, 5, 13)…
- A system has component A (reliability 0.98) in series with a parallel pair B (0.90) and C (0.85) - the pair works if at least one works…
- A server has MTTF = 400 hours and MTTR = 8 hours. Two identical servers run in active-active mode (the service is up if at least one…
- Which list orders these module-cohesion types from the most desirable (strongest) to the least desirable (weakest)?
- In the Jelinski-Moranda reliability model a program starts with N = 10 faults, each fault contributes a failure rate of 0.02 per hour, and…