O'Reilly logo

Real World .NET 4, C#, and Silverlight®: Indispensible Experiences from 15 MVPs by Daron Yöndem, Christian Weyer, Christian Nagel, Scott Millett, Jeremy Likness, Vishwas Lele, Jeffrey Juday, Caleb Jenkins, Kevin Grossnicklaus, Alex Golesh, David Giard, Gill Cleeren, György Balássy, Dominick Baier, Bill Evjen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15

Automated Unit Testing

by Caleb Jenkins

As a consultant, development mentor, and agile coach, I've worked with many dozens of organizations and hundreds of developers who have struggled through the realities of implementing automated unit tests. Most developers have at least heard of unit tests. They even believe that implementing automated tests would be a good idea and would make their code better, even if they're not sure exactly how or why — or rather, they're not fully convinced that the added time and complexity of writing tests can make their code better.

If you are a developer, you already know how to write code — you probably get paid for it — and won't tests just slow you down? Won't they give you more code to write and maintain? If you've ever struggled with these notions about writing tests, know that you're not alone! If you have these concerns now, you will probably be a better test writer in the long run.

This chapter lays the right foundation for your tests, and gives you the practical skills and tools to make unit testing a natural part of your coding activity.

UNDERSTANDING UNIT TESTS

At their core, unit tests are just code you write to test code that you wrote — or, better yet, code that you are going to write. With automated unit tests, you can run and rerun hundreds, or even thousands, of tests with the click of a single button, or have the test run automatically on the server whenever a developer checks in new code to source control.

Scope, LEGOs, and Connected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required