Uploaded by aldiunanto

Unit Testing is performed by Developer

advertisement
Unit Testing – Test Case Preparation Guidelines
A Unit testing is a Level of Testing where smallest part of individual unit / component (called unit) is
tested to determine if they are fit for use.
The unit test cases writing and execution is done by the developer (not the tester) to make sure
that individual units are working as expected.
The smallest part of individual components like functions, procedures, classes, interfaces etc.
If we take an example of functions, when we pass input parameters to functions then check if the
function should return a expected values. The main intention of this activity is to check whether
units are working as per design and handling error and exception more neatly. The both positive and
negative conditions should handle properly.
The white box testing is used to test the unit testing. This is very first step in level of testing and
started before doing integration testing.
Unit Testing Test Case Preparation Guidelines:
1. Unit Test Plan/Cases should be made a separate deliverable. It should not be merged with other
artifacts. Try to document all the probable test scenarios which encompasses uncommon and
alternative flows. Once a project moves into construction phase, the developers have a tendency
to catch only the success situations or the situations which has been coded.
2. Construction and Unit testing need to be made distinct phases and the deliverable need to be
scheduled accordingly.
3. If Construction and UT are scheduled as a single phase, Unit testing results need to be made as a
separate deliverable – This would help in filtering out any mistakes in the business flows at a
nascent stage instead of in the integration testing or system testing which is more expensive.
4. Make use of the count of test cases planned, executed, passed, and failed to apprehend the
progress and replicate Unit testing if required.
5. Try to include on-the-fly test cases that are developed while executing a pre-defined set of test
cases.
Unit Testing Test Cases Preparation – Guidelines Checklist:
Input Data Validation:
This section encompasses a range of checks that may be adopted generally to the data which is
entered to an application system.
1.
2.
3.
4.
5.
6.
Mandatory Fields testing
Unique Field Values testing
Null value testing
Field accepts allowable characters only
Negative values testing
Field is limited to the field length specifications
7.
8.
9.
10.
11.
Improbable Value testing
Garbage Value testing
Check for inter- Field dependencies
Equivalence Class Partitioning and boundary condition testing
Ensure error notification and correction processing is robust
Date Validation:
This constitutes of a set of conditions to the date fields
1.
2.
3.
4.
5.
6.
7.
8.
9.
Various Date Formats
US or UK Style Date Format
Positive testing – valid dates
Negative testing- invalid Dates like
Month does not accept 00 and 13 as values
Day do not contain 00 and 32 as its values
28, 29, 30 are validated correctly.
Check for the impact of Weekends and Bank Holidays if applicable
Link between Leap Years and 29th February
Time Validation:
This constitutes of a set of conditions to the time fields
1.
2.
3.
4.
Various Time Formats like 12/24 hour format, AM/PM
Positive testing- check for valid Times
Negative testing- check for invalid Times
Check for the impact of Weekends and business holidays
Postcode validation:
This constitutes of a set of conditions to the postcode fields
1. Test for partial Postcode input and check for postcode format
2. Testing for space/no space
3. Check if there is option to enter address manually
System interfaces:
This constitutes of a set of conditions to the fields which are transferred between multiple
application systems.
1.
2.
3.
4.
Check if all fields/parameters on an interface are exercised properly
All data fields need to work properly as per the validation List
Security testing across automated Interfaces
Check for the parent child relationships
Usability:
This constitutes of a set of conditions which helps to verify the usability of an application system.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Check if the Layout is consistent with the design criteria
Check for the Fonts, Colors, Sizes, etc.
Test for Branding Guidelines
Check if the window caption for every application has the name of the application and the
window name
Check for alignment
Check if the screen is resizable and minimizable
Spelling check
Testing for default values if necessary
Mandatory fields need to be highlighted with as asterisk symbol
Security:
This constitutes of a set of conditions which helps to verify the security of an application system.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Negative testing- Password is not visible
Access testing- multiple levels
Positive testing- Change Password
Error messages should not reveal any system information
Check if SSL is correctly deployed
Check if Lockout rules is applied
Check if password saved in clear or encrypted?
Verify the application with valid UserId and invalid UserIds
Verify the application with valid password and various invalid passwords
Check for access to the application by directly entering valid URL(s). System should ask for login
details.
11. Ensure Browser(s) does not remember Passwords
Logging, audit and trails:
This constitutes of a set of conditions which helps to verify the Audit Trails, System Logs, etc. of an
application system.
1.
2.
3.
4.
Check if the logs are saved for the specified period
Check if the logs contain personal data
Check if Admin functions are logged
Check if user Lockout events are logged
Business application logic:
This constitutes of a set of conditions which helps to verify the application logic and business
processing of an application system.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Check if options for all available Products are explored
Check for all Upgrade and Downgrade Paths and Options
Verify upgrades and downgrades have been applied to billing, network, self-care etc
Behavior on Cease/Disconnect/Termination
Behavior on Equipment Failure
Check rounding on Calculated Amounts
Ensure full range of test accounts used, types/status/conditions
Check if currency symbol is displayed as required
Verify that duplicate records are not present.
Use large or very large amounts/numbers where arithmetic is involved to check overflow, both
in displayed and actual data forms
Reporting:
This section encompasses a set of checks that helps to verify reporting functionality offered by the
system.
1.
2.
3.
4.
All fields are available
Adequate space should be available for fields
Enable Scrolling and Panning
Page Numbering gives indication of Report Size (N of M) and should enables access to mid/end
points in Report
5. Reports are exported correctly to Excel/Word documents
6. Reports can be printed properly and all data appears correctly
7. Check if all the pages in the report are accessible
Environment:
This section encompasses a set of checks that helps to verify environmental or equipment
requirements for the AUT.
1. Testing with all the browsers
2. Testing by enabling and disenabling Java scripts
Email:
This section encompasses a set of checks that could be applied for verifying email capability
1.
2.
3.
4.
Verify if confirmation message is provided when Email is sent
Verify that the links provided in the emails function properly
Verify that Reply to Address is correct
Verify that Fonts, Size and alignment of texts in email are proper
Search criteria:
This section encompasses a set of checks on the Searching functionality of the application system.
1.
2.
3.
4.
5.
6.
Verify that scroll bar is implemented
Verify that alignment of the search results is proper
Verify that valid results are displayed for any combination of search conditions.
Verify that correct results are retrieved for AND/OR conditions
Verify that results are displayed in alphabetical or specified order
Verify that column headings are sortable
Conclusion:
In this article you learned all about Unit Testing test case preparation guidelines and checklists. I
hope this will definitely help our developer friends to write down the Unit test cases. These test
cases are definitely help white box testers to test your application.
Your feedback is important to us, please let us know your feedback in blank pages below.
If you find this article useful and then please share it. You can also share your personal experiences
if you have done this before.
Download