If you are skimming this book, you might be tempted to skip over this chapter. After all, why read about testing until you have an application to test? And why worry about debugging techniques until something goes wrong? The answer is simple: testing and debugging are activities that should be happening at every stage of developmentpossibly even before development. Why? Several reasons. It's not surprising that thoroughly tested code will be more reliable, but what might be surprising is that writing tests can actually speed up development. It's counterintuitive, but true because testing acts like a climbing harness: with a reduced penalty for making mistakes, you are freer to make bold, quick moves.
Ajax adds a new twist to testing and debugging, and it can often be a major source of frustration. In this chapter, we'll explore the tools and techniques that will help make your application stronger and your life easier.
In this chapter, we'll first look at debugging tricks and tools, then testing techniques, and finally a couple of ways to catch any remaining bugs that fall through the cracks.