by thorhalvor

NCrunch = time saved

NCrunch is an automated continuous testing tool for Visual Studio .NET. It takes responsibility for running automated tests so that you don’t have to.

Instead of going through these steps when doing Test Driven Development:

  1. Write tests
  2. Run tests
  3. Write code
  4. Run tests
  5. Refactor code
  6. Run tests

NCrunch will take care of all the “Run tests” and you can therefore concentrate on writing and refactoring your tests and code.

How does it work?

I will give some simple examples below but you can also go to NCrunch’s About-page where you can see a video.

First of all, will you get new column with red/green/black dots on every line of code.

Green = Covered by successfull test
Red =  Covered by test but failing
Black  = indicating that there are no tests for this line of code.

It will test while you write and you get feedback while coding. No need to compile or save the document.

A specific example of the most basic steps is shown below:

A: You see a green dot for every line of code. That means at least one test is testing these lines and it is also successful.
B: If I hold the mouse over the dot at line 45 I can see that there are 4 passings tests for this part of code.
C: If I comment line 43-46, the color of the dots will immediately change because some tests are now failing. And some code is untested.
D: Holding the mouse over the red dot at line 42 gives a summary of why it is red. This part of code is covered by 3 passing tests and 1 failing.

This was only the basics of NCrunch. Other things it can do is for example: Code Coveage, Performance metrics, Inline Exception Details, Paralell Execution ++

My advice is therefore: Download, Install and Enable it. Try to not focus on it in the beginning, just “let it do its job”, get familiar with the new “dots” and explore its features step by step.