Close

testing

How Long Should Unit Tests Take to Run?

This post was written for the NCrunch blog. You can find the original here. When you first start writing unit tests, all is well and the few tests run in a matter of seconds. After having written hundreds or thousands of tests, running them might take…long. Too long. But when is long too long? How […]

Read More

Why your test should fail first

I always try to convince other developers that writing your test first is not just about doing TDD the “correct” way (if there even is such a thing). That sounds a little fundamentalist. Rather, it’s about making sure your test is failing and failing for the right reason. Actually, this is only one reason, as […]

Read More

Reusing code in tests

When writing tests, you can often end up with tests that have (almost) the same setup. Certain input variables may change, but the structure of the setup code remains the same. When the setup is small, you can copy from one test to another. But when there is more ceremony involved, you will start to […]

Read More

Convincing people of TDD

Those who know me, know I’m a big proponent of unit testing. I try to write my tests first, but I don’t believe in absolutes. If you write your tests afterwards, at least you’re testing. But not everyone is even convinced of the value of automated tests (be it unit, integration, end-to-end). Frequently, this discussion […]

Read More