The Cyclomatic complexity of two modules A and B are 10 and 15 respectively :

What is the cyclomatic complexity of sequential integration of A and B ?

This question was previously asked in
NIELIT Scientific Assistant CS 5 Dec 2021 Official Paper
View all NIELIT Scientific Assistant Papers >
  1. 19
  2. 21
  3. 24
  4. 25

Answer (Detailed Solution Below)

Option 1 : 19
Free
NIELIT Scientific Assistant Quantitative Aptitude Mock Test
20 Qs. 20 Marks 30 Mins

Detailed Solution

Download Solution PDF

The correct answer is Option 1: 19.

Key Points

  • Cyclomatic complexity is a software metric used to measure the complexity of a program.
  • It is calculated by using the control flow graph of the program, where nodes represent processing tasks and edges represent control flow between the nodes.
  • The formula to calculate cyclomatic complexity is:
    M = E - N + 2P
    where M is the cyclomatic complexity, E is the number of edges, N is the number of nodes, and P is the number of connected components (usually 1 for a single program).
  • When integrating two modules sequentially, the cyclomatic complexity of the combined module is the sum of the individual complexities.
  • For modules A and B with cyclomatic complexities 10 and 15 respectively, the combined complexity is:
    10 + 15 - 1*2 + 2 = 19
    Subtracting the duplicate edge (1) and adding 2 for the single connected component.

Additional Information

  • Cyclomatic complexity is used to gauge the complexity of a program and to identify areas that may require more thorough testing or refactoring.
  • Higher cyclomatic complexity indicates a more complex program, which might be harder to understand, maintain, and test.
  • Tools like McCabe IQ, SonarQube, and others can automatically calculate cyclomatic complexity for various programming languages.
  • Reducing cyclomatic complexity can lead to more maintainable and reliable code.

Latest NIELIT Scientific Assistant Updates

Last updated on Feb 20, 2025

-> A total number of 113 revised vacancies have been announced for the post of Scientific Assistant in Computer Science (CS), Information Technology (IT), and Electronics & Communication (EC) streams.

-> Online application form, last date has been extended up to from 17th April 2025.

->The NIELT has revised the Essential Qualifications for the post of Scientific Assistant. Candidates must possess (M.Sc.)/ (MS)/ (MCA) / (B.E.)/ (B.Tech) in relevant disciplines.

 

-> The NIELIT Scientific Assistant 2025 Notification has been released by the National Institute of Electronics and Information Technology (NIELIT).

More Software Maintenance Questions

Hot Links: teen patti real cash teen patti royal - 3 patti teen patti diya teen patti lotus