Task 3: Develop Black Box Testing Test - ECP, BVA and Decision Table

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

1. A company has 10 salespeople who are paid on a commission basis.

The salespeople
receive $200 per week plus 9% of their gross sales for that week. For example, a
salesperson who grosses $5000 in sales in a week receives: $200 + 0.9 x $5000 =
$650. The program shall determine how many of the salespeople earned salaries in
each of the following ranges (assume that each salesperson’s salary is truncated to an
integer amount): $200 - $299, $300 - $399, $400 - $499, $500 - $599, $600 - $699,
$700 - $799, $800 - $899, $900 - $999, $1000 and over. Write program that uses
array(s) to solve the aforesaid problem

Task 3: Develop black box testing test – ECP, BVA and Decision Table

Below 200, special letters and alphabets will be considered invalid in this case. From 200
to more than 1000 will be consider valid.

BVA
Test Scenarios Results
Boundary value = 199 Invalid
Boundary value = 200 Valid
Boundary value = 345 Valid
Boundary value = 478 Valid
Boundary value = 546 Valid
Boundary value = 668 Valid
Boundary value = 767 Valid
Boundary value = 848 Valid
Boundary value = 950 Valid
Boundary value = 1500 Valid
Decision Table
Cond. Case Case 2 Case 3 Case 4 Case 5 Case 6 Case 7 Case 8 Case 9 Case
1 10
Salary Belo Betwee Betwee Between Betwee Betwee Between Betwee Between Above
n 300- 400-499 n 500- n 600- 700-799 n 800- 900-999 1000
w n 200-
399 599 699 899
200 299
Outcom Error Group 1 Group 2 Group 3 Group 4 Group 5 Group 6 Group 7 Group 8 Group
e 9

Task 4: Test Case

Test Case Test Case Description Pre- Execution Expected Actual Status
ID Name Condition Step Result Result
TC 001 Pay Input System Entered Return Expecte Passed
Category below 200 need to input 0 d
Less than be below
$200 running 200

Input <200
TC 002 Pay Input System Entered Return Expected Passed
category between need to input as Case
$200 - $200 - be between 1
$299 $299 running 200-299

(pay>=20
0 &&
pay<300)
TC 003 Pay Input System Entered Return Expected Passed
category between need to input as Case
$300- $399 $300- be between 2
$399 running 300-399

(pay>=30
0 &&
pay<400)
TC 004 Pay Input System Entered Return Expected Passed
category between need to input as Case
$400 - $400- be between 3
$499 $499 running 400-499

(pay>=40
0 &&
pay<500)
TC 005 Pay Input System Entered Return Expected Passed
category between need to input as Case
$500 - $500- be between 4
$599 $599 running 500-599

(pay>=50
0 &&
pay<600)
TC 006 Pay Input System Entered Return Expected Passed
category between need to input as Case
$600 - $600- be between 5
$699 $699 running 600-699

(pay>=60
0 &&
pay<700)
TC 007 Pay Input System Entered Return Expected Passed
category between need to input as Case
$700 - $700- be between 6
$799 $799 running 700-799

(pay>=70
0 &&
pay<800)
TC 008 Pay Input System Entered Return Expected Passed
category between need to input as Case
$800 - $800- be between 7
$899 $899 running 800-899

(pay>=80
0 &&
pay<900)
TC 009 Pay Input System Entered Return Expected Passed
category between need to input as Case
$900 - $900- be between 8
$999 $999 running 900-999

(pay>=90
0 &&
pay<1000)
TC 010 Pay Input 1000 System Entered Return Expecte Passed
category and over need to input as Case d
1000 over be 1000 and 9
running above
2. Write program that reads in ten numbers and displays distinct numbers (i.e., if a number

appears multiple times, it is displayed only once). (Hint: Read a number and store it in an

array if it is new. If the number is already in the array, discard it. After the input, the array

contains the distinct numbers).

import java.util.Scanner;

public class TestingAssignment {

public static void main(String[] args) {


Scanner input = new Scanner(System.in);
int[] numbers = new int[10];
int number, i = 0, j, k = 0;
System.out.print("Enter ten numbers:");

while (k < 10) {


number = input.nextInt();
k++;

for (j = 0; j <= i; j++) {


if (number == numbers[j]) {
break;
}
}

if (j - i == 1) {
numbers[i] = number;
i++;
}

System.out.println("The number of distinct number is " + i);


System.out.print("The distinct numbers are:");

for (int j2 = 0; j2 < i; j2++) {


System.out.print(numbers[j2] + " ");
}

}
}
Task 3 : Develop black box testing test – ECP, BVA and Decision Table
ECP

Invalid Valid Valid Valid Valid Valid Valid Valid Valid Valid Valid
Below 1 2 3 4 5 6 7 8 9 Until
10 10
digits

BVA

Test Scenarios Results


Boundary value = Less than 10 digits Invalid
Boundary value = 1 Valid
Boundary value = 2 Valid
Boundary value = 3 Valid
Boundary value = 4 Valid
Boundary value = 5 Valid
Boundary value = 6 Valid
Boundary value = 7 Valid
Boundary value = 8 Valid
Boundary value = 9 Valid
Boundary value = Until 10 digits Valid

Decision Table

Rule 1 Rule 2
Digit True False
Results True False

When the entered digit is true, in turn means the digit entered is equal to 10 digits and the
program will show results, else rule 2 is false will be applied where the program will not
show the results.

Task 4: Test Case

Test Test Case Description Pre- Execution Expected Actual Status


Case ID Name Condition Step Result Result
TC Digit Entered System 1.Entere There are Expected Passed
001 entered = total of 10 running d any 5 distinct
10 digits random number
10 digits and
(5 2 3 2 5 separate
6 4 4 5 2) d by one
space

2.The
system
will check
whether
user
entered
less or
more
than 10
digits
.Since
the digit
entered
is 10 so
the
system
will
execute
TC Digit Entered System 1.Entere Return 0 Expected Passed
002 entered = total of 6 running d any
6 digits random 6
digits
(1 2 2 3 3
4)

2.The
system
will check
whether
user
entered
less than
10 digits.
Since the
number
entered
is less or
more
than 10
digits,
there will
be no
execution
from the
system
TC Digit Entered System 1.Entere There are Expected Passed
003 entered total of 10 running d any 6 distinct
10 include digits random number
with a 10 digits and
negative (-5 2 3 2 5 separate
number 6 4 4 5 2) d by one
space
2.The
system
will check
whether
user
entered
less or
more
than 10
digits.
Since the
digit
entered
is 10 so
the
system
will
execute.
TC Digit Entered System 1.Entere Return 0 Expected Passed
004 entered digit more running d any
more than than 10 random
10 12 digits
(-5 2 3 2 5
644523
6)

2.The
system
will check
whether
user
entered
less or
more
than 10
digits.
Since the
digit
entered
is 12 so
the
system
will not
execute.

3. Indah Water Inc. wishes to compute the water bill for its clients. It levies 5 cents
per unit for the first 1000 units of water consumed, 7 cents per unit for the next
1000 units and 10 cents per unit if the number of units consumed exceeds 2000.
Given the names, addresses, old, and new meter readings, write a complete
program to compute and print the amount each customer owes to Indah Water Inc.

Task 3: Develop black box testing test- ECP, BVA and Decision Table

0 and any number below 0 consider as invalid. In the testing condition, -10 will be consider
invalid as such 0 also but anything above such as 1,10,100,2000,30000 will be consider valid.

BVC

Test Scenario Expected Outcome


Boundary value = 0 Invalid

Boundary value = 1 Valid

Boundary value = 999 Valid

Boundary value = 1001 Valid

Boundary value = 1999 Valid

Boundary value = 2001 Valid

Decision Table
Rule 1 Rule 2
Unit True False
Result True False

When the unit is true in turn means that unit is entered in the program, the program will run
where else rule 2 is false and the program will not start the calculation

Task 4: Test Case


Test Case Test Case Description Pre- Execution Expected Actual Status
ID Name Condition Step Result Result
TC 001 Unit = -1 Negative System Step 1: Return Expecte Passed
number running entered 0 d
entered -1 and
into system
system will
return 0
TC 002 Unit = 100 Unit 100 System Step 1: Return Expected Passed
entered running Entered water
into 100 unit bill as 5
system
Step 2:
System
check
whether
the unit
is bigger
than
1000 or
not.

Step 3:
System
calculate
the unit
with
variable
I and
display
the
result of
water bill
TC 003 Unit = Unit 1500 System Step 1: Return Expected Passed
1500 entered running Entered water
into 1500 bill as
system unit 105

Step 2:
System
checked
whether
the unit
bigger
than
1000 or
not.

Step 3:
System
checked
whether
the unit
is
between
1000-
2000

Step 4:
System
calculate
water bill

Step 5:
Display
result of
water bill

TC 004 Unit = Unit 2100 System Step 1: Return Expected Passed


2100 entered running Entered water bill
into 2100 as 210
system unit

Step 2:
System
checked
whether
the unit
bigger
than
1000 or
not.
Step 3:
System
checked
whether
the unit
is
between
1000-
2000

Step 4:
System
calculate
water bill

Step 5:
Display
result of
water bill

You might also like