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

Determine the principle stages of vord method, What are the principle stage...

What are the principle stages of VORD method? Viewpoint identification: Identify the services provided to each point of view Viewpoint structuring: Sorting related viewpoint

What is a test build manager, Test Build Managers deliver present software ...

Test Build Managers deliver present software versions to the test environment, install the application's software and relate software patches, to both the application and the opera

State the both cardinality and modality, Define Cardinality & Modality. ...

Define Cardinality & Modality. Cardinality: Specification of the number of occurrences of one that can be correlated to number of occurrences of another. Modality: The Moda

Define the equivalence class, Q. Define the Equivalence class? Equivale...

Q. Define the Equivalence class? Equivalence class:-It represents a set of valid or else invalid states for input conditions. An input condition is a specific numeric a set of

User interface design, Develop a detailed design to support the use case sp...

Develop a detailed design to support the use case specified in the accompanying document: ‘ Asg2 . (Hint: Follow the process for use case realization and develop analysis clas

What is dma data transfer, DMA data transfer The position of the DMA co...

DMA data transfer The position of the DMA controller between the other components in a computer system. The CPU communicates with the DMA by the  address and data buses as with

Explain the process of software testing, Explain the process of Software Te...

Explain the process of Software Testing Testing is the process of running the software on manually created inputs with intention to find errors. In process of testing, an atte

Advantages of using mobile agents, Question: (a) Give three advantages...

Question: (a) Give three advantages of using mobile agents. (b) Distinguish between Static Itinerary Static Order (SISO) and Static Itinerary Dynamic Order (SIDO) mobility

Explain cause effect graphing, Q. Explain cause effect graphing? Cause...

Q. Explain cause effect graphing? Cause-effect graphing is the test case design technique that offers a concise representation of logical conditions and corresponding actions

Systems Design Lifecycle, What is the development lifecycle? Why is it usef...

What is the development lifecycle? Why is it useful? Describe the activities carried out at each stage Determination of scope Requirements specification Design Coding Testing Maint

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