Testing is a crucial part of the software development life cycle. Large-scale web application development is a serious endeavor that requires serious testing effort. There are different flavors of testing. Common wisdom suggests that you need to test your system at various levels of granularity using a combination of unit tests, integration tests, and functional tests. A respected TurboGears application has many components in different architectural layers and is distributed across at least two processes (the web server and the client's browser). Different parts of the application should be tested using different tools and different testing strategies. In this chapter, we'll introduce some test tools and frameworks that are packaged with TurboGears or that can be used to test TurboGears applications. Nose and testutil provide a great way to do unit and functional tests in development, Mechanize provides a good way to exercise your complete application stack and to run stress tests against your full production environment, and Selenium provides a great way to create tests that run right from within your browserthus allowing you to test Ajax and other JavaScript. |