Testing is often something of an afterthought for programmers because it tends to be laborious and annoying. Also, we usually have a high degree of confidence in our work and testing it seems unnecessary. It's also a fact, though, that the confidence is often misplaced. Source code is a complex and subtle language, and it's easy to make mistakes while writing it and not even notice them. We all know this from experience, but that doesn't make it any easier to make time for something that is laborious, annoying, and feels unnecessary. The following flow diagram illustrates a simple example of testing:
So, the first question about testing is, How can we do it in a way that doesn't feel like a painful waste of time? Finding a way to overcome this psychological barrier is the first step toward creating a testing method...