Unit Testing – Test Case Preparation Guidelines

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.

Unit Testing Guidelines

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.

  1. Mandatory Fields testing
  2. Unique Field Values testing
  3. Null value testing
  4. The field accepts allowable characters only
  5. Negative values testing
  6. The 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 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
  • 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.
  1. Check for the impact of Weekends and Bank Holidays if applicable
  2. The 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 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 an option to enter address manually

System interfaces:

This constitutes 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

Usability:

This constitutes a set of conditions that 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 an asterisk symbol

Security:

This constitutes a set of conditions that 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 are applied
  7. Check if the 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 a valid URL(s). The system should ask for login details.
  11. 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.

  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 a set of conditions that 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 to round on Calculated Amounts
  7. Ensure the 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

Reporting:

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 an indication of Report Size (N of M) and should enable access to mid/endpoints 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. Verify if a 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 the 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 the 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 an alphabetical or specified order
  6. 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:


 

Check email in your inbox for confirmation to get latest updates Software Testing for free.


  Happy Testing!!!
 

1 thought on “Unit Testing – Test Case Preparation Guidelines”

Leave a Comment

Share This Post