4 ms·
Could not disagree more. For reference, my company (https://circleci.com https://circleci.com) probably has one of the largest test suites in Clojure (approx 16
by pbiggar 13y ago
Could not disagree more. For reference, my company (https://circleci.com https://circleci.com) probably has one of the largest test suites in Clojure (approx 16kLOC in the test suite, > 5000 assertions).
The value is testing is that it saves time in the long run. If you don't have a decent test suite, then as your product matures, you become unable to do anything because each new feature breaks a dozen old things.
Alex is right about the opportunity cost (see my own post "Testing is bullshit": http://blog.circleci.com/testing-is-bullshit/ http://blog.circleci.com/testing-is-bullshit/). But not testing is also an opportunity cost.
Basically you can spend T minutes writing tests, or D minutes debugging problems that tests would have found. If you don't test at all, then D will rapidly (within weeks possibly) become so high that you can't get anything done. By contrast, T will rarely go above 50% of time spent on a project (and if it is, you need to rethink how you test, unless you're building rockets or medical equipment).
- puredanger 13y agoWhat in particular are you disagreeing with? You seem to be implying that I'm saying not to write tests or that testing isn't valuable but that's not what I said. As I said: "I think tests are highly valuable. I don’t know how I could write high quality code without writing tests." Every Clojure dev I've ever worked with wrote tests and relied on them. My point is that there are costs to consider. I observe that the Clojure community is interested in trying a wide variety of testing approaches that may mitigate some costs of testing, perhaps more so than other communities. I have also worked on a system with a large Clojure test suite (at least 30kLOC), primarily example-based. We found that there was substantial cost (even with many custom-built tools) to maintaining those tests. I've had the same experience maintaing large Java test suites. Recently, I've been doing more with generative testing - I think generative and contracts may give you a better return on your effort than example based testing. But that's a hypothesis I look forward to investigating.
- siscia 13y agoWhat kind of test you run ? Do you test every single pure functions or you test just abstraction layers ? Or what ?