A unit (module) can be as small as a non-trivial method in a class. It can be a whole class or a whole package too. Usually, the strategy for unit testing is structural or white-box testing based on a certain coverage criteria such as statement coverage, path coverage or decision coverage. In our case, we will use the path-coverage criteria as it is the strongest.
A set of white-box test cases should be developed to test the unit by exercising all general as well as special cases of the different constructs of the unit. For instance, boundary values analysis is an example of testing the special cases of a construct.
Number: A unique number of the as set of unit test cases that test specific structure
Title: A title for the set of tests; normally is the same title of the unit under test.
Package Name: This is the name of the package(s) that contain the unit under test. In modular design, a package would represent a unit that offer functionalities in its own.
Class Name: This is name of the Class under test. If the test is concerned with a package unit, this field would be N/A
Method Name: This is the Method under test, if the test is concerned with either a package or a class unit, this filed would be N/A
Description: Just a brief reminder about the purpose of this unit under test.
- Inputs: Provide a brief description of the inputs to the unit under test
- Outputs: Provide a brief description of the outputs to the unit under test
- Interfaces: Identify the units that interface with this unit indicating the nature of the interface: outputs data to, receives input data from, external methods interface, etc.
Stubs: Common Values for all test cases, which should be available from other units which are not ready yet; and are necessary for the test to execute. Note that if all other units are functioning already, there would be no need for stubs. Each test case may require some specific initial state values; these should be included in the corresponding test case, as described below.
Initial State: Common Data for all test cases, which should exist in the Database (or whatever persistent form), and are necessary for the test to execute. The initial state also includes settings of the static objects attributes. Each test case may require some specific initial state values; these should be included in the corresponding test case, as described below.
Testing Tools: Identify any tools employed to conduct unit testing. Specify any stubs or utility programs developed or used to invoke tests. Identify names and locations of these aids for future regression testing.
Positive Test Cases: Each use case should cover a specific equivalence class. Each test case may have some requirements with regard to the stubs and initial state. Each test case should have the components shown below:
- Test Case Number: A serial number within the set.
- Equivalence Class: The objective of this test, e.g., the specific path it covers.
- Stubs: Specific Stubs requirements
- Initial State: Specific Initial State requirements
- Scenario: User Input and System Response in a tabular form.
Nice post priya
ReplyDelete