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

Define the stress testing, Define the Stress testing: - It checks the r...

Define the Stress testing: - It checks the robustness of application. - It verifies that application consistently gives satisfactory performance under unfavorable and extrem

What is the meaning of requirement engineering, What is the meaning of requ...

What is the meaning of requirement engineering? Requirement engineering defined as the process of setting up the services that the customer requires from the system and the co

Illustrate the introduction to flowcharts, Illustrate the Introduction to F...

Illustrate the Introduction to Flowcharts This mainly covers four areas: 1 Common flow chart symbols 2 Writing flowcharts to solve problems 3 Dry running of flowcharts

Determine the steps of structured requirements definition, Determine the di...

Determine the different steps of Structured Requirements Definition Step 1: Make a user level data flow diagram. This step is meant for gathering requirements with intera

Code restructuring, Ask quewhat is code restructuringstion #Minimum 100 wor...

Ask quewhat is code restructuringstion #Minimum 100 words accepted#

What is a test configuration manager, Test Configuration Managers handles t...

Test Configuration Managers handles test environments, scripts, software and test data. Depending on the project, single person may wear more than single hat. For example, Test Eng

Determine the repeatable level of maturity model, Level 2 (Repeatable) ...

Level 2 (Repeatable) Organisation satisfies all the requirements of level-1. At this stage, basic project management policies and associated procedures are established. Insti

Define black box testing, Define Black box testing Black box testing ...

Define Black box testing Black box testing Black-box test design care for the system as a "black-box", so it doesn't explicitly use knowledge of the internal structure. It ta

Software availability, Software Availability: In the present day conte...

Software Availability: In the present day context, software suppliers have realised the potential demand and also the special requirements of library and information professio

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