O'Reilly logo

Testing with F# by Mikael Lundin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Test Smells

A code smell is a symptom in the code that possibly indicates a deeper problem. It's where we look and think that there must be a better way of doing this. Tests also smell but they smell when they are run. There are different kinds of test smells and I will use the following method on these smells:

  • What is it?
  • How did it come to be?
  • What to do about it?

After reading this chapter, you will be able to identify test smells at an early stage and fight them in order to keep a good and healthy test suite.

Tests that break upon refactoring

One very common test smell when dealing with unit tests is that your tests break when you refactor, even though the functionality stays the same. These kinds of tests are called brittle tests.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required