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

Calculates function point value for a project, Q Calculates function point ...

Q Calculates function point value for a project with the following domain characteristics: No. of I/P = 30 No. of O/P = 62 No. of user Inquiries = 24 No. of fil

Illustrate about clear box testing and ad-hoc testing, Clear box testing an...

Clear box testing and Ad-hoc Testing Clear box testing is white box testing which is a structural testing method. It needs understanding of the internal logic and flows of the

Justify the term software is engineered, Justify the term "Software is engi...

Justify the term "Software is engineered" Software is engineered not manufactured. Although some similarities exit among software development and hardware manufacture, the two

Analyses the system design process of a project, Write a report which criti...

Write a report which critically analyses the system design process of a project. Projects might include designing a light rail network for a city, more environmentally-conscious bu

Applications software, APPLICATIONS SOFTWARE: As has been mentioned ea...

APPLICATIONS SOFTWARE: As has been mentioned earlier, software may conveniently be divided into: systems software (i.e., programs designed to control the execution of other pr

Define cyclomatic complexity, Define cyclomatic complexity? Cyclomatic ...

Define cyclomatic complexity? Cyclomatic complexity defined as software metric which gives the quantitative measure of logical complexity of the program. The Cyclomatic comp

What is the aim of testing, In well-run projects, the mission of the test t...

In well-run projects, the mission of the test team is not merely to perform testing, but to help decrease the risk of product failure. Testers look for manifest problems in the pro

Explain about function count - software metrics, Q. Explain about Function ...

Q. Explain about Function count? Function count:- It measures the functionality from the user point of view that is on the basis of what the user requests and receives in ret

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