Introducing Test-Driven Development

Test-Driven Development (also known as TDD or Test-Driven Design) is a programming approach in which developers create applications by first writing unit tests and then writing the actual code after the unit test passes. This particular approach helps writing better code, because you ensure that it will work via unit tests, but it is also a life philosophy so that you need to have a change of mind when approaching TDD. Basically TDD is structured into three main moments:

Red: The developer generates a new unit test from scratch, so that it will typically fail. This is the reason why it’s called Red.

Green: The developer focuses on writing code that makes the unit test work and pass. As you saw in the ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.