3 ms·
Tests for software development == Crimes for political agenda. This is one of those issues you are supposed to lie about. Tests are like crime in politics --
by rdtsc 14y ago
Tests for software development == Crimes for political agenda.
This is one of those issues you are supposed to lie about.
Tests are like crime in politics -- no politician is going to say "I am soft on crime, I think we should reduce sentences." So crazier and crazier laws are created. Mandatory minimum sentences for possessing small amounts of drugs, all kind of craziness. People know it is crazy, but nobody is capable of speaking up and remain standing.
Same thing with tests. Nobody can say "fuck it, stop writing tests, the customer will never run this code, or this is too fucking obvious, test stuff that matters". That is considered irresponsible. Everyone is supposed to worry about not having enough tests.
Now there a subtle difference and that is when it comes to shipping on a schedule and in many companies tests are ignored -- BUT silently. Everyone loves talking about tests but try and tell you boss you spent 2 weeks on adding tests to your code. They might not like. Try to double the time you promise to do a feature by saying I need to write tests for it. Or if you are given free rein try saying I won't do all the new awesome features, I'll write more tests -- it will be approved probably but everyone in the end will praise the guy who chose to work on and deliver features -- even though they might be completely buggy and unusable. So that is the other side if you will.
- StavrosK 14y ago> Same thing with tests. Nobody can say "fuck it, stop writing tests, the customer will never run this code, or this is too fucking obvious, test stuff that matters". That is considered irresponsible. Everyone is supposed to worry about not having enough tests. I don't know about everyone else, but I definitely worry about having too many tests. For every test I write, I have to weigh how useful the test is versus how likely it is that the thing it is testing will change. If its usefulness is overshadowed by the likelihood that it will be a burden later on, it does not get written.
- rdtsc 14y agoYap. It is very easy to write bad tests -- tests that test too much, tests that test the wrong thing, tests that are too fragile (very timing dependent, they break intermittently and suck up resources in tracking down the cause), tests that are not repeatable (someone inserted random input generation and seeded the generator with the time function).
- Evbn 14y agoApply the same thinking to the feature code you write as well.
- StavrosK 14y agoOh, that threshold is even higher.
- SoftwareMaven 14y agoTry to double the time you promise to do a feature by saying I need to write tests for it. That, IMO, is the best argument for TDD. By having a process that forces tests first, you never get into the situation where you are cutting critical tests for the schedule's sake. For me, I ask the question, "Is this code adding more value than other code I could be writing?" If the answer is no, I do something else. Of course, this is completely subjective, but my years of experience count for something.
- Silhouette 14y agoThat, IMO, is the best argument for TDD. By having a process that forces tests first, you never get into the situation where you are cutting critical tests for the schedule's sake. On the other hand, with a process like TDD you also never get into the situation where you can cut non-critical tests.
- Evbn 14y agoIf the tests aren't critical, is the feature critical?
- Silhouette 14y agoSurely that depends on many factors, just like using any other tool or process? Does each test tell you something valuable? Is the cost of implementing and maintaining that test less than whatever value the test offers? That is, is the test cost-effective? Could you have found the same information more effectively some other way? That is, what is the opportunity cost of writing and maintaining that test?
- pacala 14y ago> stop writing tests, the customer will never run this code git rm <code that customer will never run>
- rdtsc 14y agoAgree! I was thinking also of in house support code, tooling, infrastructure maintenance, local IT stuff, build tools. Stuff that runs in-house, might be important but if it breaks, there won't be a 2am call from Australia or a public tweet about how "Product <X> from company <Y> just lost me all my data".
- Evbn 14y agoSure,not important if your in-house backend database backups work. Customers never see that.
- rdtsc 14y agoI have seen in-house bug tracking database backups fail and I have seen upset customers that spread the word to other potential customers. I'll take an in-house database backup failure any day. This is for a small niche industry where everyone knows everyone a bad word or hit can mean the end of the company.
- derefr 14y ago"Checkbox features." The customer will never run the code, but that doesn't mean they don't buy your product because of the code.