Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 28. Challenges in “Testability” > Designing for Testability

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:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint