Eradicating Non-Determinism in Tests

Eradicating Non-Determinism in Tests

Publication Date: April 14, 2011

Format: ebook

Author: Martin Fowler

0.00 of 0

Click the button below to register a free account and download the file


Download PDF

Download ePub

*Disclosure:“This post may contain affiliate links and I earn from qualifying purchases”.


An automated regression suite can play a vital role on a software project, valuable both for reducing defects in production and essential for evolutionary design. In talking with development teams I've often heard about the problem of non-deterministic tests—tests that sometimes pass and sometimes fail. Left uncontrolled, non-deterministic tests can completely destroy the value of an automated regression suite. In this article I outline how to deal with non-deterministic tests. Initially quarantine helps to reduce their damage to other tests, but you still have to fix them soon. Therefore I discuss treatments for the common causes for non-determinism: lack of isolation, asynchronous behavior, remote services, time, and resource leaks.