3 ms·
This is a neat article. I do have comments about testing in general though. IME most developer do not understand each test has four possible outcomes: * Code
by nanis 5y ago
This is a neat article. I do have comments about testing in general though.
IME most developer do not understand each test has four possible outcomes:
* Code is good and test passes
* Code is bad and test fails
These are the only two possible outcomes developers focus on: When I ask what they should do if a test that used to pass now fails, they always tell me stories about how to debug the code under test.
There are two additional possibilities in test:
* Code is bad yet test passes (false negative)
* Code is good yet test fails (false positive)
Again, IME, most people do not look at the test again once it passes for the first time.
As a result, tests which are themselves code, become the largest untested part of the code base. You get these thousands and thousands of lines of untested code yet you have 100% code coverage.
Some of my blog posts on testing:
* Deception in tests considered harmful
https://www.nu42.com/2017/02/deception-in-tests-harmful.html https://www.nu42.com/2017/02/deception-in-tests-harmful.html
* Know what you are testing: The case of the test for median in Boost.Accumulators C++ Library <https://www.nu42.com/2016/12/cpp-boost-median-test.html https://www.nu42.com/2016/12/cpp-boost-median-test.html>
* Who is testing the tests?
https://www.nu42.com/2015/05/who-is-testing-the-tests.html https://www.nu42.com/2015/05/who-is-testing-the-tests.html
* Slashing one's feet with tests, or, how to fix 2,950 test failures in one fell swoop
https://www.nu42.com/2015/08/fix-2950-test-failures.html https://www.nu42.com/2015/08/fix-2950-test-failures.html