0% found this document useful (0 votes)
13 views

Exercise Lab9 WhiteBoxTesting Practice

Uploaded by

Nguyên Trần
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Exercise Lab9 WhiteBoxTesting Practice

Uploaded by

Nguyên Trần
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PRIVATE EXERCISE 9

Subject: Software Testing

Time: 180 minutes

Student’ Name: …………………………………………………………………….

Class:

Let’s consider the Bubble Sort algorithm as follows:

Suppose A is an array of N values. We want to sort A in ascending order.

Bubble Sort is a simple-minded algorithm based on the idea that we look at the list, and
wherever we find two consecutive elements out of order, we swap them. We do this as
follows: We repeatedly traverse the unsorted part of the array, comparing consecutive
elements, and we interchange them when they are out of order. The name of the
algorithm refers to the fact that the largest element "sinks" to the bottom and the smaller
elements "float" to the top.

For I = 0 to N - 2
For J = 0 to N - 2
If (A(J) > A(J + 1)
Temp = A(J)
A(J) = A(J + 1)
A(J + 1) = Temp
End-If
End-For
End-For

You are required to do the requirements:

1. Requirement 1: Write a program using this algorithm to sort an Array that is


input from keyboard in ascending order.
2. Build the set of test cases for the algorithm by using Basic-Path Testing: Draw
CFG - Calculate Cyclomatic complexity and define basic path for CFG - Create
the test scenario that cover all the basic path – Create the specific set of test cases.

YOUR SOLUTION:

1. Requirement 1:
2. Requirement 2:

You might also like