News for hackers. Stuff that matters.
Re:The tragedy of 100% code coverage (2016) by jameshart on Tuesday May 09, 2017 @08:35AM (#14299438)
One answer to that is to apply property based testing. If you're testing an addition algorithm, for example, you might test that

   A + B == B + A
   A + 0 == A
   (A + B) + C == A + (B + C)
   A + B != A + C (given B != C)
Re:The tragedy of 100% code coverage (2016) by slavik81 on Tuesday May 09, 2017 @11:55AM (#14301080)
It's a good idea in principle, though your third and fourth properties are not true of floating point addition.

When you have one available, testing against the results against a reference implementation is a little more direct. Though, given how easy those property tests are, you might as well do both.