Testing is generally aimed at showing that software works as intended, but debugging is the process of removing errors from a software application. However, testing is often more complicated than merely showing that a software application works.
For large software projects, testing can be split into several phases in which each phase has a distinct goal. For smaller projects, testing and debugging are sometimes performed concurrently.
By and large, testing is meant to locate defects in a software application. It is aimed at proving that the software achieves its intended functionality to a certain level, which is generally set lower than 100 percent functionality since that is unusually difficult to achieve. Testing may be performed manually, but for big projects, it is not uncommon to automate the process.
Debugging is meant to locate and remove bugs from the software. It is usually manual and performed once for every bug because one bug is different from another. A bug in most cases is the difference between what a software application actually does and what it is intended to do.
Bugs can be logical or syntactical. Specialized programs that locate these bugs are called debuggers, and most programming environments come with a built-in debugger.