Strategies for Testing

Application testing should be largely automated. Although you'll need to perform some testing manually, such as usability testing, much of the unit, integration, and performance testing can be automated. The main reasons for automating testing are to decrease workload and increase repeatability . Although automating tests requires effort up front, it's largely a one-time effort, whereas manual testing requires effort each time you test. Automated tests will also reproduce the same actions faithfully each time they're run, whereas humans are likely to deviate from the plan, especially in complex test cases.

You can use any approach that you like to automate unit and integration testing but you'll probably find it useful to utilize a testing framework such as JUnit to ease the burden of test writing. Although JUnit ( www.junit.org ) is primarily designed for unit testing, it's equally suited to integration testsyou simply need to reduce the granularity of the tests. Even web interfaces can be easily tested using JWebUnit ( http://jwebunit. sourceforge .net ), a very useful JUnit extension.

Performance and load testing aren't quite as simple. You first need to define what you're testing and obtain some performance figures for it. We find that Apache JMeter ( http://jakarta.apache.org/jmeter ) is a useful tool for this as it allows us to save our tests so that we can replay them anytime . If a test shows a bottleneck you need to find out where that bottleneck exists. For this it's important to be accurate and not just guess at where you think the bottleneck lies because you'll be end up wasting time fixing bugs that don't exist. Invest in a good profiler such as Borland's Optimizeit ( www.borland.co.jp/optimizeit/ ) or Quest Software's JProbe ( www.quest.com ), and run the performance test again, this time using the profiler to monitor the application server.

Although it's important that developers run tests on their local workstations, it's just as important that all tests are run centrally . Indeed, this is the only way of effectively running your integration tests. Scheduling tests to be run each night is a relatively simple jobwith effective use of Ant and scheduled tasks you can run all tests overnight and have a nice report delivered to a developer's mailbox the next morning.



Oracle Application Server 10g. J2EE Deployment and Administration
Oracle Application Server 10g: J2EE Deployment and Administration
ISBN: 1590592352
EAN: 2147483647
Year: 2004
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net