Unit testing is a Level of Testing where the 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 an expected value. The main intention of this activity is to check whether units are working as per the design and handling error and exception more neatly. Both positive and negative conditions should handle properly.
The white box testing is used to test the unit testing. This is the very first step in the 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 encompass uncommon and alternative flows. Once a project moves into the construction phase, the developers have a tendency to catch only the success situations or the situations which have been coded.
2. Construction and Unit testing need to be made distinct phases and the deliverable needs 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 into an application system.
- Mandatory Fields testing
- Unique Field Values testing
- Null value testing
- The field accepts allowable characters only
- Negative values testing
- The field is limited to the field length specifications
- 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 a set of conditions to the date fields
- Various Date Formats
- US or UK Style Date Format
- Positive testing – valid dates
- Negative testing- invalid Dates like
- A 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
- The link between Leap Years and 29th February
Time Validation:
This constitutes of a set of conditions to the time fields
- 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 a set of conditions to the postcode fields
- Test for partial Postcode input and check for postcode format
- Testing for space/no space
- Check if there is an option to enter address manually
System interfaces:
This constitutes a set of conditions to the fields which are transferred between multiple application systems.
- 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 a set of conditions that helps to verify the usability of an application system.
- 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 an asterisk symbol
Security:
This constitutes a set of conditions that helps to verify the security of an application system.
- 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 are applied
- Check if the 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 a valid URL(s). The system should ask for login details.
- Ensure Browser(s) does not remember Passwords
Logging, audit, and trails:
This constitutes a set of conditions that helps to verify the Audit Trails, System Logs, etc. of an application system.
- 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 a set of conditions that helps to verify the application logic and business processing of an application system.
- 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 to round on Calculated Amounts
- Ensure the 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.
- All fields are available
- Adequate space should be available for fields
- Enable Scrolling and Panning
- Page Numbering gives an indication of Report Size (N of M) and should enable access to mid/endpoints in Report
- Reports are exported correctly to Excel/Word documents
- Reports can be printed properly and all data appears correctly
- 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.
- Testing with all the browsers
- Testing by enabling and disenabling Java scripts
Email:
This section encompasses a set of checks that could be applied for verifying email capability
- Verify if a 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 the email are proper
Search criteria:
This section encompasses a set of checks on the Searching functionality of the application system.
- Verify that scroll bar is implemented
- Verify that the 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 an alphabetical or specified order
- Verify that column heading 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 definitely help white box testers to test your application.
Your feedback is important to us, please let us know your feedback in the comments below. If you like the article and then please share it. You can also share your personal experiences if you have done this before.
If you are not a regular reader of this website then highly recommend you to Sign up for our free email newsletter!! Sign up just providing your email address below:
⇓ Subscribe Us ⇓
If you are not regular reader of this website then highly recommends you to Sign up for our free email newsletter!! Sign up just providing your email address below:
Happy Testing!!!