Sunday, December 8, 2019

False Positives


When developers start working on a new feature, they sometimes hard-code things with the intention to replace this part later with dynamic values. Sometimes, these snippets are forgotten, and you are testing features that work with hard-coded results. Success messages aren't excluded from this practice.

Simply said, never trust any success messages. If the program claims it worked, the program may be wrong. The opposite is also true.

The term "false positives" has its roots in medical testing. A false positive is an error in which a test result improperly indicates presence of a disease (the result is positive), when - in reality - it is not present, while a false negative is an error in which a test result improperly indicates no presence of the disease when in reality it is present. 
 
Yet another example:
Automated tests in NUNIT are declared with the "[Test]" attribute and in other programming languages there are similar terms in use to mark as method as test-method such as @Test, or other.
Anyhow, if a developer forgets to add the attribute, nothing bad happens. The compiler doens't care about it. The developer may have invested a lot of time developing the test case and then simply forget about this attribute. What happens is, the test never fails, because it gets never executed. 


 

 


No comments:

Post a Comment