News for hackers. Stuff that matters.
Re:Most Unit Testing Is Waste (2014) [pdf] by _RPM on Saturday October 08, 2016 @01:41PM (#12667808)
What was the definition of code coverage at your shop? Does it mean testing every line of execution?
Re:Most Unit Testing Is Waste (2014) [pdf] by jondubois on Saturday October 08, 2016 @05:48PM (#12668884)
Good point.

I hate it when people write tests to cover every single function (to cover every line of code) but they pay almost no attention to the range of inputs/arguments passed to those functions.

I think that most bugs in production can be traced back to "An unexpected argument which was passed to a complicated function/method" - According to this, you should focus your testing efforts on methods/functions that have complicated logic and you should test them with a range of unusual arguments/inputs.

Writing tests for EVERY function/method using only obvious (common use-case) arguments is a waste of time.

Re:Most Unit Testing Is Waste (2014) [pdf] by exception_e on Saturday October 08, 2016 @01:53PM (#12667860)
He/she probably used a tool to capture the coverage %.
Re:Most Unit Testing Is Waste (2014) [pdf] by throwaway745234 on Saturday October 08, 2016 @02:03PM (#12667915)
That only rephrases the question to what definition the tool used.
Re:Most Unit Testing Is Waste (2014) [pdf] by _RPM on Saturday October 08, 2016 @02:05PM (#12667919)
This comment reminds me of a typical response from a politician to a pressing question.
Re:Most Unit Testing Is Waste (2014) [pdf] by exception_e on Sunday October 09, 2016 @10:02AM (#12671207)
Sorry for the very literal answer. I honestly thought you were interested in how the coverage was calculated.

As an aside, I've worked on projects where coverage wasn't used and the rule was to "test the important bits" and I've also been on projects where coverage had to be >= ~98%. I wonder if a middle-ground approach would be effective.