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 a 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.
- 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
- 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
This constitutes of 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
- 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
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
This constitutes of 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 option to enter address manually
This constitutes of 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
This constitutes of a set of conditions which 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 as asterisk symbol
This constitutes of a set of conditions which 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 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.
- 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.
- 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.
- 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
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 indication of Report Size (N of M) and should enables access to mid/end points 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
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
This section encompasses a set of checks that could be applied for verifying email capability
- 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
This section encompasses a set of checks on the Searching functionality of the application system.
- 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
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 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.