Sie sind auf Seite 1von 20

Guideline to make and understand Unit Test Case

1. Overview
- In the template, Unit test cases are based on functions. Each sheet presents test cases for one function.
Note: Should check the formula of "Sub Total" if you add more functions
2. Content in Test function sheet
2.1 Combination of test cases.
- If the number of Unit TC does not meet the requirement, creator should explain the reasons.
- If the number of 'Normal number test cases/!"C' item in #unction!ist sheet is not recorded, the number in '!ac$ of test cases' is not calculated.
2.2 Condition and confirmation of Test cases.
Each test case is the combination of condition and confirmation.
a. Condition:
- Condition is combination of precondition and %alues of inputs.
- &alues of inputs' it includes ( t)pes of %alues' normal, boundar) and abnormal.
. Normal %alues are %alues of inputs used mainl) and usuall) to ensure the function *or$s.
. +oundar) %alues are limit %alues that contain upper and lo*er %alues.
. ,bnormal %alues are non-expected %alues. ,nd normall) it processes exception cases.
- #or examples'
Input %alue belon-s to ./0 input /012.
. 3,4,5,6 are normal %alues.
. ., 12 are boundar) %alues.
. -1, 11,... are abnormal %alues.
b. Confirmation:
- Confirmation can include'
7 "utput result of the function.
7 "utput lo- messa-es in lo- file.
7 "utput screen messa-e...
c. Type of test cases and result:
- T)pe of test case' It includes normal, boundar) and abnormal test cases. User selects the t)pe based on the t)pe of input data.
- Cover' 8eneral information of the pro9ect and Unit Test cases
- unction!ist' The list of Classes and #unctions in the document.
7 To control that the number of Unit TC meets customer's requirement or the norm, user should fill %alue for
'Normal number of Test cases/!"C'.
7 Clic$ on #unction lin$ to open the related Test cases of the function.
Note: :ou should create ne* #unction sheet before cretin- the lin$
- Test "eport' pro%i%e the o%er%ie* results of #unctions Unit test' Test co%era-e, Test successful co%era-e
;<ummar), for normal/abnormal/boundar) cases=
- To %erif) that number of Unit TC meets customer's requirement or not. User has to fill number !"C of tested function and fill %alue of 'Normal number test cases/!"C' item in
#unction!ist sheet, *hich is required b) customer or normal %alue. The number of lac$ed TC is sho*n in '!ac$ of test cases' item.
- >recondition' it is settin- condition that must exist before execution of the test case.
Example' file , is precondition for the test case that needs to access file ,.
- It is combination of expected result to chec$ output of each function.
If the results are the same *ith confirmation, the test case is passed, other case it is failed.
2.#. Other items:
- #unction Code' it is I? of the function and updated automaticall) accordin- to #unction!ist sheet.
- #unction Name' it is name of the function and updated automaticall) accordin- to #unction!ist sheet.
- Created +)' Name of creator.
- Executed +)' Name of person *ho executes the unit test
- !ines of code' Number of Code line of the function.
- Test requirement' +rief description about requirements *hich are tested in this function, it is not mandator).

- Test case result' the actual output results comparin- *ith the Confirmation.
$ for >assed and for #ailed cases.
It can '"' or 'N8' ;it depends on habit of the teams or customers=


2@ae-+A/>A/B?C&/#<"#T %@/2 Internal use 5/20
U%&T T'(T C)('
$ro*ect %ame <Project Name> Creator
$ro*ect Code <Project Code> "eviewer+)pprover
,ocument Code <Project Code>_XXX_!"!
&ssue ,ate
-ersion
"ecord of chan.e
'ffective ,ate -ersion Chan.e &tem /)0,01 Chan.e description
<#ate $hen these chan%es are
effectie>
2@ae-+A/>A/B?C&/#<"#T %@/2 Internal use 6/20
U%&T T'(T C)('
<#ate $hen this test re&ort is created>
"eference
<'ist of documents $hich are refered in this ersion">
Internal use 4/@2
U%&T T'(T C)(' !&(T
$ro*ect %ame <Project Name>
$ro*ect Code <Project Code>
%ormal number of Test cases+2!OC ())
Test 'nvironment (etup ,escription
%o Class %ame unction %ame unction Code3Optional4 (heet %ame ,escription
1 Class1 #unction , #unction1
@ Class@ #unction + #unction@
( Class( #unction C #unction(
<'ist eniroment re*uires in this system
(" Serer
+" #atabase
," -eb .ro$ser
"""
>
"e5uirement
%ame
#unction1
#unction@
#unction(
Internal use 5/@2
<Project Name>
<Project Code>
$re6Condition
Internal use 6/@2
U%&T T'(T "'$O"T
$ro*ect %ame <Project Name> Creator
$ro*ect Code <Project Code> "eviewer+)pprover
,ocument Code <Project Code>_Test /e&ort_!"! &ssue ,ate
<#ate $hen this test re&ort is created>
%otes <'ist modules included in this release> e!: /elease ( includes + modules: 0odule( and 0odule+
%o unction code $assed ailed Untested % ) 7
1 1@ @ 1 1@ @ 1
@ 1@ @ 1 1@ @ 1
( 1@ @ 1 1@ @ 1
(ub total (3 3 ( (3 3 (
Test covera.e 8#.## C
Test successful covera.e 9:.:: C
%ormal case 9:.:: C
)bnormal case 1#.## C
7oundary case ;.;< C
#unction1
#unction@
#unction(
N
80%
A
13%
B
7%
Test Type
N
A
B
Passed
80%
Failed
13%
Untested
7%
Passed Percent
Passed
Failed
Untested
Internal use 12/@2
N
80%
A
13%
B
7%
Test Type
N
A
B
Passed
80%
Failed
13%
Untested
7%
Passed Percent
Passed
Failed
Untested
Internal use 11/@2
U%&T T'(T "'$O"T
<#ate $hen this test re&ort is created>
<'ist modules included in this release> e!: /elease ( includes + modules: 0odule( and 0odule+
Total Test Cases
1.
1.
1.
D.
N
80%
A
13%
B
7%
Test Type
N
A
B
Internal use 1@/@2
N
80%
A
13%
B
7%
Test Type
N
A
B
Internal use 1(/@2
unction Code 1unction( unction %ame #unction ,
Created 7y <#eelo&er Name> '=ecuted 7y
!ines of code ()) !ack of test cases -.
Test re5uirement <.rief descri&tion about re*uirements $hich are tested in this function>
$assed ailed Untested %+)+7 Total Test Cases
1@ @ 1 1@ @ 1 1.
U
T
C
&
,
:
1
U
T
C
&
,
:
2
U
T
C
&
,
:
#
U
T
C
&
,
:
>
U
T
C
&
,
:
?
U
T
C
&
,
:
;
U
T
C
&
,
:
<
U
T
C
&
,
:
9
U
T
C
&
,
:
8
U
T
C
&
,
1
:
U
T
C
&
,
1
1
U
T
C
&
,
1
2
U
T
C
&
,
1
#
U
T
C
&
,
1
>
U
T
C
&
,
1
?
Condition
$recondition
Can connect *ith ser%er
&nput1
E1E
EE
null
&nput2
F0. G /0 12
.
12
Confirm "eturn
1
Internal use 1D/@2
Confirm
@
'=ception
!o. messa.e
EsuccessE
Einput1 is nullE
"esult
T)pe;N ' Normal, , ' ,bnormal, + ' +oundar)= N N N N N + , N N N N N , N N
>assed/#ailed > > > > > # # > > > > > > >
Executed ?ate
?efect I?
2
@
/
@
3
2
@
/
@
3
2
@
/
@
4
2
@
/
@
5
2
(
/
2
1
2
(
/
2
@
2
(
/
2
(
2
(
/
2
D
2
(
/
2
.
2
(
/
2
3
2
(
/
2
4
2
(
/
2
5
2
(
/
2
6
2
(
/
1
2
2
(
/
1
1
?
#
I
?
2
2
@
?
#
I
?
2
2
D
?
#
I
?
2
2
.
?
#
I
?
2
2
3
?
#
I
?
2
2
4
?
#
I
?
2
2
5
?
#
I
?
2
2
6
?
#
I
?
2
1
2
?
#
I
?
2
1
1
?
#
I
?
2
1
@
Internal use 1./@2
unction Code 1unction+ unction %ame 1unction .
Created 7y <#eelo&er Name> '=ecuted 7y
!ines of code ,)) !ack of test cases 1.
Test re5uirement <.rief descri&tion about re*uirements $hich are tested in this function>
$assed ailed Untested %+)+7 Total Test Cases
1@ @ 1 1@ @ 1 1.
U
T
C
&
,
:
1
U
T
C
&
,
:
2
U
T
C
&
,
:
#
U
T
C
&
,
:
>
U
T
C
&
,
:
?
U
T
C
&
,
:
;
U
T
C
&
,
:
<
U
T
C
&
,
:
9
U
T
C
&
,
:
8
U
T
C
&
,
1
:
U
T
C
&
,
1
1
U
T
C
&
,
1
2
U
T
C
&
,
1
#
U
T
C
&
,
1
>
U
T
C
&
,
1
?
Condition
$recondition
Can connect *ith ser%er
&nput1
E1E
EE
null
&nput2
F0. G /0 12
.
12
Confirm "eturn
Internal use 13/@2
Confirm
1
@
'=ception
!o. messa.e
EsuccessE
Einput1 is nullE
"esult
T)pe;N ' Normal, , ' ,bnormal, + ' +oundar)= N N N N N B A N N N N N A N N
>assed/#ailed P P P P P F F P P P P P P P
Executed ?ate
?efect I?
2
@
/
@
3
2
@
/
@
3
2
@
/
@
4
2
@
/
@
5
2
(
/
2
1
2
(
/
2
@
2
(
/
2
(
2
(
/
2
D
2
(
/
2
.
2
(
/
2
3
2
(
/
2
4
2
(
/
2
5
2
(
/
2
6
2
(
/
1
2
2
(
/
1
1
?
#
I
?
2
2
@
?
#
I
?
2
2
D
?
#
I
?
2
2
.
?
#
I
?
2
2
3
?
#
I
?
2
2
4
?
#
I
?
2
2
5
?
#
I
?
2
2
6
?
#
I
?
2
1
2
?
#
I
?
2
1
1
?
#
I
?
2
1
@
Internal use 14/@2
unction Code 1unction, unction %ame 1unction C
Created 7y <#eelo&er Name> '=ecuted 7y
!ines of code ,)) !ack of test cases 1.
Test re5uirement <.rief descri&tion about re*uirements $hich are tested in this function>
$assed ailed Untested %+)+7 Total Test Cases
1@ @ 1 1@ @ 1 1.
U
T
C
&
,
:
1
U
T
C
&
,
:
2
U
T
C
&
,
:
#
U
T
C
&
,
:
>
U
T
C
&
,
:
?
U
T
C
&
,
:
;
U
T
C
&
,
:
<
U
T
C
&
,
:
9
U
T
C
&
,
:
8
U
T
C
&
,
1
:
U
T
C
&
,
1
1
U
T
C
&
,
1
2
U
T
C
&
,
1
#
U
T
C
&
,
1
>
U
T
C
&
,
1
?
Condition
$recondition
Can connect *ith ser%er
&nput1
E1E
EE
null
&nput2
F0. G /0 12
.
12
Confirm "eturn
1
Internal use 15/@2
Confirm
@
'=ception
!o. messa.e
EsuccessE
Einput1 is nullE
"esult
T)pe;N ' Normal, , ' ,bnormal, + ' +oundar)= N N N N N B A N N N N N A N N
>assed/#ailed P P P P P F F P P P P P P P
Executed ?ate
?efect I?
2
@
/
@
3
2
@
/
@
3
2
@
/
@
4
2
@
/
@
5
2
(
/
2
1
2
(
/
2
@
2
(
/
2
(
2
(
/
2
D
2
(
/
2
.
2
(
/
2
3
2
(
/
2
4
2
(
/
2
5
2
(
/
2
6
2
(
/
1
2
2
(
/
1
1
?
#
I
?
2
2
@
?
#
I
?
2
2
D
?
#
I
?
2
2
.
?
#
I
?
2
2
3
?
#
I
?
2
2
4
?
#
I
?
2
2
5
?
#
I
?
2
2
6
?
#
I
?
2
1
2
?
#
I
?
2
1
1
?
#
I
?
2
1
@
Internal use 16/@2
unction Code 1unction( unction %ame #unction ,
Created 7y <#eelo&er Name> '=ecuted 7y
!ines of code ()) !ack of test cases -.
Test re5uirement <.rief descri&tion about re*uirements $hich are tested in this function>
$assed ailed Untested %+)+7 Total Test Cases
2 2 1. . 1 1 1.
U
T
C
&
,
:
1
U
T
C
&
,
:
2
U
T
C
&
,
:
2
U
T
C
&
,
:
2
U
T
C
&
,
:
2
U
T
C
&
,
:
2
U
T
C
&
,
:
<
U
T
C
&
,
:
9
U
T
C
&
,
:
8
U
T
C
&
,
1
:
U
T
C
&
,
1
1
U
T
C
&
,
1
2
U
T
C
&
,
1
#
U
T
C
&
,
1
>
U
T
C
&
,
1
?
Condition
$recondition
a
-@ O
-1 O
2 O O O
1 O O
b
2
O O
-@ O O O
@ O
c
2 O
1 O O O
( O
. O
Internal use @2/@2
Confirm "eturn
list
null
O O O
siHe 0 2
O
I-1/@J
O
I1,1J
O
I1,-(J
O
'=ception
!o. messa.e
Eplease input aF0 -1E
O
"esult
T)pe;N ' Normal, , ' ,bnormal, + ' +oundar)= A N N N N N B
>assed/#ailed
Executed ?ate
?efect I?
2
@
/
@
3
2
@
/
@
3
2
@
/
@
3
2
@
/
@
3
2
@
/
@
3
2
@
/
@
3
2
(
/
2
(

Das könnte Ihnen auch gefallen