MVC Team Should Rule

Headline: I don’t think I’ve seen a team more focused on testability at Microsoft than the ASP.NET MVC (Model-View-Controller) team. I sure hope their unit testing philosophy starts to influence other teams more.

Entity Framework

If you use any of the patterns for the Entity Framework (one of the early versions of .NET 4.0 that I started to use) you get lots of auto-generated code, but no unit testing of that auto-generated code. Having found some bugs in that code along with methods that were about 200 lines long I’m pretty certain that a Test Driven approach was not used.

Silverlight

I’ve just chronicled several frustrations in trying to get unit testing working well with Silverlight. While it is a step closer as some templates ask if you want a test project, they still don’t test very much. And as I just said, it is hard to get working in any serious (i.e., TFS (Team Foundation Server)) fashion.

MVC Team

I just ran an experiment. I created a new MVC (Model-View-Controller) project, took the default to add a Unit Test project. Then added a TestSettings1.testsettings file, turned on code coverage, and ran it without writing any other code, 46{f073afa9b3cad59b43edffc8236236232bb532d50165f68f2787a3c583ed137f} code coverage –out of the box! Having gone and covered much of the rest, it is quite hard to do without something like Moq when it comes to some of the membership areas. Experiment time was well under 2 min.

Go MVC Team!


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.