- Write a test stub for a component if it interfaces to specialized hardware that other developers will not have access to from their computers, it takes a long time to run, or it will take a lot longer to code relative to how quickly other developers using it will take to code their component.
- The reason for this is because it is important to test out the interfaces easily, early, and quickly. Turn around time is very important to developer productivity.
- If a test stub is necessary, then write the test stub before coding the production component so that other developers will have something to test their interfaces with early.
- The test stub does not have to be that sophisticated. Specify the limits of the test stub. For example, if some results are stored in an array dimensioned to 100 by 100 and controlled by two input variables to the method, then specify the limits to the test stub for those 2 variables as 0 to 99.