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

Explain the quality assurance manager and project manager, How do you diffe...

How do you differentiate the roles of Quality Assurance Manager and Project Manager? Quality Assurance Manager (QA Manager) produces the process to be followed at every phase

Advantage of microcomputer software packages, Advantage of microcomputer so...

Advantage of microcomputer software packages: i)  compilation and maintenance of reference and fact files;  ii)  compilation of current and retrospective bibliographies

Determine the technique - parallel, Determine the technique - Parallel ...

Determine the technique - Parallel With this approach, old and new systems are run together for a time  -  If new system goes down for any reason, you still have old system

What is execution, What is Execution Ans) The process of a computer gett...

What is Execution Ans) The process of a computer getting out an instruction or instructions of a computer. Exhaustive Testing: Implementing the program with all possible combina

Srs, ? A store is in the business of selling paints and hardware items. A n...

? A store is in the business of selling paints and hardware items. A number of reputed companies supply items to the store. New suppliers can also register with the store after pro

Program to simulate protein synthesis from dna, Overview In this assig...

Overview In this assignment, your program will simulate protein synthesis from DNA. Speci_cally, it reads a DNA string from a file specified on the command line, synthesizes th

What are the benefits of prototyping, What are the benefits of prototyping?...

What are the benefits of prototyping? i. Prototype uses as a basis for deriving system specification. ii. Design quality can be better. iii. System can be handled efficie

Illustrate the relationship between time and cost, Q. Illustrate the relati...

Q. Illustrate the relationship between Time and cost? In software projects, time cannot be freely exchanged against cost. Such a trade off is limited by the nature of the softw

Differentiate between circuit switching and packet switching, Question: ...

Question: (a) Differentiate between circuit switching and packet switching. (b) Using an example, explain the main parts that form a URL (Uniform Resource Locator). (c)

Determine the cyclomatic compexity, consider the following flow chart, a. D...

consider the following flow chart, a. Draw the flow graph and show the edges, regions and nods clearly b. show the independent paths c. calculate the cyclomatic complexity in three

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