Test driven development (TDD) has been around, as a concept at least, for nearly 15 years. However, it’s still gaining acceptance with some developers and industries.
Here’s the basics:
This implies TDD’s golden rule: Never write new features unless you have a failing test.
The first step allows you to think about your design activity upfront; this is great because you will often uncover edge cases which would otherwise have been missed. The second step makes you think about what you are going to do on a low level, and leaves a guard in place to stop you breaking things in the future. Finally, the third step lets you know when you’ve done enough to make your application work.
TDD is often seen as the holy grail of good development practices. However, in the real world, developers will still implement new features before writing the corresponding failing tests. Of course it’s always possible to go back and write the unit tests retrospectively. However, this can sometimes be tricky and doesn’t bring the full benefits of TDD.
One of the benefits of unit tests is that they can give you instant feedback about the quality of your code. For example, if you find it hard to write tests for a particular class, then it probably has one of the following problems:
But, don’t be put off! This information allows you to identify where you should refactor your code until you can cover all of it with unit tests. In my next post I’m going to walk through an example of TDD using MVC4 .NET and Entity Framework.
We work with our clients to de-risk and accelerate their business goals realisation. Our approach is based on tailoring our services to fit your needs leveraging our portfolio of strategy, execution, innovation and service delivery offerings to help you reach your objectives
We’re always on the lookout for exceptional talent and people who share our values. Even as we continue to grow, we maintain a family environment with respect and teamwork core to our culture.
Piotr Grześkowiak has been at Automation Logic for just over five years, starting out in our DevOps Academy after graduating in Computer Science with Information Security. During those 5 years, he’s gone from an engineer in training to a well respected senior engineer, trusted by the whole company. Piotr’s been on three Central Government client […]
We interviewed AL’s co-founders Kris & Norm about their journey building Automation Logic into the business it is over the last 12 years. From the values they’ve set in place, to the struggles they’ve faced. And obviously, because it’s pretty difficult not to mention it these days, the impact covid had.
A memoir of a Workload Migration engineer by Liam Rae-McLauchlan We’ve all read the blogs and articles about migrating to the Cloud and its benefits, but in practice it can be a daunting task. Maybe your organisation is planning to move to the cloud, or is already trying – up to 85% of enterprises are […]