Some people think (and they\’re right) that professional developers write tests. So, if you don’t do them, you’re an amateur. In my current job, I don’t write tests. And I’m not very happy about it, because the decision-making process of whether testing or not is beyond my control.
Something that I must say: In my pet-projects is the complete opposite. Since I’m quite new to testing, I must say it is a very addictive thing. This week for example I almost introduced a bug in the code, and was saved by my humble integration tests.
What do you think about people who do not insurance their cars? Irresponsible? I got two cars stolen on the last four years, and I must say it: You must insurance your car before taking it out of the garage. You just stop complaining about a R$150,00 monthly fee after you get a R$33.000,00 check from them and buy a new one.
[crazy_angel_investor_bait]But there\’s no company that insurances our software[/crazy_angel_investor_bait]. Meanwhile, we can “insurance” our own code by writing tests. And also set goals for it, like stop coding because all tests passed. This is useful for people who seems to spend a lot of time on trivial matters. Hey, you software do what it is supposed to do. Go on with your life.
So here is the (poor) analogy: You can’t tell when you’re gonna have a bug in your code, just like you don’t know when you’re gonna have your car stolen. You won’t have a insurance company to help your minimize your losses, but with tests, you know that your code would break some other working feature, and the number of bugs that do go public drops down heavily.
From today on, every time you go to a place where people don’t write tests, or hear someone say they don’t do it for whatever the reason, think about them as people who take the risk of losing a some tens of thousands of dollars (or brazilian reais in my case) everytime they drive their cars.