0% found this document useful (0 votes)
119 views22 pages

Group5 Lab2 SWT301

Uploaded by

tungnqhe186035
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views22 pages

Group5 Lab2 SWT301

Uploaded by

tungnqhe186035
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Guideline to make and understand Unit

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 fo
'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
cases/KLOC' item in FunctionList sheet, which is required by customer or normal value. The number of lacked T
- 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

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
- 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 <Project Name> Creator


Project Code <Project Code> Reviewer/Approver
Issue Date
Document Code <Project Code>_XXX_vx.x
Version

Record of change
Effective Date Version Change Item *A,D,M Change description
<Date when these changes
are effective>

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


CASE

<Date when this test report is created>

Reference
<List of documents which are refered in this version.>

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


UNIT TEST CASE LIST
Project Name <Project Name>
Project Code <Project Code>
Normal number of Test cases/KLOC 100
Test Environment Setup Description <List enviroment requires in this system

Requirement
No Class Name Function Name Function Code(Optional) Sheet Name Description
Name
1 Class1 Function A Function1 Function1
2 Class2 Function B Function2 Function2
3 Class3 Function C Function3 Function3

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


Pre-Condition

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


UNIT TEST REPORT
Project Name <Project Name> Creator
Project Code <Project Code> Reviewer/Approver
Document Code <Project Code>_Test Report_vx.x Issue Date <Date when this test report is created>
Notes <List modules included in this release> ex: Release 1 includes 2 modules: Module1 and Module2

No Function code Passed Failed Untested N A B


1 Function1 0 0 15 0 0 0
2 Function2 0 0 15 0 0 0
3 Function3 13 1 1 12 2 1

Sub total 13 1 31 12 2 1

Test coverage 31.11 %


Test successful coverage 28.89 %
Normal case 26.67 %
Abnormal case 4.44 %
Boundary case 2.22 %

Test Type
Passed Percent
B
7%

A
Passed 13%
29% Passed N A

Failed B
Untested
69% Untested
Failed N
2% 80%

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


Failed B
Untested
69% Untested
Failed N
2% 80%

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


n this test report is created>
ule2

Total Test Cases


15
15
15

45

est Type

N A

N
80%

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


B

N
80%

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


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
0 0 15 0 0 0

UTCID01

UTCID02

UTCID03

UTCID04

UTCID05

UTCID06

UTCID07

UTCID08

UTCID09
Condition Precondition
Can connect with server

Mark ID
1 O O O
a O
"" O
null O
1.2 O
1.00E+76 O
!@$ O
Select Student ID
HE176306 O O O O O O O O
HE176129 O
Assignment
9 O O O O O O O O
8 O
PT1
9 O O O O O O O O
8 O
PT2
9 O O O O O O O O
8 O
FE
9 O O O O O O O O
8 O
Average
9 O O O O O O O O
8 O
Select Instructor
Ngô Tùng Sơn O O O O O O O O
Phùng Duy Khương O
Select Class
SE1872 O O O O O O O O
SE1766 O
Select Semester
SU23 O O O O O O O O
SU24 O
Add O O O O O O O
Delete O
Edit O

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 11/22


Confirm Return
T O O O
F O O O O O O
Exception

Log message
Successfully..! O O O O O O O
Fail..! OD D D D
Result F F F F
Type(N : Normal, A : Abnormal, B : Boundary) N N N N N NI NI NI NI
Passed/Failed P F F F F PD FD PD FD
Executed Date 0 0 0 0 0 0
0 0
0 0
0 0
0
2 2 2 2 3 0
3 0
3 0
3 0
3
Defect ID 2/ 4/ 5/ 6/
/ / / / /
2 2 2 2 0 0 0 0 0
6 6 7 8 1 2 3 4 5

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 12/22


Function A

-5
n>
Total Test Cases
15
UTCID10

UTCID11

UTCID12

UTCID13

UTCID14

UTCID15

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 13/22


D D D D D D
F F F F F F
I I I I I I
D D D D D D
0
0 0
0 0
0 0
0 0
0 0
0
0
3 0
3 0
3 1
3 1
3 1
3
7/ 8/ 9/ 0/ 1/ 2/
0 0 0 0 1 1
6 7 8 9 0 1

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 14/22


Function Code =FunctionList!E12 Function Name Function B
Created By <Developer Name> Executed By
Lines of code 300 Lack of test cases 15
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B
0 0 15 0 0

UTCID01

UTCID02

UTCID03

UTCID04

UTCID05

UTCID06

UTCID07

UTCID08
Condition Precondition
Can connect with server
Student ID
HE176306 O O O
HE176129 O
a O
1 O
!@#$% O
1.111111111E+19 O
Student Name
Phạm Văn Tiền O O O O O O
Đồng Duy Nam O
Hoàng Xuân Nam O

Choose Gender
Male O O O O O
Female O O O
null
Date of birth
27-2-2003 O O O O O O
null O
27-2-2004 O
Address
Ninh Bình O
Tuyên Quang O O O O O O O

Phone
123456789 O O O O O O
asdadsadasd O O

Email
[email protected] O O O O O O O O

Select Major
IOT1761 O O O O O O O O
JL1634
Add O O O O O O
Delete O
Edit O
Confirm
Return

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 15/22


T O O O O
F O O O O
Exception

Log message
Successfully..! O O O O O O O
Result Fail..! OD D D
F F F
Type(N : Normal, A : Abnormal, B : Boundary) N N N N N NI NI NI
Passed/Failed P F F F F PD PD PD
Executed Date 0 0 0 0 0 0
0 0
0 0
0
2 2 2 2 3 0
3 0
3 0
3
Defect ID 2/ 4/ 5/
/ / / / /
2 2 2 2 0 0 0 0
6 6 7 8 1 2 3 4

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 16/22


Function B

15
nction>
N/A/B Total Test Cases
0 15
UTCID09

UTCID10

UTCID11

UTCID12

UTCID13

UTCID14

UTCID15

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 17/22


D D D D D D D
F F F F F F F
NI NI NI NI AI NI NI
PD PD PD PD FD PD PD
0
0 0
0 0
0 0
0 0
0 0
0 0
0
0
3 0
3 0
3 0
3 1
3 1
3 1
3
6/ 7/ 8/ 9/ 0/ 1/ 2/
0 0 0 0 0 1 1
5 6 7 8 9 0 1

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 18/22


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

UTCID01

UTCID02

UTCID03

UTCID04

UTCID05

UTCID06

UTCID07

UTCID08

UTCID09
Condition Precondition
Can connect with server
Instructor ID
AnhNN59 O O O O O
1.111111111E+19 O
!w3123 O
Instructor Name
Nguyễn Ngọc Anh O O O O O O
null O
Phone
8562215489 O O O O O O
asdasdas O

Email
[email protected] O O O O O O
554654 O

Add O O O O O
Delete O
Edit O

Confirm Return
T O O O O O O
F O
Exception

Log message
Successfully..! O O
Fail..! 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 F P P P P P
Executed Date 0 0 0 0 0 0 0 0 0
2 2 2 2 3 3 3 3 3
Defect ID
/ / / / / D/ D/ D/ D/
2 2 2 2 0 0
F 0
F 0
F 0
F
6 6 7 8 1 2I 3I 4I 5I
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 19/22


unction C

15
n>
Total Test Cases
15
UTCID10

UTCID11

UTCID12

UTCID13

UTCID14

UTCID15

N N N A N N
P P P P P
0 0 0 0 0 0
3 3 3 3 3 3
D/ D/ D/ D/ D/ D/
0
F 0
F 0
F 0
F 1
F 1
F
6I 7I 8I 9I 0I 1I
D D D D D D
0 0 0 0 0 0
0 0 0 1 1 1
7 8 9 0 1 2

02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 20/22


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
0 0 15 0 0 0

UTCID01

UTCID02

UTCID02

UTCID02

UTCID02

UTCID02

UTCID07

UTCID08

UTCID09
Condition Precondition

Passed/Failed
Executed Date 0 0 0 0 0 0 0
2 2 2 2 2 2 3
Defect ID
/ / / / / / /
2 2 2 2 2 2 0
6 6 6 6 6 6 3
02ae-BM/PM/HDCV/FSOFT v2/1 Internal use 21/22
Function A

-5
n>
Total Test Cases
15
UTCID10

UTCID11

UTCID12

UTCID13

UTCID14

UTCID15

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

You might also like