DEV Community

Discussion on: Getting Started with Test Driven Development

 
danielfoxp2 profile image
danielfoxp2 • Edited

And before you come with the 3 rules by uncle bob with the word "unit tests" in it, take a look at this:

twitter.com/unclebobmartin/status/...

Some TDD tests aren’t small. Some TDD tests look more like integration or acceptance tests. There really aren’t any rules in that regard. So perhaps the best name of all is simply:TDD tests. Why? Because TDD tests are unique.

twitter.com/unclebobmartin/status/...

We use the term “unit” test to describe the tests we write while using TDD. But that name is unfortunate because it has no good definition. We don’t know what a unit really is.
The tests we write in TDD are written by programmers and for programmers.

twitter.com/unclebobmartin/status/...

DAO tests are unit tests.

twitter.com/unclebobmartin/status/...

There is no rule that says that unit tests can’t touch the database. Of course they can. One should be very careful, however, to avoid touching the database when the database is not relevant to the test.

Cheers.