Template - Unit Test Case
Template - Unit Test Case
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
Record of change
Effective Date Version Change Item *A,D,M Change description Reference
6/13/2024 add Sheet about checkChoiceNumber, FunctionList, Test Report
checkInputInteger
Requirement
No Class Name Function Name Function Code(Optional) Sheet Name
Name
Sub total 32 2 0 26 6 2 34
Test Type
Passed Percent
Failed
6%
B
02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 6% 8/33
A
18%
Passed N A
Test Type
Passed Percent
Failed
6%
B
6%
A
18%
Passed N A
Failed B
Untested
N
Passed 76%
94%
TC001
TC002
TC003
TC004
TC005
TC006
Condition Precondition
N/A
Input
5 O
-1 O
abc O
15 O
5 O
null O
Min
1 O O O O O
5 O
Max
10 O O O O O
5 O
Confirm Return
5 O
null O
Exception
"Not valid. Input must be integer" O
Log message
"Not valid. Input must be in range [" + min + ", " + max + "]" O O
Defect ID D
F
I
D
0
0
1
1
ange [min, max] of integers.>
Total Test Cases
6
UTCID01
UTCID02
UTCID03
UTCID04
Condition Precondition
Input
"5" O
"-1" O
"0" O
"abc" O
Confirm Return
5 O
Exception
"Not valid. Input must be integer" O
Log message
"Input must be > 0" O O
Defect ID
N/A
UTCID01
UTCID02
UTCID03
Conditio Precondition
Code
"D001" O
"D003" O
"" O
Confirm Return
1 O
0 O O
Exception
Log message
.2
UTCID01
UTCID02
UTCID03
UTCID04
Condition Precondition
Code
"D001" O
"D002" O
"D003" O
"" O
Confirm Return
"D001", "John Doe", "Cardiology", 10 O
"D002", "Jane Smith", "Neurology", 15 O
Null O O
Exception
Log message
UTCID01
UTCID02
UTCID03
Condition Precondition
Code
"abc" O
"123" O
"" O
Confirm Return
"abc" O
"123" O
Exception
Log message
"String must not empty" O
UTCID01
UTCID02
UTCID03
UTCID04
Condition Precondition
Code
"abc" O
"123" O
"@$%#" O
"" O
Confirm Return
"abc" O
"123" O
Exception
Log message
"String must not be empty" O
"" O
Result Type(N : Normal, A : Abnormal, B : Boundary) N N A A
Passed/Failed P P P P
Executed Date 0 0 0 0
6 6 6 6
/ / / /
1 1 1 1
6 6 6 6
Defect ID
public static void
addDoctor(ArrayList<Doctor>
Function Code listDoctors) Function Name checkInputStringForName
Created By SangTV Executed By SangTV
Lines of code 26 Lack of test cases 1.6
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B Total Test Cases
1 0 0 1 0 0 1
UTCID01
Condition Precondition
Code
"D004" O
Name
"New Doctor" O
Specialization
"Surgery" O
Availability
15 O
Confirm Return
"D004", "New Doctor", "Surgery", 15 O
Exception
Log message
al Test Cases
1
Function Code updateDoctor Function Name updateDoctor
Created By SangTV Executed By SangTV
Lines of code 48 Lack of test cases 3.8
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B Total Test Cases
1 0 0 1 0 0 1
UTCID01
Condition Precondition
Old code had existed
Code
"D004" O
Name
"New Doctor" O
Specialization
"Surgery" O
Availability
15 O
Confirm Return
"D004", "New Doctor", "Surgery", 15 O
Exception
Log message
UTCID01
Condition Precondition
Old code existed
Code
"D001" O
Confirm Return
"Delete succesful" O
Exception
Log message
"Not found doctor"
UTCID01
UTCID02
Condition Precondition
Old code existed
String
"Jane" O
"NonExistent" O
Confirm Return
""D002", "Jane Smith", "Neurology", 15" O
Exception
Log message
"Not found doctor" O
UTCID01
UTCID02
UTCID03
Condition Precondition
Old code existed
Int
1 O
2 O
3 O
Confirm Return
List Sort Doctors By Code O
List Sort Doctors By Name O
List Sort Doctors By Specialization O
Exception
"Sort successful." O O O
Log message
"Invalid option"
al Test Cases
3
Function Code sortDoctors Function Name sortDoctors
Created By SangTV Executed By SangTV
Lines of code 11 Lack of test cases -0.9
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B Total Test Cases
2 0 0 2 0 0 2
UTCID01
UTCID02
Condition Precondition
Empty List O
Not emply lít O
Confirm Return
"No doctors available." O
"Sort successful." O
Exception
O O
Log message
"Invalid option"