Making unit tests your primary attention point

Publish date:

What if you get immediate feedback about your code quality, even while typing? What if you can immediately see if the performance of your code has improved with your latest change?

Test-driven development and behavior-driven development ensure that testing plays an important role in your software development. I really like the concepts that bridge the gap between software developers and non-technical roles (e.g., business analysts, functional designers, etc.) Using unit testing improves the quality of your delivery and can help you  keep your documentation up to date.

One other thing that has really got my attention in the last couple of years is live unit testing. Live unit testing is part of your Visual Studio Enterprise edition but if you don’t have that, NCrunch delivers the same thing. Even though I have a VS Enterprise license, I still bought the NCrunch license. It is quick, easy to set up, and efficiently delivers as per my requirements. For best performance, you need a heavy-duty machine – but all developers should have that anyway, right?

Live unit testing gives me insight into the results of my development work. This is especially true if I am refactoring a bit of code. If the original code is backed by proper unit tests, you will get immediate feedback on whether your refactoring works or not. I find it very comfortable to check the visual indicators in the margin of the editor for failing and succeeding unit tests. If the marker is green, I’m good to go. If it’s red, the code needs attention. The colors tell me everything


Unit tests also give you code performance metrics. The visual indicators indicate the success or failure of the unit test, but will also give the performance metrics. You will see immediately – even while typing – what the effect of your efforts are on the performance of your code.

For me, that is magic. Even before saving your code, the editor gives feedback about these metrics. It is very easy to try a different approach if a previous one didn’t give you the results you were looking for.

The big picture here is the evolution of the tools that we give our developers. Developers can be extremely productive and the tools to help them with that are readily available. One might need bigger and faster machines to make good use of them, but the proper tools are excellent value for money. A fast machine and, in this case, live unit testing make a much more productive developer. Investment in those tools is always a good idea.

Give Live unit testing a go. It really has changed my perspective on unit testing and helps in my day to day work.

Related Posts


Cybersecurity: Don’t trust anyone

Geert van der Linden
Date icon November 25, 2020

Zero-trust security isn’t a one-time measure, it’s a check that must be carried out again and...

Medical Devices

Remediation implications for medical device manufacturers in changing regulatory landscape

Date icon November 24, 2020

The life sciences sector is experiencing unprecedented regulatory change with the EU MDR. It...

cloud infrastructure services

Treat service provision like a developing brain – be reasonable

Amal Lad
Date icon November 23, 2020

Treat service like a child…and encourage it to talk back, so you get to learn too