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

Important factors related to library storage operation, Important factors r...

Important factors related to library storage operation: It is essential to consider some important factors related to library and information storage and retrieval operations

Explain product and process standards, Product and process standards Pr...

Product and process standards Problems with standards They may not be seen as relevant and up-to-date by software engineers. They often include too much bureaucratic form

What is failure, The inability of a system or system component to perform a...

The inability of a system or system component to perform a needed function within specified limits.

Given titles IOT/ IOE, Dear Sir/ Madam I have an 8 page essay to be written...

Dear Sir/ Madam I have an 8 page essay to be written how much I pay per page? Thanks

What are the fundamental activities of a software process, What are the fun...

What are the fundamental activities of a software process?   Specification  Design and implementation Validation Evolution

Describe the advantages of proper inheritance, Describe the advantages of p...

Describe the advantages of proper inheritance. The biggest advantages of proper inheritance are:  a.) substitutability and b.) extensibility.

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

Explain top down design, Top down design: A top down design approach begin...

Top down design: A top down design approach begins by identifying the main modules of the system, decomposing them into their lower level modules and iterating unless the desired

Explain concept with respect to software development, Question: (a) ...

Question: (a) (i) Using examples from the case study or otherwise, explain the following concepts: • Encapsulation • Specialization • Polymorphism (ii) Discuss the a

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