How often have you written an application or a Flash movie that worked as expected? Chances are, you have had to go through a thorough debugging process before finally reaching a point at which you could safely release the program into the world as a working application. Is the program bug-free? Probably not, but it is at a point where the usefulness of the functionality outweighs the number and severity of the bugs. This is the balance that most of us strive for in our software.
Testing and debugging are two completely separate processes, yet they are somehow intertwined throughout the application-building process. Generally, debugging occurs after the application is functional, but it is an integral part of the testing procedures throughout the development process. If everything worked right the first time, we wouldn't need to debug our programs. No program is bug-free, but the debugging process allows us to eliminate the bugs that are debilitating, the bugs that hamper the usefulness of the application, and the bugs that are just annoying.
Throughout this chapter, we will be using the searchProducts.fla example file from Chapter 3 as a reference point for the debugging discussion, as well as the communitymx.fla web service example from Chapter 10.