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

Explain special value testing, Special Value Testing: It is the form of fu...

Special Value Testing: It is the form of functional testing. Special value testing happens when a tester uses his or her domain knowledge, experience with same program and informa

Software restructuring, Software restructuring Software restructuring c...

Software restructuring Software restructuring changes source code and / or data an effort to make it amenable to future changes. In general, restructuring does not change the o

What is assertion testing, A dynamic analysis method which inserts assertio...

A dynamic analysis method which inserts assertions about the relationship among program variables into the program code. The truth of the assertions is determined as the program im

What is oo function testing, Function testing of OO software is no dissimil...

Function testing of OO software is no dissimilar than validation testing of procedural software. Client involvement is generally part of this testing stage. In OO environment use c

The various steps of the reuse-oriented model, Describe the various steps o...

Describe the various steps of the reuse-oriented model.  The reuse-oriented model, also known as reuse-oriented development (ROD), is a method of software development in which

implicit and explicit conceptual model, difference between implicit and ex...

difference between implicit and explicit conceptual model

December 2010, differentiate between structured analysis and structured des...

differentiate between structured analysis and structured design

Explain common coupling with example, Q. Explain Common coupling with examp...

Q. Explain Common coupling with example? Common coupling: General coupling is when two modules share the same global data (example a global variable). Changing of the shared

How does the risk factor affect the spiral model, How does the risk factor ...

How does the risk factor affect the spiral model of software development? Ans: Risk Analysis phase is the most significant part of "Spiral Model". In this phase all possible (a

Explain code inspection, A manual [formal] testing [error detection] method...

A manual [formal] testing [error detection] method where the programmer reads source code, statement by statement, to a group who ask questions determined the program logic, determ

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