News for hackers. Stuff that matters.
Re:Kent Beck: “I get paid for code that works, not for tests... by misja111 on Thursday December 08, 2016 @10:43AM (#13130948)
There are a couple of reasons why you should/ could write tests:

- for catching regressions in the future

- to verify that your code works. How else would you know that your backend service reacts properly on some edge condition

- as documentation

- as a kind of quality mark, for instance to be able to pass a code review or when writing code for an external party

Unfortunately the last reason is also the most useless and still it is the one that seems to be the main motivation for many big enterprise developers.

Re:Kent Beck: “I get paid for code that works, not for tests... by TallGuyShort on Thursday December 08, 2016 @10:49AM (#13131005)
>> - as documentation

Thank you for including this - it's underappreciated. So many times recently I've needed to write code against some poorly documented API (not always due to lack of effort, some things are hard to document well in prose / JavaDocs, or just due to constant change), but I took one look at the unit tests and it all made sense - and I knew it was up to date for the latest work.

Re:Kent Beck: “I get paid for code that works, not for tests... by Freak_NL on Thursday December 08, 2016 @10:59AM (#13131122)
Tests are great for dyslexic colleagues as well. A good clear concise unit test is often easier to grasp than the best of API documentation (e.g., JavaDoc in Java).
Re:Kent Beck: “I get paid for code that works, not for tests... by TallGuyShort on Thursday December 08, 2016 @12:03PM (#13131831)
Good point - I'd bet it applies to autism and such too.
Re:Kent Beck: “I get paid for code that works, not for tests... by euyyn on Thursday December 08, 2016 @04:25PM (#13134442)
I think it applies to everybody. I think it was Terence Tao who had a blog post claiming (and showing) that teaching by example first is the most effective.
Re:Kent Beck: “I get paid for code that works, not for tests... by mannykannot on Thursday December 08, 2016 @02:51PM (#13133601)
I know this is not formally an ordered list, but it looks cart-before-the-horse-ish to have catching future regressions before verifying that it works in the first place. (This comment is effectively a reply to the OC's claim that we don't test to verify.)