I just want to quickly point out a tool that I?ve been playing with for a couple of days now, named AutoTest.NET. Its an open-source tool that originates from a popular tool in the Ruby community called ZenTest, which basically runs all your valuable unit tests when you save your source files or when you build your code. It enables you to get feedback about your changes as soon as possible.
The project started out a couple of years ago on Google code and was first initiated by James Avery. Contribution stopped at some point until recently where Svein Arne Ackenhausen forked the source code and put it on GitHub. Now it runs both for .NET as well as Mono, with NUnit, MSTest and xUnit as the currently supported unit test frameworks.
Here?s a screenshot from the feedback window when all tests pass:
And here you can see the same window after I broke one of my unit tests:
Here you can see which particular unit test has been broken and by clicking the specified link you end up at the right source file in Visual Studio.
I encourage you to pick up this small tool and learn how it can facilitate your TDD flow. Take a look at this page in order to get up-and-running in no time. Also don?t forget to provide the owner(s) of this project with some feedback that you might have. Svein has been very helpful over the last week answering all my stupid questions and remarks (and the Nobel price for this year?s most patient person goes to ? 😉 ).
I would definitely like to see this tool becoming more popular, so go check it out.
Same behavior is possible with Gallio Icarus right? (by setting autoreload test dlls to true)
@Ivo Grootjes
I don’t know, actually. I haven’t looked into Gallio (yet).
I was looking for such a tool a while ago. But since discovered how cool Gated Check-ins are in TFS2010. Although for non-TFS dev this looks perfect.
The stock-standard NUnit GUI provides some of this: it will watch an assembly and automatically run selected unit tests when the assembly changes (is rebuilt).
Is there anything in the .Net world that will look at coverage and run only the tests that execercise changed code?
On a big project with thousands of tests that may take 10-15 minutes to run, having a quick way to find just the affected tests as you develop would be handy – it’s a headache when non-obviously dependent tests fail and break the build.
@andyclap TFS Team Build 2010 has a feature that allows very determination of what tests are affected by a code change, don’t know specifics though as we haven’t rolled it out yet (coming next month), but have seen some external and in-house demos that makes it look very nice. I’d be interested in an open source solution to this though, for things I do outside of work.
@andyclap
Look out for a new tool called Mighty Moose from Svein Arne Ackenhausen and Greg Young. It’s built on top of autotest.net and tries to run only the relevant tests for your change. It also integrates nicely with VS 2008 and VS 2010.
And dont forget to go vote for http://xunit.codeplex.com/workitem/8832 if you’re using xunit.net and want all this stuff to Just Work