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

Explain smoke testing, Explain Smoke testing - Smoke testing covers all...

Explain Smoke testing - Smoke testing covers all of the fundamental functionality of application. - It is considered as the main test for checking the functionality of appli

Explain effort adjustment factor, Q. Explain effort adjustment factor? ...

Q. Explain effort adjustment factor? All of the 15 attributes receives a rating on a six-point scale that ranges from very low to extra high (in importance or value). An endeav

Illustrate parameterization in qtp, Illustrate parameterization in QTP. ...

Illustrate parameterization in QTP. - Parameterization - Passing values from external source into script. - The number of values passed can be single or multiple. - It he

Explain process and product quality, Explain Process and product quality ...

Explain Process and product quality The quality of a developed product is influenced by the quality of the production process. This is important in software development as some

Data dictionary, What is data dictionary entry explain

What is data dictionary entry explain

Explain the reuse maintenance model, Q. Explain the reuse maintenance model...

Q. Explain the reuse maintenance model with the help of a diagram. Ans: Recycle maintenance model this model is based on the principal that maintenance could be viewed as an

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

What do you mean by polymorphism, Q. What do you mean by Polymorphism? ...

Q. What do you mean by Polymorphism? Polymorphism:- Polymorphism includes the ability to use the same message to objects of different classes and have them behave differently.

Diffrence between functional testing and structural testing, Q. Differentia...

Q. Differentiate between functional testing and structural testing. Ans: Functional testing signifies behavioural testing or Black box testing. In this techniques the teste

Draw the data flow diagram, Go to Blackboard, and print the project scenari...

Go to Blackboard, and print the project scenariolocated under the Project folder. Using Visio, draw a Physical DFD ofall three business processes described in theproject scenario.

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