Lab2 Unit Test Case RRS Group 5

Download as xls, pdf, or txt
Download as xls, pdf, or txt
You are on page 1of 10

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.
- 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

2. Content in Test function sheet


2.1 Combination of test cases.
- To verify that number of Unit TC meets customer's requirement or not. User has to fill number LOC of tested function and
number test cases/KLOC' item in FunctionList sheet, which is required by customer or normal value. The number of lacked TC
test cases' item.
- 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
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 values of inputs.
- Precondition: it is setting condition that must exist before execution of the test case.
Example: file A is precondition for the test case that needs to access file A.
- Values of inputs: it includes 3 types of values: normal, boundary and abnormal.
. Normal values are values of inputs used mainly and usually to ensure the function works.
. Boundary values are limited values that contain upper and lower values.
. Abnormal values are non-expected values. And normally it processes exception cases.
- For examples:
Input value belongs to 5<= input <=10.
. 6,7,8,9 are normal values.
. 5, 10 are boundary values.
. -1, 11,... are abnormal values.
b. Confirmation:
- It is combination of expected result to check output of each function.
If the results are the same with confirmation, the test case is passed, other case it is failed.
- Confirmation can include:
+ Output result of the function.
+ Output log messages in log file.
+ Output screen message...
c. Type of test cases and result:
- Type of test case: It includes normal, boundary and abnormal test cases. User selects the type based on the type of inp
- Test case result: the actual output results comparing with the Confirmation.
P for Passed and F for Failed cases.
It can 'OK' or 'NG' (it depends on habit of the teams or customers)

2.3. Other items:


- Function Code: it is ID of the function and updated automatically according to FunctionList sheet.
- Function Name: it is name of the function and updated automatically according to FunctionList sheet.
- Created By: Name of creator.
- Executed By: Name of person who executes the unit test
- Lines of code: Number of Code line of the function.
- Test requirement: Brief description about requirements which are tested in this function, it is not mandatory.
UNIT TEST CASE

Project Name Room Renting System Creator Group 5


Project Code RRS Reviewer/Approver Ms.Truc
Issue Date 19/07/2021
Document Code RRS-UTC-Group5
Version 1.0 Draft

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>
15/07/2021 1.0 Draft Adding Functions Adding test case for Functions

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 3/10


UNIT TEST CASE LIST
Project Name Room Renting System
Project Code RRS
Normal number of Test cases/KLOC 100
Test Environment Setup Description <List enviroment requires in this system
1. Server
2. Database
Requirement 3. Web Browser
Function
No Class Name
Function Name Sheet Name Description Pre-Condition
Name ... Code(Optional)
1 Class1 Function A >
Function1 Register Register function for guest to create account
2 Class2 Function B Function2 Login Guest login into the system and become a user
3 Class3 Function C Function3 Add Room Service Provider add Room to put on RRS

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 4/10


UNIT TEST REPORT
Project Name Room Renting System Creator Group 5
Project Code RRS Reviewer/Approver Ms.Truc
Document Code RRS_Test Report_vx.x Issue Date 15/07/2021
Notes

No Function code Passed Failed Untested N A B Total Test Cases


1 Register Function 7 2 #REF! 6 2 1 #REF!
2 Login Function 4 0 #REF! ### ### ### #REF!
3 Add Room Function 7 2 #REF! 7 1 1 #REF!

Sub total 18 4 #REF! ### ### ### #REF!

Test coverage #REF! %


Test successful coverage #REF! %
Normal case #REF! %
Abnormal case #REF! %
Boundary case #REF! %

Test Type
Passed Percent

Failed
18%
Passed N A

Failed B
Untested
Passed
82%

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 5/10


Failed B
Untested
Passed
82%

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 6/10


Function Code Function Name DayMonth
Created By <Developer Name> Executed By Group 5
Lines of code 100 Lack of test cases #VALUE!
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B
7 2 #REF! 6 2 1

UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
Condition Precondition
<None>.
Username
Blank O
"Character" type O O
"Integer" type O O
"String" type O O O O
First Name, Last Name, Address
Blank O
"Character" type O O O O
"Integer" type O O
"String" type O O
Email
Invalid Email O O
test123@mail.com O O O O O O
Password
length<8 O O
length>32 O
32>length>8 O
!,@,#,$,%,^,&,*,(,) >8 <32 O O O O O
123789
Confirm Return
T O O O O
F O O O O O
Exception

Log message "You input is in wrong format" O O O


"Register Successfully" O O O O
"Password length must be >8 and <32 and have special character" O O O
Result Type(N : Normal, A : Abnormal, B : Boundary) A N N N N B A N N
Passed/Failed P P P P P F F P P
Executed Date 0 0 0 0 0 0 0 0 0
Defect ID 2 2 2 2 3 3 3 3 3
D D D D
/ / / / / / / / /
F F F F
2 2 2 2 0 0 0 0 0
I I I I
6 6 7 8 1 2 3 4 5
D D D D
0 0 0 0
0 0 0 0
2 4 5 6

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 7/10


Function
Function Code Function2 Name
Created By <Developer Name> Executed By
Lack of test
Lines of code 300 cases
<Brief description about requirements which are
Test requirement tested in this function>
Passed Failed Untested
4 0 #REF!

UTCID01
UTCID02
UTCID03
UTCID04
Condition Precondition Precondition
User already have an account
Account
Valid O O
Invald O O
Password
Valid O O
Invalid O O

Confirm

Result
"Login Successfully" O
"Incorrect account or password" O O O

Result Type(N : Normal, A : Abnormal, B : Boundary) N N N N


Passed/Failed P P P P
Executed Date 0 0 0 0
Defect ID 2 2 2 2
/ / / /
2 2 2 2
6 6 7 8

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 8/10


Function Code Function3 Function Name Function C
Created By <Developer Name> Executed By
Lines of code 300 Lack of test cases #VALUE!
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B
7 2 #REF! 7 1 1

UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
Conditio Precondition
User already have an account
Location
Ho Chi Minh O O O O
Ha Noi O O O
New York O O
Price
"String" type O O O O
"Character" type O O
"Integer" type O O
"Float" type O O
Image
JPEG O O O O O O
PNG O O O
Zalo

"string type" O O O
"integer" type lenght=10 O O O
"integer" type length=11 O O
"integer" type 1=<length<10 O

Confirm Result
1
0
Log message
"Location is not currently available" O O O
"Can only upload image file .JPEG" O O O
"Room added successfully" O O O
"Error! Your input is out of format" O O O O O O
Result Type(N : Normal, A : Abnormal, B : Boundary) N N N N N B A N N
Passed/Failed P P P P P F F P P
Executed Date 0 0 0 0 0 0 0 0 0
Defect ID 2 2 2 2 3 3 3 3 3
D D D D
/ / / / / / / / /
F F F F
2 2 2 2 0 0 0 0 0
I I I I
6 6 7 8 1 2 3 4 5
D D D D
0 0 0 0
0 0 0 0
2 4 5 6

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 9/10


Function Code Function1 Function Name Function A
Created By <Developer Name> Executed By
Lines of code 100 Lack of test cases -5
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B Total Test Cases
0 0 15 0 0 0 15

UTCID01
UTCID02
UTCID02
UTCID02
UTCID02
UTCID02
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
Condition Precondition

a
-2 O
-1 O
0 O O O
1 O O
b
0 O O
-2 O O O
2 O
c
0 O
1 O O O
3 O
5 O

Confirm Return
list
null O O O
size = 0 O
{-1/2} O
{1,1} O
{1,-3} O
Exception

Log message
"please input a>= -1" O

Result Type(N : Normal, A : Abnormal, B : Boundary) A N N N N N B


Passed/Failed
Executed Date 0 0 0 0 0 0 0
Defect ID 2 2 2 2 2 2 3
/ / / / / / /
2 2 2 2 2 2 0
02ae-BM/PM/HDCV/FSOFT v2/1 Internal
6 6use6 6 6 6 3 10/10

You might also like