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 are the various testing activities, What are the various testing activ...

What are the various testing activities? i. Test planning ii. Test execution iii. Test case design iv. Data collection v. Effective evaluation

Distinguish among alpha and beta testing, Distinguish between alpha and bet...

Distinguish between alpha and beta testing. Alpha and beta testing are the kinds of acceptance testing. Alpha test: The alpha testing is attesting in which the version of compl

Mention some of the notations for requirements specification, Mention some ...

Mention some of the Notations for requirements specification. Structured natural language: Use standard Templates or form. Design description language: Programming langua

What is integration testing, What is Integration testing: - This test i...

What is Integration testing: - This test is performed to determine the interfaces among system components, interactions between the application and the hardware, file system, a

Discuss in details about functional modeling, Discuss in details about Func...

Discuss in details about Functional Modeling. This model describes the computations that take part within a system. This model is helpful when the conversion from the inp

Define coupling and discuss various types of coupling, Define coupling and ...

Define coupling and Discuss various types of coupling? Define coupling. Discuss various types of coupling. Ans: A Coupling is the measure of the degree of interdepende

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

Define the process of requirements gathering tools, Define the process of R...

Define the process of Requirements Gathering Tools Requirements gathering is an art. Person who gathers requirements must have knowledge of what and when to gather information

What is e-commerce, Question 1 What do you mean by system's state of equil...

Question 1 What do you mean by system's state of equilibrium? Also illustrate the process of stabilising system Question 2 Explain the concept of Planning and Design in syste

explain equivalence partitioning, Describe Equivalence Partitioning An...

Describe Equivalence Partitioning Ans) Input data of a program is separated into different categories so that test cases can be developed for every category of input data. The g

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