0% found this document useful (0 votes)
73 views9 pages

Testing

This document provides guidelines for creating unit test cases. It outlines a template for organizing test cases by function with sheets for an overview, function list, and test report. Each test case sheet specifies conditions like inputs and expected outputs to verify functions under normal, boundary, and abnormal scenarios. Metrics like test coverage and results are calculated to ensure requirements are met.

Uploaded by

Le Ba Hai Ha K17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views9 pages

Testing

This document provides guidelines for creating unit test cases. It outlines a template for organizing test cases by function with sheets for an overview, function list, and test report. Each test case sheet specifies conditions like inputs and expected outputs to verify functions under normal, boundary, and abnormal scenarios. Metrics like test coverage and results are calculated to ensure requirements are met.

Uploaded by

Le Ba Hai Ha K17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd

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:


- Code Module: name of the code module and updated automatically according to FunctionList sheet.
- Method: it is name of the code method/component and updated automatically according to FunctionList sheet.
- Created By: Name of creator.
- Executed By: Name of person who executes the unit test
- Test requirement: Brief description about requirements which are tested in this function, it is not mandatory.
UNIT TEST DOCUMENT

Project Name <Project Name> Creator


Project Code <Project Code> 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/9


OCUMENT

<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/9


Method 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

No Module Name Method Name Sheet Name Description


1 Registration queryStatus queryStatus queryStatus

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


Pre-Condition

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


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 Total Test Cases


1 queryStatus 4 4 2 4 1 3 10
2 methodName2 #REF! #REF! #REF! ### ### ### #REF!

Sub total #REF! #REF! #REF! ### ### ### #REF!

Test coverage #REF! %


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

Test Type
Passed Percent

N A
Passed Failed
B
Untested

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


B
Untested

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


Code Module Registration queryStatus Method queryStatus
Created By Kiennt Executed By HaLBH
Test requirement <Brief description about requirements which are tested in this function>
Passed Failed Untested N/A/B Total Test Cases
4 4 2 4 1 3 10

UTCID01
UTCID02
UTCID03
UTCID04
UTCID05
UTCID06
UTCID07
UTCID08
UTCID09
UTCID10
UTCID11
UTCID12
UTCID13
UTCID14
UTCID15
Condition Precondition
Email
lebahai123@[Link] O
abcabc O
lebahai@[Link] O
null O
LE BA HAI HA O
123 @ [Link] O
"" O
ElonMusk O
IsStudent 1 O O
0 O O O O
null O O
Confirm Return

Exception

Log message set Student success! O O O O


Set student fail! O O O O

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


Passed/Failed P F F P P F P F
Executed Date
Defect ID

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

You might also like