The goal of unit testing is to assure that all functions and features of a single compilable unit of code perform as specified in the Design Specification.
A unit test covers the testing of a software unit, or a group of closely related units, as a single entity. Unit testing is performed in isolation, using test drivers to simulate higher level units, and/or stubs to simulate lower level units. Unit Testing Procedures consist of:
- Creating a Unit Test Plan
- Creating test data
- Conducting tests according to the Unit Test Plan
- Reporting and reviewing the results of the test
These procedures are performed by the team member responsible for programming and testing of the unit.
A Unit Test Plan is a set of test cases arranged in the sequence of chronological execution. The Unit Test Plan is created before the programming of the unit is started, and the test cases should cover the functional, input, output, and function interaction of the unit.
Documents Required
The following documents provide information required to create the Unit Test Plan and are recommended reading before creating the Unit Test Plan.
Design Report
Requirements Reports
Change Requests
Unit Test Design Guidelines
The guidelines to be followed during the creation of Unit Test Plans are:
- A test case must exist for every branch in the code
- Design test cases and test data which reveal errors in software
Design test data that will ensure all conditions and quality of data edits are covered - Create test cases for special formulae and extreme conditions (e.g., Test case “File is Empty” shall be used for all files.)
- Test the interaction between units within the task
- To minimize the number of test cases, combine test cases into one if they test the same feature. (i.e., can cover a group of units or a full task)
Use test cases which already exist wherever possible. Include the generic test plan
Arrange test cases in the order that minimizes the effort required for test setup and that keeps related functions together - Where possible, arrange the test cases in the chronological order in which they will be performed
Leave a Reply
You must be logged in to post a comment.