You are on page 1of 57

-

:

.



:
(review):
(informal review)
(walkthrough)
(technical review)
(inspection)
(static analysis):
[] (data [flow] analysis)
(control flow analysis)
/


:

(IDE)
(W3C HTML/CSS validator,
FindBugs)


:
(structurebased):
(statement coverage)
(decision coverage)
(condition coverage)
(experiencebased):
(ad hoc testing)
(error guessing)

(exploratory testing)
5


:
(specificationbased):
(equivalence partitioning)
(boundary value
analysis)
(decision tables)
(state transition)

(use-case testing)

[]

Use-case

White-box


S Exercised
SC
100%
STotal
Black-box : SC = 60%-70%
SC = 100% - (statement)
-


1:

Read P
Read Q
If P+Q>100 Then
Print P>Q
End If
If P>50 Then
Print P>50
End If

TC1:
P = 60
Q = 60

10


2:
Read X
Read Y
If X=3 Then
Print Message X
If Y=2 then
Print Message Y
Else Print Message Z
End If
Else Print Message Z
End If

TC1:
X=3
Y=2
TC2:
X=3
Y <> 2
TC3:
X <> 3
Y=

11


DExercised
DC
100%
DTotal
Decision statements: IF, Case, Do-While,
Repeat-Until, etc.
Black-box : DC = 40%-60%
DC = 100% -
-
DC = 100% SC = 100%
12


3:

Read P
Read Q
If P+Q>100 Then
Print P+Q>100
End If
If P>50 Then
Print P>50
End If

TC1:
P = 60
Q = 60
TC2:
P = 10
Q = 15

13


4:
Read X
Read Y
If X=3 Then
Print Message X
If Y=2 then
Print Message Y
Else Print Message Z
End If
Else Print Message Z
End If

TC1:
X=3
Y=2
TC2:
X=3
Y <> 2
TC3:
X <> 3
Y=

14


5:
Tea

Tea/
Coffee

Coffee

Prepare
coffee

Prepare tea

Sugar

:
TC1: Tea, Sugar
TC2: Coffee, Milk, Sugar

Add sugar

Milk

Add milk

Sugar

:
TC3: Tea, Sugar
TC4: Coffee, Milk, Sugar

Add sugar

N
Give drink

15


Condition coverage

Condition/decision coverage CC+DC


Modified condition/decision coverage CC+DC +


Multiple condition coverage

16


6:

If A or B Then
Print Message Z
End If

SC: TF
DC: TF, FF
CC: TF, FT (TT,FF)
CDC: TT, FF
Modified CDC: TF, FT, FF
Multiple CC: TT, TF, FT, FF

17


7:

If (A or B) and C Then
Print Message Z
End If

SC: TTT
DC: TTT, TTF
CC: TFT, FTF (TTT, FFF)
CDC: TTT, FFF
Modified CDC:
A: FFT / TFT
B: FFT / FTT
C: TTF / TFT(FTT)
All: FFT, TFT, FTT, TTF
Multiple CC: FFF, FFT, FTF, FTT,
TFF, TFT, TTF, TTT

18

Black-box

19



, .

,
(
[] ,
[] )

20


7:

,
:
100 . : 0%
100 . 1000 . : - 7%
1000 . : - 10%

21


7:


(valid)

(invalid)

1) 1 N < 100
2) 100 N < 999
3) 1000 N

1) N = 0
2) N -1
3) Null
4)
5) 123.4567
6) Max < N

22

/
(-, +, 0, 199999,0.123456)
(symbol, , SML, !@#$%^)
( , , multi-select)
(.bmp, .jpg, .png)
(Null, 200, )
(Null, 4+Gb)
(/ )
(640x480, 1920x1080, 2560x1440)
, (Mac OS/Win/Linux, DX9/10/11)
(Firefox, Safari, Chrome, IE6/7/8, Opera)

23



():

-

24

,

.

25


8:
(brute force)

:
1) Find what (FW)
2) Match whole word (MW)
3) Match case (MC)
4) Direction (D)
:
FW = {lower, UPPER, MiXeD}
MW = {Yes, No}
MC = {Yes, No}
D = {Up, Down}
3x2x2x2 = 24

TC

FW

MW

MC

Up

Up

Up

Up

Up

Up

24

Down


TC

FW

MW

MC

Up

Down

Up
26


8:
(pairwise testing)

:
1) Find what (FW)
2) Match whole word (MW)
3) Match case (MC)
4) Direction (D)
:
FW = {lower, UPPER, MiXeD}
MW = {Yes, No}
MC = {Yes, No}
D = {Up, Down}

TC

FW

MW

MC

Down

Up

Up

Down

Down

Up

3x2x2x2 = 24

27

1.
(B)
(R)
(T)
(L)
2.
B = {IE, FF, Safari, Chrome}
R = {800x600, 1280x1024, 1920x1080}
T = {Theme1, Theme2, Theme3}
L = {EN, RU, UA}
3.
=
=

- =

28

IE

800x600

IE

800x600

Theme1

IE

800x600

Theme1

EN

IE

1280x1024

IE

1280x1024

Theme2

IE

1280x1024

Theme2

RU

IE

1920x1080

IE

1920x1080

Theme3

IE

1920x1080

Theme3

UA

FF

800x600

FF

800x600

Theme2

FF

800x600

Theme2

UA

FF

1280x1024

FF

1280x1024

Theme3

FF

1280x1024

Theme3

EN

FF

1920x1080

FF

1920x1080

Theme1

FF

1920x1080

Theme1

RU

Safari

800x600

Safari

800x600

Theme3

Safari

800x600

Theme3

RU

Safari

1280x1024

Safari

1280x1024

Theme1

Safari

1280x1024

Theme1

UA

Safari

1920x1080

Safari

1920x1080

Theme2

Safari

1920x1080

Theme2

EN

Chrome

800x600

Chrome

800x600

Theme1

Chrome

800x600

Theme1

EN

Chrome

1280x1024

Chrome

1280x1024

Theme2

Chrome

1280x1024

Theme2

RU

Chrome

1920x1080

Chrome

1920x1080

Theme3

Chrome

1920x1080

Theme3

UA

29


:
(100 N < 999)
(1000 N)
:


,


,
,

30


9:


, :
100 $1000 () : +3%
$1000 $10 000 : +5%
$10 000 : +7%

31


10:

0%

100

99.99 100.01

1000

+3%

999.99 1000.01

+5%

10 000

+7%
9 999.99 10 000.01

Max

0%

$99.99, $0

-$0.01

+3% $100.00, $100.01, $999.99, $1000.00

+5% $1000.01, $9 999.99

+7% $10 000, 10 000.01, $Max

$Max + $0.01

32



():

-

-
,

33


(decision tables/
cause-effect tables) :



-

34


:
(rules)

(conditions)

(actions)

X
X

X
X



(expected results)
-

(rules)

T,F

T,F

T,F

3
4

X
X

X
X

35


:
1) /
2)

3)
4)
5)

36


11:

: a,b,c
: (,
,, )
1 ( ):
1: a,b,c ? {Y,N}
2: a=b? {Y,N}
3: a=c? {Y,N}
4: b=c? {Y,N}

37


11:

2 ( ):
({Y,N}):
- = 2-
({A, B, C, D}):
- = VC1* VC2* VC3 * VCn
N = 24 = 16
38


11:

3-4 ( ):
1

10

11

12

13

14

15

16

C1: ?

C2: a=b?

C3: a=c?

C4: b=c?

C1: ?

C2: a=b?

C3: a=c?
C4: b=c?

N
N

Y
Y

N
N

Y
N

N
N

39


11:

5 ( ):
1

C1: ?

C2: a=b?

Y
Y

N
N

Y
N

N
N

A1:
A2:

A3:

A4:
A5:

9
N

C3: a=c?
C4: b=c?

X
X

40


12:

-
.
:
1) A, B
2) C
3) , 5
$500
20%

41


12:

1 2 3 4 5 6 7

A,B,C,D

A A A A B B B B C C C C D D D D

Y,N

Y Y N N Y Y N N Y Y N N Y Y N N

$500 Y,N

Y N Y N Y N Y N Y N Y N Y N Y N

8 9 10 11 12 13 14 15 16

X X X X X X X X

? ? ? ?

X X X X ? ? ? ?
? X X

? X X

? X X

? ? ? ?
? ? ? ?

D ( )
? 5 $500
42


(finite state machine)
,

, .
[IEEE 610]
,
,
.

43


:
(state-transition diagram)
(state-transition table)
:
,
(
)
,
,

44


13:
/
C

[ ]/

45


13:
-

/
C

1
2

[ ]/

46


13:
-
/
C

1
2

[ ]/

47


13:
-
1
2
3
4
5

/
C

[ ]/

48


14:

PIN-

PIN-

1-

PIN-

2-

PIN-

3-

PIN-

PIN-

49


14:

-:

PIN

PIN

S2

S2) 1-

S5

S3

S3) 2-

S5

S4

S4) 3-

S5

S6

S5)

S6)

S1 ( )

S1)

50

Use-case
,

.
(actors) :

51

Use-case
:

,





,
-

52

Use-case

( )

/ / /

/ / ()

1
2

, ,

/ /

53

Use-case

ATM123


:
:

1. ()
2. ()

PIN-

3. PIN ()

4. PIN- ()

2a)

4a) PIN-

, PIN

4b) 3 PIN-

54

Use-case



-

55

Kelly J. Hayhurst - "A Practical Tutorial on Modified Condition/Decision Coverage"


Lee Copeland A Practitioner's Guide to Software Test Design
Dorothy Graham Foundations of software testing
IEEE SWEBOK 2004
IEEE 610
Google
Wikipedia

56

57