O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

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

Prefer Minimal, Fresh, Transient Fixtures

In xUnit Test Patterns, Meszaros [xTP] established a vocabulary for talking about tests. In particular, his terminology around fixtures clarifies and isolates a number of separable issues. This principle significantly leverages his terminology.

Fixtures establish the context for your test. They are the setup necessary to run your test. They construct, mock, dummy, inject, etc. the components necessary to run your test in as fast and isolated a way as possible.

Minimal fixtures are as large as necessary and no larger. Every fixture by necessity has elements that couple it to implementation. Although it is great to test by contract, you are testing real software with real implementation decisions. The ...

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