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 use of a data flow diagram, What is the use of a data flow diag...

What is the use of a data flow diagram? A data flow diagram is used to represent the functional view of an application domain. It represents all the significant business proces

Software engineering, Software Engineering A  high technology system e...

Software Engineering A  high technology system encompasses a  number of  elements like   people, hardware, software, database, documentation, and process.  System engineering

Explain capability maturity model, Overview You are a Systems Analyst w...

Overview You are a Systems Analyst working for Zeppelin Industries Inc. Many of the software projects your company attempts to deliver are failing or have already failed. The

What is the test case, Test Case A test case is a unit level document d...

Test Case A test case is a unit level document describing the inputs, steps of implementation and the expected result of each test condition for each requirement from the BRD.

What is coupling, What is Coupling? Coupling is the measure of interconn...

What is Coupling? Coupling is the measure of interconnection among modules in a program structure. It depends on the interface complexity among modules.

Ms project, what is meant by gantt chart who gave the name who is the found...

what is meant by gantt chart who gave the name who is the founder

What is eva, What is EVA? Earned Value Analysis is a process of perform...

What is EVA? Earned Value Analysis is a process of performing quantitative analysis of the software project. It gives a common value scale for each task of software project. It

Software metrics, what is halstead software science measures

what is halstead software science measures

Explain validation, Validation (Product Oriented) Validation is worried...

Validation (Product Oriented) Validation is worried with whether the right functions of the program have been properly executed, and that this function will properly make the c

Reverse engineering, explain the effect of reverse engineering of software ...

explain the effect of reverse engineering of software development #

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