Unit testing
One thing that types of testing have in common is that their goal is to ferret out problems with the software.
The earlier we are able to catch a bug, the cheaper it is to fix it. If the developer can find, diagnose, and fix a bug during the development stage, it will happen much faster than if it happens during user acceptance testing when the client gets his hands on the final product. As we will see later in the chapter, once unit tests have been set up, it is relatively cheap to run them; whereas, it is fairly expensive if a problem gets uncovered during regression or integration testing. One reason for that is because the former test is automated and the latter one requires a professional tester to spend valuable time on testing activity.