Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
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 2 of 3
As an aside, we'll see that if we modify this simple notion slightly and examine the changes in the box's internal state, we can greatly simplify the test development for units whose internal states are well reflected in the values of their outputs.
In Java, the principal vehicle by which we apply inputs and obtain outputs is the method invocation. After all, we're ultimately interested in testing a unit's behavior, and methods contain the code that makes the unit do the behaving.
The code above illustrates the two primary ways that inputs are applied during a method invocation. Let's consider each in turn.
public
void
add(Node node) {
.
.
.
Handle handle = _service.register(node);
The code for a single class also illustrates the four primary ways outputs are obtained as the result of a method invocation. Let's consider each in turn.
return handle;
String class, for example):stringbuffer.append(stringPrefix);
throws EvaluationException...
Handle handle = _service.register(node);
You'll notice that in the discussion above I use the term external object. Let's consider the difference between internal and external objects in a little more detail since it affects testing significantly; whether an object is internal or external can also affect the amount of work required to design a suite of tests. The line between internal and external objects is not always well defined, but qualitatively it amounts to the following:
The effects that external objects will have as inputs and outputs must be taken into account when you develop tests.