Introducing Test-Driven Development

Test-driven development (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 so as to make the unit test pass. This particular approach improves code writing because you ensure that it will work via unit tests, but it is also a life philosophy so that you need a change of mind when approaching TDD. TDD is structured into three main moments:

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

Green—The developer focuses on writing code ...

Get Visual Basic 2015 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.