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 verification represent, What is Verification represent? Verific...

What is Verification represent? Verification represents the set of actions that are performed to confirm that the software correctly implements the particular functionality.

What is affinity diagram, A group process that takes large quantity of lang...

A group process that takes large quantity of language data, like as a list developed by brainstorming, and separates it into categories.

Srs, Why is SRS document known as black box specification of a system

Why is SRS document known as black box specification of a system

Show the advantages of incremental model, Q. Show the Advantages of increme...

Q. Show the Advantages of incremental Model? As product is to be conveying in parts total cost of the project is distributed. Limited number of persons is able to be pu

Calculate the development time, Q. Assuming the Putnam model and given S = ...

Q. Assuming the Putnam model and given S = 100,000 C = 5000 and D 0 = 15 calculate the development time t d.  Ans: In Putnam model (S/C ) 3 = D 0 t d 7 lhs = 20

What is requirement traceability matrix, Requirement traceability matrix ...

Requirement traceability matrix RTM is a matrix tying up needs with the testcases. It is a way of making sure that each requirement has a corresponding testcase which will be t

Define the procedural abstraction, State Procedural abstraction. A Pro...

State Procedural abstraction. A Procedural abstraction is a named series of commands that has a specific and limited function. Eg: Open Walk to the door, reach out & grasp

Explain the process of software change, What is meant by software change? ...

What is meant by software change? Software change is termed as the change in nature of software as the requirements of software changes.

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