Design test cases for loop testing, Software Engineering

Assignment Help:

Q. Regard as a program that reads a set of Data for 'n' no. of triangles. The program reads three integer values like representing the sides of triangles. The program prints for each triangle whether the triangle is isosceles or equilateral or a simple. Develop logic as well as do the following:

(i) Compute cyclomatic complexity?

(ii) Design test cases for loop testing?

Ans.                 The program logic will be like follows:

Enter three sides of a triangle.

Read a, b and c

If(a

Then is_a_triangle=TRUE

Else is_a_triangle=FALSE;

IF is_a_triangle

Then

If(a=b)XOR(a=c)XOR(b=c) AND NOT ((a=b)AND(a=c))

Then print "Triangle is Isosceles"

If(a=b)AND(b=c)

Then print "Triangle is Equilateral"

If(a<>b)AND (a<>c) AND(b<>c)

Then print "Triangle is scalene"

Else

Print "Not a triangle"

The flow graph of the problem is given as in

the fig:

(i) There are 6 independent paths i.e.

1,2,3,9,14

1,2,4,5,6,8,11,13,14

1,2,3,5,6,8,11,13,14

1,2,4,5,6,7,8,11,13,14

1,2,4,5,6,8,10,11,13,14

1,2,4,5,6,8,11,12,13,14

Cyclomatic complexity is 6

1907_Design test cases for loop testing.png

(ii) Few test cases are:

778_Design test cases for loop testing1.png


Related Discussions:- Design test cases for loop testing

Write about drivers and stubs, Write about drivers and stubs. Drivers a...

Write about drivers and stubs. Drivers and stub software require to be developed to test incompatible software. The " driver" is a program that accepts the test data and pri

Write short note on the various estimation techniques, Write short note on ...

Write short note on the various estimation techniques. Algorithmic cost modelling - the cost estimation is depend on the size of the software. Expert judgement - The experts fr

What are quality reviews, What are Quality reviews? This is the princip...

What are Quality reviews? This is the principal method of validating the quality of a process or of a product. A group examines part or all of a process or system and its do

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.

What is data integrity, What is Data integrity? Ans) Data integrity is o...

What is Data integrity? Ans) Data integrity is one of the six fundamental components of information security. Data integrity is the soundness, completeness and wholeness of the

Daa, 3. Explain asymptotic notations and their significance

3. Explain asymptotic notations and their significance

Applied physics, an isolated metal sphere has a radius r. when charged to a...

an isolated metal sphere has a radius r. when charged to a potential v, the charge on sphere is q. 1- state an expression, in terms of r and q, for potential v of sphere.

Microcomputer software packages:, MICROCOMPUTER SOFTWARE PACKAGES:  Th...

MICROCOMPUTER SOFTWARE PACKAGES:  There are a number of possibilities for using microcomputers in libraries and centres. What the microcomputer can accomplish is limited by tw

What does data object means, What does data object means? Data object i...

What does data object means? Data object is a group of attributes that behave as an aspect, quality, characteristic or descriptor of the object.

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