Designing for Testability


More important than the gadgets in our toolbox is how testable the application is. The most important factor in ease of test automation is the system's design. Correct application of Extreme Programming practices ought to lead you to the simplest, and thus most testable, design. However, teams must often deal with legacy systems that throw up roadblocks to test automation. If you're developing from scratch, take advantage of your opportunity to design a system that provides places where test scripts can easily hook in.

If the application has a user interface, design it so you can test most of the functionality at the layer just under the user interface. For example, if you have a Java Web application that uses Struts and JSPs, test as much as you can at the Struts layer. You'll spend as much time creating the automated tests, but this layer will be much more stable, and you won't spend nearly as much time maintaining the tests. If the JSPs don't contain too much code that has functionality needing testing, such as Javascript, you can get by with testing the user interface less often perhaps once every iteration. You may even decide to test it manually. Here's advice from Ron Jeffries:

Don't write many tests at the GUI level: keep the GUI very thin so that these can be minimized. Use an available GUI-testing tool for the rest. Do not expect this tool to solve other problems. (Ron Jeffries, e-mail)



Testing Extreme Programming
Testing Extreme Programming
ISBN: 0321113551
EAN: 2147483647
Year: 2005
Pages: 238

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