Lab3 VuDucTrong HE171724
Lab3 VuDucTrong HE171724
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
- To verify that number of Unit TC meets customer's requirement or not. User has to fill number LOC of tested function and fill value of 'Normal num
- If the number of Unit TC does not meet the requirement, creator should explain the reasons.
- If the number of 'Normal number test cases/KLOC' item in FunctionList sheet is not recorded, the number in 'Lack of test cases' is not calculated.
Record of change
Effective Date Version Change Item *A,D,M Change description
<Date when these changes
are effective>
Reference
<List of documents which are refered in this version.>
Requirement
No Class Name Function Name Function Code(Optional) Sheet Name
Name
1 Class1 Function A Function1 Function1
2 Class2 Function B Function2 Function2
3 Class3 Function C Function3 Function3
stem
Description Pre-Condition
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
Condition Precondition
testAddCar O
testRemoveCar O
testUpdateCar O
testSetCarAvailability O
testCalculateInventoryValue O
testGetAverageMileage O
testGetAveragePrice O
testFindCarsInPriceRange O
testCountTotalCars O
testIncreaseMileageForAllCars
testClearInventory
testFindCarsOlderThan
testUpdatePriceForBrand
testFindCarsWithLowMileage
Input1
"Ford Fusion, 2022" O
"Toyota Camry" O O
"Honda Civic, Blue" O
None O O O O
20000.0, 25000.0 O
Expected Result
"3 cars, "Fusion" present O
1 car, "Camry" not present O
Color updated to Blue O
Availability false O
45000 O
17500 O
22500 O
2 cars O
"Camry" 20000, "Civic" 25000 O
0 cars
"Camry" present
1 car, "Civic"
-8.8
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
UTCID16
UTCID17
UTCID18
O
O
O
O
O
O
O
O O O
N N N N N N N N N
P P P P P P P P P
0 0 0 0 0 0 0 0 0
6 6 6 6 6 6 6 6 6
/ / / / / / / / /
1 1 1 1 1 1 1 1 1
6 6 6 6 6 6 6 6 6
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
Condition Precondition
testGetClassroomId O
testGetClassName O
testGetTeacher O
testGetCourses O
testAddCourse O
testRemoveCourse O
testToString
Input1
CL001 O
Math 101 O
"Classroom{"
"Calculus", +
C001,
"classroomId='CL001'," +
4 O O O
" className='Math 101'," +
" teacher=" + teacher +
", courses=[]" +
'}';
teacher O
Confirm
Expected Result
Add successfully O
Remove success O
Log message
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
N
P
UTCID01
UTCID02
UTCID03
UTCID04
Condition
testAddClassroom O
testGetAllClassrooms O
Precondition
ClassroomManager initialized O O
Teacher "John Doe" O O
Teacher "Jane Smith" O
Input1
Classroom "CL001", "Math 101", Teacher1 O
Classroom "CL002", "Physics 101", Teacher2 O
Expected Result
Classroom added successfully O
All classrooms returned correctly O
Passed/Failed P P
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
Condition Precondition
testRemoveStudent O
testAddTeacher O
testRemoveTeacher O
testAddClassroom O
testRemoveClassroom O
testAddCourse O
testRemoveCourse O
testAddSchedule O
testRemoveShedule O
testGetAllClassroom O
testGetAllCourses
Input1
S001 O
Dr. Bob White, "321 Elm St", "555-
4321", "T002", "Physics"
O O
T001 O
CL002", "Physics 101 O
CL001 O
C002 O
C001 O
Expected Result
Remove Student Done O
UTCID12
UTCID13
UTCID14
UTCID15
UTCID16
UTCID17
UTCID18
N N N N N N N N
P P P P P P P P
0 0 0 0 0 0 0 0
6 6 6 6 6 6 6 6
/ / / / / / / /
1 1 1 1 1 1 1 1
6 6 6 6 6 6 6 6
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
Condition Precondition
testGetFileSize O
testDisplayInfo O
testGetTitle O
testGetAuthor O
testGetFormat O
testGetPublicationDate O
Input1
25 O
"Digital Transformation" O
"John Doe" O
"PDF" O
new Date() O
Input2
Passed/Failed P P P P P P
Executed Date 0 0 0 0 0 0
6 6 6 6 6 6
Defect ID
/ / / / / /
1 1 1 1 1 1
6 7 7 7 7 7
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
P P P P F P P
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
Condition Precondition
testGetName O
testGetDescription O
testGetDate O
testGetLocation O
testSetName O
testSetDescription O
testSetDate O
testSetLocation O
Input1
"Book Fair" O
"Annual book fair event" O
initialDate O
"Main Hall" O
Input2
"New Book Fair" O
"New description" O
new Date() O
"New Location" O
Passed/Failed P P P P P P P P P P P
Executed Date 0 0 0 0 0 0 0 0
6 6 6 6 6 6 6 6
Defect ID
/ / / / / / / /
1 1 1 1 1 1 1 1
6 6 6 6 7 7 7 7
UTCID13
UTCID14
UTCID15
P F P P
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
Condition Precondition
testAddEvent O
testGetEvents O
testGetEventsByLocation O
testGetEventsByLocationCaseInsensitive O
testGetEventsByLocationNoMatch O
Input1
("Book Fair", "Annual book fair event", new Date(), "Main Hall") O O O O
Input2
("Reading Session", "Monthly reading session", new Date(), "Conference Room") O
Passed/Failed P P P P P P P
Executed Date 0 0 0 0 0
6 6 6 6 6
Defect ID
/ / / / /
1 1 1 1 1
6 6 6 6 7
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
P P P P P F P P
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
Condition Precondition
testLibraryInitialization O
testAddBook O
testRegisterMember O
testRegisterPublisher O
testBorrowBook O
testBorrowBookNonexistentBook
testBorrowBookNonexistentMember
testReturnBook
testReturnBookNonexistent
testGetAvailableBooks
Log message
Passed/Failed P P P P P
Executed Date 0 0 0 0 0
6 6 6 6 6
Defect ID
/ / / / /
1 1 1 1 1
6 6 6 6 6
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
UTCID16
UTCID17
UTCID18
O
O
O
O
O
O O O O O
N N N N N
P P P P P
0 0 0 0 0
6 6 6 6 6
/ / / / /
1 1 1 1 1
6 6 6 6 6
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
Condition Precondition
testGetBook O
testGetMember O
testGetLoanDate O
testIsReturned O
testReturnBook O
Input1
Book("The Great Gatsby", "F. Scott Fitzgerald", "123456789", new Date(), 0) O O O O O
Member("John Doe", "001", false) O O O O O
new Date() O O O O O
Input2
Expected Result
Book("The Great Gatsby", "F. Scott Fitzgerald", "123456789", new Date(), 0) O O O O O
Member("John Doe", "001", false) O O O O O
new Date() O O O O O
Log message
Passed/Failed P P P P P
Executed Date 0 0 0 0 0
6 6 6 6 6
Defect ID
/ / / / /
1 1 1 1 1
6 6 6 6 7
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
P P P P F P P
UTCID01
Condition Precondition
testAddLoan O
testGetLoansByMember
testGetOverdueLoans
testSendOverdueNotifications
Input1
new Loan(book, member, new Date()) O
new Book("The Great Gatsby", "F. Scott Fitzgerald", "123456789", new Date(), 0) O
new Member("John Doe", "001", false) O
new Date(System.currentTimeMillis() - 15 * 24 * 60 * 60 * 1000L)
Input2
new Book("1984", "George Orwell", "987654321", new Date(), 0), new Member("Jane Smith", "002", true), new Date());
Expected Result
new Loan(book, member, new Date()) O
new Book("The Great Gatsby", "F. Scott Fitzgerald", "123456789", new Date(), 0) O
new Member("John Doe", "001", false) O
new Date(System.currentTimeMillis() - 15 * 24 * 60 * 60 * 1000L)
new Book("1984", "George Orwell", "987654321", new Date(), 0), new Member("Jane Smith", "002", true), new Date());
Log message
Passed/Failed P
Executed Date 0
6
Defect ID
/
1
6
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
O
O
O
O O O
O O O
O O O
O O
O O O
O O O
O O O
O O O
O O O
O O
O
N N N N N N N A N N
P P P P P P P F P P
0 0 0
6 6 6
/ / /
1 1 1
6 6 6
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
Condition Precondition
testGetName O
testGetMemberId O
testIsPriorityMember O
testUpgradeToPriority O
testDowngradeToRegular O
testGetBorrowedBooksCount O
testIncrementBorrowedBooks O
testResetBorrowedBooksCount
testCanBorrowMoreBooks
testPayFine
Input1
"John Doe" O
"001" O
FALSE O O
TRUE O O
0 O
10.0
1 O O
Input2
Expected Result
"John Doe" O
"001" O
FALSE O O
true O O
1 O O
0 O
10.0
Log message
Passed/Failed P P P P P P P
Executed Date 0 0 0 0 0 0 0
6 6 6 6 6 6 6
/ / / / / / /
1 1 1 1 1 1 1
6 6 6 6 7 7 7
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
O
O
O
O
O O
O
O
O
O
O
O O
O
O
N N N N N A N N
P P P P P F P P
0 0 0
6 6 6
/ / /
1 1 1
7 7 7
UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
Condition Precondition
testAddNotification O
testGetNotifications O
testClearNotifications O
Input1
"New notification" O
"Notification 1" O O
"Notification 2" O
Input2
Expected Result
"New notification" O
"Notification 1" O O
"Notification 2" O
Log message
Passed/Failed P P P
Executed Date 0 0 0
6 6 6
Defect ID
/ / /
1 1 1
6 6 6
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
P P P P F P P