We are optimistic by nature, but sometimes we should just be professional.
Here is one situation I see repeating from time to time (to me, or my fellow developers). I have a coding task (small development, small bug, doesn't matter), and I know exactly what needs to be done in order to solve it. I know that functionality very well, I am familiar with that code, the confidence is high. I could make the change with my eyes closed, and it would solve the problem for sure.
I make the change, and for some reason I decide that nothing can go wrong and I don't need to test it. For me, some of these reasons are:
- I have to get to something else quickly
- I don't have enough patience to test it right now
- the client needs this change right now
I quickly commit the change on SVN, move on and forget about it.
The result, a few hours or days later?
I can't believe it! I didn't realize that [something bad related to the change].
If I'm lucky, the person who observes the problem is someone from our testing team. Unfortunately, if I install the change directly on the production environment (due to client pressure) I can't be lucky.
But... if I'm lucky, the change does not break anything new. It just doesn't work, because it needs an additional change in order to work. Again, sometimes I am not lucky.
Here is why this happens: we are not computers, and we can't calculate all the implications in a situation unless it is very simple and without implications. Also, we sometimes forget things.
In software, actions generate effects. If you rely on your mind to control these effects, you will run into problems. In order to be efficient, you need to test the result in an objective way: the simplest (and usually slowest) method is to run the application and see what happened after the change, the sophisticated (and correct) method is to have automated tests.
So, unless you are changing the text in a label, resist the pressure / temptation and test the change before doing the commit.