News for hackers. Stuff that matters.
Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by jemfinch on Thursday October 20, 2011 @02:59PM (#3136332)
None of us do "guardrail driving", but we still put guardrails on roads.
Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by jurjenh on Thursday October 20, 2011 @05:58PM (#3137281)
However, on most highways the guardrails are only on the dangerous sections.

So sticking with this analogy, we should only need to use testing in the more intricate / complex parts of our code. However, current testing best practice seems to be to test everything possible, thus potentially wasting a lot of time and effort into aspects with a low ROI.

There could be some lesson in this...

Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by chousuke on Friday October 21, 2011 @01:51AM (#3138623)
I think to begin with it's futile to try to cover all relevant behaviour in tests as you introduce new code. Some basic functionality tests will do fine to prevent anyone from completely breaking the code, as well as providing fair documentation as to what the developer expects the code to do.

However, I think regression tests are useful. Once you find a bug and fix it, the things learned from fixing the bug can be expressed in a test, to prevent similar bugs from happening again. In such a case, the test documents an unexpected corner case that the developer was unable to predict.

Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by dvogel on Saturday October 22, 2011 @12:49PM (#3143818)
Your regression tests sound very similar to what I call perl tests. The perl community was ahead of it's time by distributing a test suite with packages on CPAN. Tests that come out of bug fixes tend (at least for me) to be complexity tests. Essentially they are a 2x2 test of the interaction of pairs of conditional paths with some interaction between them. This dovetails nicely with Rich's point -- keep things simple but in those few inevitable areas where complexity will arise, make sure you can reason about them. I just write regression tests around them to ensure that my reasoning about them is correct. Rich skips the tests because he's better at remembering or re-reasoning through them again :)
Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by bitops on Thursday October 20, 2011 @07:27PM (#3137606)
That's an interesting point. I've noticed that as I grow as an engineer, I still place a high importance on tests, but the type of tests I write and how I write them has changed a lot.

When I first started testing it seemed like the world suddenly got really scary and now I had to test everything. I ended up testing ridiculous stuff, things that the language would provide by default. (I did this in many languages which is why I don't mention a specific one).

What I've found valuable as I do testing (I do TDD) is that it has made me change how I think about design and composability.

I agree that there should be a greater focus on "what is appropriate to test" but even knowing how to write tests and what to test is a skill in itself.

Re:Rich Hickey: "Simple Made Easy" from Strange Loop 2011 [v... by skew on Saturday October 22, 2011 @02:09AM (#3142970)
I enjoyed being a passenger for some "guardrail driving"

http://www.eurail.com/planning/trains-and-ferries/high-speed...

These too run on rails.