Book Image

Testing with F#

By : Mikael Lundin
Book Image

Testing with F#

By: Mikael Lundin

Overview of this book

Table of Contents (17 chapters)
Testing with F#
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Tests that never break


Another common smell is tests that never break, no matter how much you break the feature. This is quite common to see in unit tests where tests are written after the system under test. The test itself is there to cover some part of the code to bring the coverage up, but it is disconnected from the feature that it is actually covering.

What is common for all these tests is that there is a bug in the test that makes it pass even when the result is wrong. Writing bugs in tests is quite common and should never be underestimated. Another common reason is that the test has been badly named and is not actually asserting the thing it is named after. This will result in green, passing tests when the thing the test was supposed to verify is actually failing.

This is the test that you will find when looking for a bug. The test will claim to cover for the bug you've found, but the test will pass, even though the problem obviously is there. In the end, you will find that the test...