Scala Test-Driven Development
上QQ阅读APP看书,第一时间看更新

What is TDD?

TDD is the practice of writing your tests before writing any application code.

TDD is a practice that is most frequently and strongly advocated by Agile practitioners and theorists. It is one of the major pillars of the Agile methodology. There have been various studies over the years and many white papers published, which clearly state that the use of TDD has resulted in a more successful and robust application code.

TDD consists of the following iterative steps:

This process is also referred to as Red-Green-Refactor-Repeat.

TDD became more prevalent with the use of the Agile software development process, though it can be used as easily with any of the Agile development process's predecessors, such as Waterfall, Iterative, and so on.

At the height of the software revolution in the 1990s, it became evident that the draconian processes and practices developed mostly in the 1980s were slow, officious, likely to fail, and rigid. The Agile development process was created at the Snowbird ski resort in the Wasatch Mountains of Utah. Here, 17 industry thought-leaders met to discuss the problems of the development processes being used with the common goal of creating an adaptive development process that has people at its core rather than requirements. This resulted in the Agile manifesto:

Though TDD is not specifically mentioned in the Agile manifesto (http://agilemanifesto.org), it has become a standard methodology used with Agile. Saying this, you can still use Agile without using TDD.