SWIFT: The Five Qualities of Valuable Tests

A valuable test saves time and effort over the long term, while a poor test costs time and effort. I’ve focused on five qualities that tend to make a test save time and effort. The absence of these qualities is often a sign that the test could be a problem in the future. I’ve even managed to turn them into an acronym that is only slightly contrived: SWIFT:

  • Straightforward
  • Well defined
  • Independent
  • Fast
  • Truthful

Let’s explore those in more detail.

Straightforward

A test is straightforward if its purpose is immediately understandable.

Straightforwardness in testing goes beyond just having clear code. A straightforward test is also clear about how it fits into the larger test suite. It should test something ...

Get Rails 5 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.