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

Write down any four application of a stack, Write down any four application...

Write down any four application of a stack. (i)  Conversion of infix to postfix form (ii)  Reversing of a line. (iii) Removal of recursion (iv) Evaluating post fix expression

Describe any 4 characteristics of distributed systems, QUESTION - Character...

QUESTION - Characteristics of DSs (a) List and describe any 4 characteristics of distributed systems. (b) State the criterion for a system to be considered as not a distrib

What is product metrics, Product metrics: explain the characteristics of t...

Product metrics: explain the characteristics of the product such as size, complexity, design features, performance, efficiency, reliability, portability, etc.

SYSTEM ANALYSIS AND DESIGN, A program is to be developed to simulate the op...

A program is to be developed to simulate the operations of a scientific calculator. List the facilities to be provided by this calculator. Analyze this using a DFD 0 - level and 1

Explain the modularity concept mean, What does Modularity concept mean? ...

What does Modularity concept mean? Software architecture embodies modularity; i.e. Software is named in to addressable components called modules, which are integrated finally.

Explain productivity and difficulty, Productivity and difficulty Produ...

Productivity and difficulty Productivity refers to metrics and measures of output from production processes, per unit of input. Productivity P may be conceived of as a metric

Describe the formal software process model, Question 1: (a) Describe t...

Question 1: (a) Describe the Formal Software Process Model. (b) What are the main strengths of the Formal Software Process Model ? (c) Why is the Software Process Mode

Determine the primary activities of spiral model, Determine the primary act...

Determine the primary activities of spiral model Below are the primary activities in this model: • Finalising Objective: Objectives are set for the particular phase of the

State the cocomo model, What is COCOMO model? COCOMO stands for COnstru...

What is COCOMO model? COCOMO stands for COnstructive COst MOdel. It is used for cost Effort=a * KDLOCb Where a and b are two parameters of the model whose specific values

What is fan-in and fan-out, Define Fan-in and Fan-out Fan-out: A measu...

Define Fan-in and Fan-out Fan-out: A measure of the number of modules which are directly maintained by another module. Fan-in: Indicates that how many modules directly main

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