Professional Documents
Culture Documents
SWT Lab 3 Unit Testing - Template
SWT Lab 3 Unit Testing - Template
1. Overview
- In the template, Unit test cases are based on functions. Each sheet presents test cases for one function.
- Cover: General information of the project and Unit Test cases
- FunctionList: The list of Classes and Functions in the document.
+ To control that the number of Unit TC meets customer's requirement or the norm, user should fill value for
'Normal number of Test cases/KLOC'.
+ Click on Function link to open the related Test cases of the function.
Note: You should create new Function sheet before creating the link
- Test Report: provive the overview results of Functions Unit test: Test coverage, Test successful coverage
(Summary, for normal/abnormal/boundary cases)
Note: Should check the formula of "Sub Total" if you add more functions
- If the number of 'Normal number test cases/KLOC' item in FunctionList sheet is not recorded, the number in 'Lack of test ca
Record of change
Effective Date Version Change Item *A,D,M Change description Reference
<Date when these <List of documents which are refered in this version.>
changes are effective>
Requirement Function
No Class Name Function Name Sheet Name Description
Name Code(Optional)
1 Class1 Function A Function1 Function1
2 Class2 Function B Function2 Function2
3 Class3 Function C Function3 Function3
Sub total 36 7 -8 35 7 3 35
Test Type
Passed Percent
Untested
16%
B
7%
A
16%
Passed N A
Failed
14% Failed B
Passed Untested
71% N
78%
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
Condition Precondition
Can connect with server
Date
29 O O
30
31
Month
2 O
3 O
4
Year
2000 O
2009 O
Confirm Return
T O O
F
Exception
Log message
"success"
"input1 is null"
Result Type(N : Normal, A : Abnormal, B : Boundary) A N N N N B A N N N N N A N N
Passed/Failed P P P P P F F P P P P P P P
Executed Date 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
/ / / / / / / / / / / / / / /
2 2 2 2 0 0 0 0 0 0 0 0 0 1 1
6 6 7 8 1 2 3 4 5 6 7 8 9 0 1
Defect ID D D D D D D D D D D
F F F F F F F F F F
I I I I I I I I I I
D D D D D D D D D D
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1
2 4 5 6 7 8 9 0 1 2
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
Condition Precondition
Can connect with server
Input1
"1"
""
null
Input2
>=5 & <= 10
5
10
Confirm Return
1
2
Exception
Log message
"success"
"input1 is null"
Result Type(N : Normal, A : Abnormal, B : Boundary) N N N N N B A N N N N N A N N
Passed/Failed P P P P P F F P P P P P F P P
Executed Date 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Defect ID 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
/ / / / / D/ D/ D/ D/ D/ D/ D/ D/ D/ D/
2 2 2 2 0 F0 F0 F0 F0 F0 F0 F0 F0 F1 F1
6 6 7 8 1 I
2 I
3 I
4 I
5 I
6 I
7 I
8 I
9 I
0 I
1
D D D D D D D D D D
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1
2 4 5 6 7 8 9 0 1 2
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
ConditionPrecondition
Can connect with server
Input1
"1"
""
null
Input2
>=5 & <= 10
5
10
Confirm Return
1
2
Exception
Log message
"success"
"input1 is null"
Result Type(N : Normal, A : Abnormal, B : Boundary) N N N N N B A N N N N N A N N
Passed/Failed P P P P P F F P P P P P P P
Executed Date 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Defect ID 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
/ / / / / D/ D/ D/ D/ D/ D/ D/ D/ D/ D/
2 2 2 2 0 F0 F0 F0 F0 F0 F0 F0 F0 F1 F1
6 6 7 8 1 I
2 I
3 I
4 I
5 I
6 I
7 I
8 I
9 I
0 I
1
D D D D D D D D D D
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1
2 4 5 6 7 8 9 0 1 2
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
ConditionPrecondition
Can connect with server
user_email
null O
"existing emal" O O
"non-existing email" O
password
null O
"valid password" O O O
"invalid passoword"
Confirm Return
("1", "kim", "female", "hanoi", "valid password", "existing email", "…") O
null O O O
Exception
SQLException O
Log message
"User SQLException" O
15
N N N A N N
P P P P P
UTCID01
UTCID02
UTCID02
UTCID02
UTCID02
UTCID02
UTCID07
Condition Precondition
N/A
num1
-2 O O
-1 O
0 O
1 O O O
num2
0 O O O
-2 O O
2 O O
operation
null O
"addition" O
"subtraction" O
"multiplication" O
"division" O O
"some-nonsense-text" O
Confirm Return
int
0 O O O
correct result O O O O
Exception
N/A
Log message
"Error: Operation cannot be null." O
"Performed addition: " O
"Performed subtraction: " O
"Performed multiplication: " O
"Performed division: " O
"Error: Division by zero is not allowed." O
3.5
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
ConditionPrecondition
N/A
Confirm Return
0 O O O O
12 O
Exception
NumberFormatException O O O
Log message
"input must be a positive integer" O
"input must be an integer O O O
successful O
Result Type(N : Normal, A : Abnormal, B : Boundary) A A N A A
Passed/Failed
Executed Date
Defect ID