Audit Legacy Code

Many .NET consultants worldwide are using NDepend to both save time and perform better audit of their client's code. Once you are acquainted with NDepend various features, assessing the health of a legacy code base and starting to provide valuable advices is a matter of minutes.

The dashboard provides a SQALE Technical-Debt rate, here it is D. NDepend estimates that it took 50 human-days to develop this code base. And to fix all issues the tool estimates it would take 11 human-days. Hence this code base contains more than 20% of technical-debt (11 days / 50 days). This 20%+ value leads to a D rating.

The NDepend Dashboard is the Perfect Way to Get Started with Auditing a .NET Legacy Code Base

By clicking the 479 issues label on the Dashboard with Group issues by rules we immediately see which rules generate most of the technical-debt.

See Which Rules is Responsible for Most of the Debt

Here the code base is poorly covered by tests (32.67%) and NDepend estimates that it would take almost 8 human-days (7 days + 7 hours) to write tests to cover it all.

This is not surprising that 72% of the technical debt (8 days on a total of 11 days) comes from poorly covered code. Originally the technical-debt metaphor concerned only untested code and then other kind of code-smells added up.

We received good feedback from the community about the accuracy of these technical-debt cost estimations. If needed the estimations can easily be adjusted to each situation. These estimations can help the management to take rational decisions based on facts to improve the code base.

The Metric view lines of code vs. code coverage immediately shows which class is well covered or not:

NDepend Metric View Showing Lines of Code vs. Code Coverage

Several other use cases are related to auditing a .NET code base.

Hopefully at this point you are curious to start auditing your .NET code.