Unit Test Case


In past, on White Box Software Testing, I wrote two posts:

In these posts, I covered some basic concepts of white software box testing. Here, in this post, I'm going to write abount some usefull tips that will help you while designing Unit Test Cases.
Preparing the Unit Test Cases document which is complete with every possible test case, is an important task in Unit Testing activity. It gives an assurance of defect-free Unit at the end of Unit Testing stage. Below are some usefull tips:
  • Input values: Write test cases for each of the identified inputs (positive & negative) accepted by the Unit.
  • Expected Functionality: Cover each functionality that is expected to be in the Unit.
  • Output values: Write test cases which will produce all types of output values that are expected from the module / unit.
  • Path coverage: If the Unit have conditional processing that results in various paths, then write test cases to cover each of these paths.
  • Abnormal terminations: Behavior of the Unit in case of abnormal termination should be tested.
  • Error messages: Check error messages / warnings. These should be short, precise and self-explanatory. They should be properly phrased and free of grammatical mistakes.
  • Screen Layout: Web page or screen layout must be tested against the requirements. Ensure that pages and screens are consistent and as per requirements.
  • If you are testing database application, it is important to make sure that transactions are properly designed and no way inconsistent data gets saved in the database.
Also, please note that the format of the unit test case document can be similar to the format of normal functional test cases. The fields can be:
  • Test Case Id
  • Test Case Purpose
  • Procedure / steps to be performed
  • Input Value / Test Data
  • Expected Result
  • Actual Result
  • Remarks
Also See:

1 comment:

  1. Can you please give an example, How unit test cases can be formatted in the Xl sheet.