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 hybrid design, Hybrid design: Pure top-down or pure bottom up appr...

Hybrid design: Pure top-down or pure bottom up approaches are often not practical thus hybrid approach which combines  the above two approaches is often used.

Explain storage testing, This is a explanation of whether or not certain pr...

This is a explanation of whether or not certain processing conditions use many storage [memory] than estimated.

Why software change occurs, Why software change occurs? Software change...

Why software change occurs? Software change happens because of the following reasons. New needs emerge when the software is used. The business environment changes. Errors need

Evaluate mccabes cyclomatic complexity, Q. For the flow graph showed in fig...

Q. For the flow graph showed in figure compute McCabe's Cyclomatic Complexity. Ans: In this flow graph Number of regions are 5 hence the Cyclomatic complexity is = 5

What is system, A set of people, machines, and methods prepared to accompli...

A set of people, machines, and methods prepared to accomplish a set of specified functions.

Explain exhaustive testing, Implementing the program with all possible comb...

Implementing the program with all possible combinations of values for program variables. Feasible only for small, simple programs.

What is utilization, Normal 0 false false false EN-IN ...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

What is 4test, What is 4Test? 4Test is a test scripting language which ...

What is 4Test? 4Test is a test scripting language which is used by SilkTest to compose test scripts to perform automated tests. It's an object-oriented fourth-generation langua

The most important feature of spiral model, The most important feature of s...

The most important feature of spiral model is Risk management is the important feature of spiral model.

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