testing techniques, example [email protected] 14.4.2004

12
Testing techniques, example [email protected] 14.4.2004

Upload: laurence-green

Post on 24-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Testing techniques, example

[email protected]

14.4.2004

Page 2: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Equivalence Partitioning (EP)

• Partition (divide) the inputs, outputs, etc. into areas which are same (equivalent)• assumption: if one value works, all will work• one from each partition better than all from one

0 1 100 101

invalid valid invalid

Page 3: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Boundary Value Analysis (BVA)

• Fault tend to lurk near boundaries, godd place to look for faults

• test values both sides of boundaries

0 1 100 101

invalid valid invalid

Page 4: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Example: Loan application

• Input:– Customer name; 2-64 characters

– Account number; 6 digits, 1st non-zero

– Loan amount requested; 500-9000 €

– term of loan; 1 to 10 years

– monthly repayment; minimum 10 €

• Output:– Term, Repayment, Interest Rate, Total paid back

Page 5: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Example; Customer name

Number of chars: invalid invalidvalid

0 1 2 64 65

Valid characters: A-Z a-z - , space

Condition group

valid partitions invalid partitions

valid boundaries

invalid boundaries

2-64 chars < 2 chars 2 chars 1 charsvalid chars > 64 chars 64 chars 65 chars

invalid chars 0 charscustomer name

Page 6: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Example; Account number

First character: valid: non-zero invalid: zero

Number of digits:0 5 6 7

invalid invalidvalid

Condition group

valid partitions invalid partitions

valid boundaries

invalid boundaries

6 digits < 6 digits 100000 999991st non-zero > 6 digits 999999 100000

1st digit = 0 0 digitsnon-digit

account number

Page 7: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Example; Loan amount

499 500 9000 9001

invalid valid invalid

Condition group

valid partitions invalid partitions

valid boundaries

invalid boundaries

< 500 500 499> 9000 9000 90010non-numericnull

Loan amount

500-9000

Page 8: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Condition templateCondition Valid Tag Invalid Tag Valid Tag Invalid Tag

2-64 chars < 2 chars X1 2 chars VB1 1 chars XB1valid chars > 64 chars X2 64 chars VB2 65 chars XB2

invalid chars X3 0 chars XB36 digits < 6 digits X4 100000 VB3 99999 XB41st non-zero > 6 digits X5 999999 VB4 100000 XB5

1st digit = 0 X6 0 digits XB6non-digit X7< 500 X8 500 VB5 499 XB7> 9000 X9 9000 VB6 9001 XB80 X10 nullnon-numeric X11

< 1 X12 1 VB7 0 XB10> 10 X13 10 VB8 11 XB11non-integer X14

< 10 X15 10 VB9 9.99 XB12> Mmax X16 Mmax VB10 Mmax+0.01 XB13non-numeric X17

customer name

V1

account number

V2

Loan amount

500-9000

V3 XB9

Term in years (input value)

1-10

V5

Monthly repayment (input value)

10 - €Mmax

V6

Page 9: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Test casesTest case conditions covered

customer name: John Smith Term 3 V1, V2, V3, V4Account number: 123456 Repayment 79.86Loan amount 2500 Interest rate 10Term 3 Total repayment 2874.96Repayment <null>customer name: AB Term 1 VB1, VB3, VB5, V5Account number: 100000 Repayment 45Loan amount 500 Interest rate 10Term <null> Total repayment 525Repayment 45customer name: <a long name, 64 chars) Term 10 VB2, VB4, VB6, VB8Account number: 999999 Repayment 112.50Loan amount 9000 Interest rate 10Term 10 Total repayment 13500.00Repayment <null>customer name: Mike X15Account number: 191919Loan amount 501Term <null>Repayment 0.01customer name: Heather Green XB11Account number: 918273Loan amount 8999Term 11Repayment <null>

customer name: 23assdf X9Account number: 100001Loan amount 100001Term 5Repayment <null>

Error message:"Repayment must be €10 or more"

5

Error message:"Term must be from 1 to 10 years inclusive"

6

Error message:"Loan amount must be from €500 to €9000 inclusive"

1

2

3

4

Description expected outcome

Page 10: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Questions and assumptions…

• Input of loan amount is a number of euros, no cents

• First 3 fields are mandatory; Term OR Repayment is mandatory (not both)

• Term of loan is in whole years• Monthly payment is in euros and cents• What is the maximum monthly repayment

(Mmax)? Is it the amount of loan ?

Page 11: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Coverage of test case tableCondition group

Valid partitions

Tag Invalid partitions

Tag Valid boundaries

Tag Invalid boundaries

Tag

2-64 chars < 2 chars X1 2 chars VB1 1 chars XB1valid chars > 64 chars X2 64 chars VB2 65 chars XB2

invalid chars X3 0 chars XB36 digits < 6 digits X4 100000 VB3 99999 XB41st non-zero > 6 digits X5 999999 VB4 100000 XB5

1st digit = 0 X6 0 digits XB6non-digit X7< 500 X8 500 VB5 499 XB7> 9000 X9 9000 VB6 9001 XB80 X10 nullnon-numeric X11

< 1 X12 1 VB7 0 XB10> 10 X13 10 VB8 11 XB11non-integer X14

< 10 X15 10 VB9 9.99 XB12> Mmax X16 Mmax VB10 Mmax+0.01 XB13non-numeric X17

customer name

V1

account number

V2

Loan amount

500-9000

V3 XB9

Term in years (input value)

1-10

V4

Monthly repayment (input value)

10 - €Mmax

V5

Page 12: Testing techniques, example Riitta.Viitamaki@iki.fi 14.4.2004

Coverage summary

We can see from the coverage table how thoroughly we have tested the EP and BVA conditions that we have identified.

valid partitions

invalid partitions

valid boundaries

invalid boundaries

input conditions

100%

(5/5)

12%

(2/17)

70%

(7/10)

7%

(1/13)