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 process involved in maturity levels in seis cmm, What is process in...

What is process involved in maturity levels in SEIs CMM. Level 1: Initial - a small number of processes are defined and individual efforts are taken. Level 2: Repeatable - T

Explain product metrics, What is Product metrics? A quality metric shou...

What is Product metrics? A quality metric should be a predictor of product quality. Classes of product metric Dynamic metrics which are collected by measurements made

Describe structure-based testing techniques, Describe Structure-based testi...

Describe Structure-based testing techniques - Structure-based testing techniques are also known as white-box testing techniques. - They use internal structure of the softwar

What is the full form of eva, What is EVA? Earned Value Analysis is a ...

What is EVA? Earned Value Analysis is a technique of performing quantitative analysis of the software project. It gives a common value scale for each task of software projec

Explain productivity, Productivity Productivity refers to metrics and c...

Productivity Productivity refers to metrics and calculates of output from production processes, per unit of input. Productivity P may be conceived of as a metrics of the techni

What is 4test, What is 4Test? 4Test is a test scripting language which ...

What is 4Test? 4Test is a test scripting language which is used by SilkTest to compose test scripts to perform automated tests. It's an object-oriented fourth-generation langua

#title; fundamentals of tech, true/false small errors in syntax or spelling...

true/false small errors in syntax or spelling of a line of code will not affect the results

List the process maturity levels in seis cmm, List the process maturity lev...

List the process maturity levels in SEIs CMM. Level 1: Initial - Few processes are explained and individual efforts are taken. Level 2:Repeatable - To track cost schedule an

What is recovery testing, What is recovery testing? Recovery testing is...

What is recovery testing? Recovery testing is a system test that forces the software to fail in a various of ways and verifies that recovery is properly done.

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