Unit Testing – Test Case Preparation Guidelines

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.

  1. Mandatory Fields testing
  2. Unique Field Values testing
  3. Null value testing
  4. Field accepts allowable characters only
  5. Negative values testing
  6. Field is limited to the field length specifications
  7. Improbable Value testing
  8. Garbage Value testing
  9. Check for inter- Field dependencies
  10. Equivalence Class Partitioning and boundary condition testing
  11. Ensure error notification and correction processing is robust

Date Validation:

This constitutes of a set of conditions to the date fields

  1. Various Date Formats
  2. US or UK Style Date Format
  3. Positive testing – valid dates
  4. 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.
  1. Check for the impact of Weekends and Bank Holidays if applicable
  2. Link between Leap Years and 29th February

Time Validation:

This constitutes of a set of conditions to the time fields

  1. Various Time Formats like 12/24 hour format, AM/PM
  2. Positive testing- check for valid Times
  3. Negative testing- check for invalid Times
  4. 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. Check if all fields/parameters on an interface are exercised properly
  2. All data fields need to work properly as per the validation List
  3. Security testing across automated Interfaces
  4. Check for the parent child relationships


This constitutes of a set of conditions which helps to verify the usability of an application system.

  1. Check if the Layout is consistent with the design criteria
  2. Check for the Fonts, Colors, Sizes, etc.
  3. Test for Branding Guidelines
  4. Check if the window caption for every application has the name of the application and the window name
  5. Check for alignment
  6. Check if the screen is resizable and minimizable
  7. Spelling check
  8. Testing for default values if necessary
  9. 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.

  1. Negative testing- Password is not visible
  2. Access testing- multiple levels
  3. Positive testing- Change Password
  4. Error messages should not reveal any system information
  5. Check if SSL is correctly deployed
  6. Check if Lockout rules is applied
  7. Check if password saved in clear or encrypted?
  8. Verify the application with valid UserId and invalid UserIds
  9. Verify the application with valid password and various invalid passwords
  10. 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. Check if the logs are saved for the specified period
  2. Check if the logs contain personal data
  3. Check if Admin functions are logged
  4. 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. Check if options for all available Products are explored
  2. Check for all Upgrade and Downgrade Paths and Options
  3. Verify upgrades and downgrades have been applied to billing, network, self-care etc
  4. Behavior on Cease/Disconnect/Termination
  5. Behavior on Equipment Failure
  6. Check rounding on Calculated Amounts
  7. Ensure full range of test accounts used, types/status/conditions
  8. Check if currency symbol is displayed as required
  9. Verify that duplicate records are not present.
  10. 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.

  1. All fields are available
  2. Adequate space should be available for fields
  3. Enable Scrolling and Panning
  4. 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


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


This section encompasses a set of checks that could be applied for verifying email capability

  1. Verify if confirmation message is provided when Email is sent
  2. Verify that the links provided in the emails function properly
  3. Verify that Reply to Address is correct
  4. 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. Verify that scroll bar is implemented
  2. Verify that alignment of the search results is proper
  3. Verify that valid results are displayed for any combination of search conditions.
  4. Verify that correct results are retrieved for AND/OR conditions
  5. Verify that results are displayed in alphabetical or specified order
  6. 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.

Leave a Reply