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

Which type of software must not be automated, Which type of software must n...

Which type of software must not be automated? Following types of software must not be automated: - Incomplete/Unstable software since they are still undergoing changes -

Difference between restructuring and forward engineering, Problem 1. Ex...

Problem 1. Explain why the use of a standard high-level language does not guarantee that software will be portable across a range of machines 2. Draw possible data flow diag

What is grey box testing, Grey box testing is a software testing method tha...

Grey box testing is a software testing method that uses a combination of black box testing and white box testing. Gray box testing is not the black box testing, because the tester

How print statements used in software testing, Q. How Print statements used...

Q. How Print statements used in Software testing? Print statements:-The standard print statement in the language being utilized is sprinkled throughout the program to output va

What are the aims of testing, What are the aims of testing? i. T...

What are the aims of testing? i. Testing is a process of executing a program with the target of finding an error. ii. A good test case is one that has high possibilit

Define the process of software development, Define the process of Software ...

Define the process of Software development Software development underwent revolutionary changes. Rather than a programming teamin an organisation, full-fledged software compan

Jenny Smith, RE : Website Google Ranking Hi, We can fairly quickly promot...

RE : Website Google Ranking Hi, We can fairly quickly promote your website to the top of the search rankings with no long term contracts! We can place your website on top of the

What are business process engineering tools, What are business process engi...

What are business process engineering tools? By modeling the strategic information needs of an organization, business process engineering tools give a "meta-model" from which e

Functional requirement for an library management system, Write down the fun...

Write down the functional requirement for an Library management system. The user should able to search either all of the initial set of databases or select a subset of datab

What are the main objectives of reverse engineering, What are the main obje...

What are the main objectives of reverse engineering? The main objectives of the reverse Engineering process are: (i) It helps the companies to understand the difficulties

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