From the course: JavaScript: Test-Driven Development (ES6)

Unlock the full course today

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

Writing effective tests

Writing effective tests - JavaScript Tutorial

From the course: JavaScript: Test-Driven Development (ES6)

Start my 1-month free trial

Writing effective tests

- So I mentioned in a previous video, that it's possible to write both good and bad tests. And it's definitely worth looking at how to write good tests, since this can often make the difference between TDD being a fantastic addition to your work flow, or just a waste of time. In his article, "TDD the Right Way," blogger Eric Elliott defines a mnemonic that I personally have found to be very helpful to keep in mind when writing tests. The mnemonic he gives is RITE. R-I-T-E Good tests should be: Readable. Isolated. Thorough. And Explicit. Let's go through each of these to see how we can ensure that out tests are well-written. The first rule is that our tests must be readable. I mentioned in a previous video, that one of the key benefits of TDD is that tests provide developers working on a team with a nice concrete way of communicating what their intentions are, with a given piece of production code. For…

Contents