Test Driven Development

June 13, 2007 · 1 minute read

It can take a little while to understand the concepts and how to implement TDD, but once you do, it generally makes your software development process more robust and helps to minimise “bad” code.

In common usage, the term TDD refers to the process of writing unit tests before you start writing your actual code.

The idea being that by defining a test, you define your expectations as to what the code should do, then write just enough code to make the test pass.

Once you have a passing test, you refactor your code as necessary, check that your test still passes, fix your code if not.

This process is commonly referred to as “Red Green Refactor”.

There are many TDD tools and resources out there on the Web, a popular unit testing framework is NUnit.

As an aside, if you’re struggling with the general principles of “agile” development (which I will discuss in a later blog post), The TDD “Black Belt” Path (a useful checklist of “principles to get your head round”) can be found on TDD The Agileer (Doug’s Blog).

There’s a lot more to Agile software development than TDD and Doug’s list, but these are good starting points.

Join the Practical ASP.NET Newsletter

Ship better Blazor apps, faster. One practical tip every Tuesday.

I respect your email privacy. Unsubscribe with one click.