Timeline for Is testable code better code?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 22, 2015 at 22:09 | audit | Low quality posts | |||
Jul 22, 2015 at 22:09 | |||||
Jul 2, 2015 at 21:06 | comment | added | Craig Tullis | ...but making a bureaucracy out of testing can be a total waste and not produce useful information or trustworthy results. Regardless; I sure wish somebody had tested the SSL Heartbleed bug, yeah? or the Apple goto fail bug? | |
Jul 2, 2015 at 21:04 | comment | added | Craig Tullis | @wobbily_col Well, consider the transitive property in math. If a=b, and b=c, then a=c. If your test is well thought-out and reflects the actual requirements of the unit being tested, then it's fair to say that the test has value that translates to the intended real use of the code. If the test was schlepped together just for the sake of cranking up the test count, then it's kind of pointless and probably creates more noise than signal. Tests have to be written and exercised. Even if they're tests that are performed manually by humans. Anything less just isn't professional, IMO. | |
Jul 2, 2015 at 20:51 | comment | added | Craig Tullis | @anaximander Exactly. There is at least the possibility that the mere presence of tests is a contraindication which results in poorer quality code if all the focus is just on checking the checkboxes. "At least seven unit test for each function?" "Check." But I really do believe that if the code is quality code, it is going to be easier to test. | |
Jul 2, 2015 at 11:26 | comment | added | wobbily_col | All testing proves is that the code passes the tests. Otherwise unit tested code would be bug free and we know that isn't the case. | |
Jul 2, 2015 at 10:39 | comment | added | pjc50 | Exactly. Consider the contrapositive. If it's untestable code, it's not tested. If it's not tested, how do you know whether it works or not other than in a live situation? | |
Jul 2, 2015 at 10:30 | comment | added | anaximander | "better code tends to also be testable code" This is the key. Making it testable does not make it better. Making it better often makes it testable, and the tests often give you information you can use to make it better, but the mere presence of tests does not imply quality, and there are (rare) exceptions. | |
Jul 2, 2015 at 2:24 | history | edited | Craig Tullis | CC BY-SA 3.0 |
added 1433 characters in body
|
Jul 2, 2015 at 2:11 | history | answered | Craig Tullis | CC BY-SA 3.0 |