Java Reference
In-Depth Information
within a given period. Usually, you implement this with software like JM eter, 1 which
automatically sends preprogrammed requests and tracks how quickly the application
responds. These tests usually don't verify the validity of responses, which is why we
have the other tests. Figure 4.2 shows a JM eter throughput graph.
You normally perform stress tests in a separate environment, typically more con-
trolled than a development environment. The stress test environment should be as
close as possible to the production environment; if not, the results won't be useful.
Let's prefix our quick look at performance testing with the often-quoted number-
one rule of optimization: “Don't do it.” The point is that before you spend valuable
time optimizing code, you must have a specific problem that needs addressing. That
said, let's proceed to performance testing.
Aside from stress tests, you can perform other types of performance tests within
the development environment. A profiler can look for bottlenecks in an application,
which the developer can try to optimize. You must be able to prove that a specific bot-
tleneck exists and then prove that your changes remove the bottleneck.
Unit tests can also help you profile an application as a natural part of develop-
ment. With JU nit, you can create a performance test to match your unit test. You
Figure 4.2
A JMeter throughput graph
1
http://jakarta.apache.org/jmeter
 
 
 
 
Search WWH ::




Custom Search