From the course: Agile Software Development: Clean Coding Practices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

DRY vs. WET tests

DRY vs. WET tests

From the course: Agile Software Development: Clean Coding Practices

Start my 1-month free trial

DRY vs. WET tests

- [Instructor] Don't repeat yourself is a phrase that you will often hear software developers use when they are encouraging that others write code which minimizes duplication. The phrase is often written as just a DRY and pronounced dry. When writing your test code, it's possible to take DRY so far that you've created a test that's very hard to understand. Many developers use the term wet tests to advocate for allowing some repetition in your test suite. This debate has created some confusion for developers who are new to testing and can result in complete avoidance of DRY techniques for test code. But test code with excess repetition is equally hard to maintain and understand as production code is. So let's look at a couple of concrete examples where it is a good idea to clean up your test suite using DRY techniques. It's common when writing unit tests to encounter a single method which needs a large number of possible…

Contents