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 acceptance testing, Testing conducted to verify whether or not a sy...

Testing conducted to verify whether or not a system satisfies its acceptance criteria and to enable the customer to verify whether or not to accept the system. Contrast with testin

Mca, encoded micro instruction vs unecoded micro instruction

encoded micro instruction vs unecoded micro instruction

Explain re-engineering, RE-ENGINEERING:- It is re-organizing and changing ...

RE-ENGINEERING:- It is re-organizing and changing existing system to make them more maintainable. It includes:-  Source code translation. Program structure development

Draw dfd for the given requirement, A store is in the business of selling p...

A store is in the business of selling paints as well as hardware items. A numeral of reputed companies supplies items to the store. New suppliers are able to also register with the

What is process and procedures, Processes and procedures make sure the corr...

Processes and procedures make sure the correct steps are being implemented to facilitate a successful finished off a task. They also make sure a process is repeatable.

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

Concepts of the object-oriented paradigm, To develop software of lasting qu...

To develop software of lasting quality you have to lay down a solid architectural foundation that is resilient to change. Modelling is at the heart of the development of good quali

What is detailed COCOMO model, Q. What is Detailed COCOMO model ? The d...

Q. What is Detailed COCOMO model ? The detailed COCOMO model is able to estimate the staffing cost and duration of each of the subsystem, development phases and modules. It per

Differentiate between smoke testing and sanity testing, Differentiate betwe...

Differentiate between smoke testing and sanity testing. -Smoke testing verifies all areas of application; sanity testing recognizes one or few areas only. -Smoke testing is

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