|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 3 of 3
When we perform a test on a unit, we apply a set of inputs and observe what happens at the outputs.
Consider once again the single-class code. When one of the class's methods is invoked, several things happen. First, the method
takes the input parameters (node), combines them with the state variables (_hashmap), and produces a result. Second, the state of the object changes (that is, _hashmap holds one more node). For any particular method call both of those things may occur, or only one.
I mentioned earlier that it is often convenient to extend the list of what we observe to include the unit's internal state. That is the case for two reasons:
As I stated in the introduction, testing can't be effectively done if it's an afterthought. It deserves as much thought and preparation as the coding itself.
One key component of a testing strategy, therefore, is a methodology and framework that supports the testing process. We'll look at one such framework next month.
Designing for testability represents another important component. Simply stated, designing for testability takes into account a central fact: the design of the units to be tested has a great impact on the ease of testing those units. Therefore, I want to emphasize the importance not just of testing but also of designing applications and their components with testing in mind.
In practice, this boils down to following a few simple rules, some of which you're already probably familiar with:
If you've stayed with me this long, I hope you've come to better understand both the importance of testing and the importance of doing it thoroughly. Remember, to test how a unit behaves, you must both identify and control all of its inputs and identify and observe all of its outputs.
Next month we'll begin work on a simple testing framework that will allow you to test your code.
Read more about Tools & Methods in JavaWorld's Tools & Methods section.