Determine the cyclomatic complexity, Software Engineering

Assignment Help:

Q. Consider the program given below

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part"); }

(i) Draw the flow graph. (4)

(ii) Determine the cyclomatic complexity. (4)

(iii) Arrive at all the independent paths. (8)

 

 

Ans:

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part");

}

206_Determine the cyclomatic complexity.png

(ii) Cyclomatic complexity = E - N + 2 = 12 - 10 + 2 = 4

(iii) The four independent paths are

Path1 : 1 2 3 9 10

Path2 : 1 2 4 5 7 8 10

Path3 : 1 2 4 5 6 8 10

Path4 : 1 2 3 4 5 7 8 10


Related Discussions:- Determine the cyclomatic complexity

What are the different types of cohesion, What are the different types of C...

What are the different types of Cohesion? i. Coincidentally cohesive -The modules in which the set of tasks are related with each other loosely then such modules are known as

Explain the iterative model, Explain the Iterative Model Every release ...

Explain the Iterative Model Every release of Iterative Model is developed in a specific, fixed time period known as iteration. Each iteration focuses on a certain set of requir

Why do dns root servers hold entries for two-level, QUESTION - Name Service...

QUESTION - Name Services (a) Illustrate with help of a diagram the results of a DNS lookup and an ARP lookup assuming we are using IPv4. (b) Why do DNS root servers hold en

What is software metric, What is Software metric? Any type of measureme...

What is Software metric? Any type of measurement which relate to a software system, process or related documentation Lines of code in a program, the Fog index, number of

Srs, Why SRS document is also called as boack-box specification of a system...

Why SRS document is also called as boack-box specification of a system

Why winrunner may fail to identify an object on a gui, Why WinRunner may fa...

Why WinRunner may fail to identify an object on a GUI? WinRunner may fail to recognize an object in a GUI in below cases: - If it isn't a standard windows object - If the

Information storage and retrieval software, INFORMATION STORAGE  AND RETRI...

INFORMATION STORAGE  AND RETRIEVAL SOFTWARE: IBM (International Business Machines Corporation) was one of the earliest to invest money to develop software packages intended fo

Explain sci, What is SCI? Software Configuration Item is information th...

What is SCI? Software Configuration Item is information that is carried as part of the software engineering process.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd