ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 2 - CTAL-TTA discussion

Report
Export

Consider the following control flow graph:

The control flow represents a software component of a car navigation system. Within the project the maximum cyclomatic complexity to be allowed is set at 5.

Which of the following statements is correct?

A.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 3.
Answers
A.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 3.
B.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 4
Answers
B.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 4
C.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 5.
Answers
C.
No defect needs to be reported since the cyclomatic complexity of the component is calculated at 5.
D.
A defect needs to be reported since the cyclomatic complexity of the component is calculated at 6.
Answers
D.
A defect needs to be reported since the cyclomatic complexity of the component is calculated at 6.
Suggested answer: D

Explanation:

Cyclomatic complexity is a measure of the number of linearly-independent paths through a program's source code, which is often used as a measure of the complexity of a program. The control flow graph provided represents the logic of a software component and has more than 5 nodes with decision points, indicating that the complexity would exceed the maximum allowed value of 5. The calculation for cyclomatic complexity is V(G) = E - N + 2P, where E is the number of edges, N is the number of nodes, and P is the number of connected components. In this case, the calculated cyclomatic complexity exceeds the allowed threshold, thus a defect should be reported.

asked 18/09/2024
Ridwan Sulaiman
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first