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

What is the evolution of software engineering, What is the Evolution of sof...

What is the Evolution of software engineering Any application on computer runs by software. As computer technologies have changed tremendouslyinthe last five decades, consequen

Give detail discussion about black box testing, Give detail discussion abou...

Give detail discussion about Black box testing. Black box or behavioural testing emphasis on the functional needs of the software. It is used during the last stage of tes

Determine the higher order programming languages, Determine the Higher orde...

Determine the Higher order programming languages Higher order programming languages such as COBOL and PASCAL came into existence. Use of these made programming much easier. In

What is equivalence partitioning, Equivalence Partitioning: -Equivalence pa...

Equivalence Partitioning: -Equivalence partitioning is black box testing method that separates the input domain of a program into classes of data from which test cases can be deriv

Explain communicational cohesion, Communicational cohesion : Communicationa...

Communicational cohesion : Communicational cohesion is when parts of a module are grouped because they operate on the similar data (e.g. a module which operates on the similar reco

Explain walk-through, Explain Walk-through? Ans) A walk-through (in soft...

Explain Walk-through? Ans) A walk-through (in software QA) is a casual meeting for evaluation or informational purposes. A walk-through is also a method at an abstract level. It

How can manager be used to handle exceptions in QTP, How can recovery scena...

How can recovery scenario manager be used to handle exceptions in QTP? QTP provides a wizard through Recovery Scenario Manger which can recover unexpected errors and events wh

Define top-down testing, Define top-down testing. System developed star...

Define top-down testing. System developed starting from most general modules. Testing begins from the most general module.

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