Professional Documents
Culture Documents
Causes
Effects
C1 : Salary < = 70,000 C2 : Salary > 60,000 and Salary < = 2 lacks C3 : Salary > 2 lacks C4 : Expenses < = 30,000 C5 : Expenses < = 40,000 C6 : Expenses > 40,000
1
E1: 10% tax is charged. E2: 20% tax is charged. E3: (20% tax) + (5% surcharge) is charged. E4: (20% tax) + (9% surcharge) is charged.
C 1
AND E 1
C 2 AND C 3 E 2
C 4
AND E 3
C 5 AND C 6 E 4
DECISION TABLE:
C1 T F F F T T F
C2 F T F F T F T
C3 F F T T F F F
C4 T F F F F T T
C5 F T T F F T F
C6 F F F T F F F
E1 T F F F T T F
E2 F T F F F F T
E3 F F T F F F F
E4 F F F T F F F
TEST CASES:
TEST CASES 1
INPUTS (CAUSES) Salary Salary < = 70,000 Salary > 60,000 and Salary < = 2 lacks Salary > 2 lacks Expense Expenses < = 30,000 Expenses < = 40,000 Expenses < = 40,000 Expenses > 40,000
(20% tax) + (5% surcharge) is charged (20% tax) + (9% surcharge) is charged.
2. EQUIVALENCE PARTITIONING:
Lets we have to test a five digit number. Partitions for inputs : Let the inputs is denoted by p.
p< 10000 p is in between 10000 99999 > 99999 P is alphabet P is floating point number P is null
Partitions for outputs: Is five digit number Is not five digit number Error message
Test Cases
5
P Expected output
1 public static double ReturnAverage(int value[], int AS, int MIN, int MAX){ 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti < AS && value[i] != -999) { ti++; if (value[i] >= MIN && value[i] <= MAX) { tv++; sum = sum + value[i]; } i++; } if (tv > 0) av = (double)sum/tv; else av = (double) -999; return (av); }
definitions 1 1 1 1 4 4 4 4 14,16
P-use 5,7 5 7 7
C-use 9
11 5 13 6 8 9,14 17
Du Pairs:
9
10
TEST CASE # 1
VARIABLE S
DUPAIR S 1,5
SUBPATHS
INPUT
Value[]
1,2,3,4,5
Any value not equal to -999 Value greater than MIN and less than MAX Value greater than ti Integer value Integer value Value less than AS Greater than 0
Value[]
1,7
1,2,3,4,5,6,7
3 4 5 6 7
AS MAX MIN Ti tv
Value accepted
11
TEST CASE#
VARIABLES
DUPAIRS
SUBPATH S
INPUT
OUTPUTS (PUSHOUTPUT S)
Value
1,9
1-9
Values at value[i]
Takes the values at ith position of array Increments i Increments tv Adds to the sum Adds to the sum Returns the value Returns the value
2 3 4 5 6
i Tv Sum Sum Av
Integer value Integer value Integer value Integer value Takes the Computed the value Takes the Computed the value
av
16,17
12