An Introduction to Software Testing
Testing is an integral part of the software development life cycle. As today's applications become increasingly more sophisticated, proper testing practices are all the more critical. There is an old saying among software developers, "test early, test often," which essentially means that it is easier to test smaller pieces of functionality as they're written than it is to begin testing when the entire application is built. For example, if you were assembling a car, you wouldn't install an engine that you hadn't tested. And if you were building the engine, you wouldn't install spark plugs and fuel injectors if you weren't certain that they worked properly. In software development, such tests of isolated software components are called unit testing.
Although unit testing can establish a baseline for determining an application's behavior, unexpected bugs can occur when many components start interacting. Testing the interactions between different components of a system is known as functional testing. This type of testing is the most difficult because it requires the application to be driven through all of its possible execution paths, and probed with all of its possible inputs. In some very complex systems, this might be practically impossible to do, so having reliable unit tests available becomes even more important.
When bugs do surface in an application, it's important to be able to locate them quickly. Having a logging system in place allows a record to be kept of what an application has been doing. These logs can provide hints as to what went wrong within an application. However, to really understand what a system is doing, an integrated debugger is required. The integrated debugger allows breakpoints to be set and the application to be paused during execution. You can then step through the code line by line to inspect the values of variables and watch the execution flow.
|