DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Maintenance
  4. Exploring the Technical Debt In Your Codebase

Exploring the Technical Debt In Your Codebase

In this post, we take a look at a tool that can allow you to easily manage your technical debt from your codebase, and even gives feedback on how well you're doing.

Erik Dietrich user avatar by
Erik Dietrich
CORE ·
Mar. 06, 17 · Tutorial
Like (5)
Save
Tweet
Share
7.23K Views

Join the DZone community and get the full member experience.

Join For Free

Recently, I posted about how the new version of NDepend lets you compute tech debt. In that post, I learned that I had earned a “B” out of the box. With 40 minutes of time investment, I could make that an “A.” Not too shabby!

In that same post, I also talked about the various settings in and around “debt settings.” With debt settings, you can change units of debt (time, money), thresholds, and assumptions of working capacity. For folks at the intersection of tech and business, this provides an invaluable way to communicate with the business.

But I really just scratched the surface with that mention. You’re probably wondering what this looks like in more detail. How does this interact with the NDepend features you already know and love?

Well, today, I’d like to take a look at just that.

To start, let’s look at the queries and rules explorer in some detail.

Introducing Quality Gates

Take a look at this screenshot, and you’ll notice some renamed entries, some new entries, and some familiar ones.

In the past, “Code Smells” and “Code Regressions” had the names “Code Quality” and “Code Quality Regression,” respectively. With that resolved, the true newcomers sit on top: Quality Gates and Hot Spots. Let’s talk about quality gates.

Many of these concern the evolution of the codebase with time. And not all of them directly address tech debt, though many do. You’ll need to explore yourself, but I’ll talk about some of these and how they weave into your experience.

First, understand the idea of a “quality gate.” Quality gates say, “if this fails, your build should fail.” Thus, you might reason about familiar concepts like code coverage by saying, “if coverage drops below 70%, fail the build.”

You can now do this in ways explicitly involving tech debt. For example, consider “blocker issues.” You want to fail when blocker issues crop up. These can occur as a result of you explicitly labeling them as blockers (e.g. “class bigger than 10,000 lines should fail the build”), but they can also now occur implicitly as a result of accrued tech debt.

To get a little more immediately concrete, we have “percentage debt,” as shown above for ChessTDD. This metric results from computations of how long the codebase took to develop and how much debt exists. Out of the box, if tech debt accounts for more than 20% of total development time, a warning occurs. You could easily make this an error.

Some of the rules below “percentage debt” also involve debt directly in quality gates, generally in self-describing ways.

Hot Spots

Next up, consider the new hot spots category. Here you can see a screenshot of that, with my Chess TDD codebase thankfully not triggering any warnings or failures.

Unlike the previous query group, this one concerns itself exclusively with tech debt. Here, you can really navigate your codebase in terms of technical debt. “Types hot spots,” for example, sorts the debt-heavy types in your codebase by the amount of tech debt computed for that type. Thus, you can use this as a quick, “where do I have the most debt” check.

The next two prioritize fixes and sort according to two different concerns: debt per type, and debt per code issue. And following that, you have a code query that I’ll show in more detail. Here’s the “Debt and Issues per Rule” query for my Chess TDD codebase.

Out of the box, it calls out the issues detected in the codebase and it sorts them by the quantity of tech debt. For example, I have many classes that could become structures and even more method names that are too long (the latter because I give unit tests very long names, and this analysis includes the test projects). But the sort places classes to become structures first because NDepend (understandably) computes that this will take longer to fix than shortening method names.

From here, I can see a nice snapshot of the tech debt in my codebase. What I have here is every issue that NDepend calls out, and the amount of tech debt it generates. Pretty powerful, huh?

Turning Off Rules

Now, you might find yourself wondering, “what if I don’t want a particular rule — will the tech debt show up everywhere for it?” Nope. NDepend has enough smarts that you can turn an issue off and have that reflected in all calculations.

For example, recall my explanation about long test names creating an outsize number of warnings for “avoid methods with name too long.” Let’s say that I consider this noise and want to turn it off. To do that, I go under the “naming conventions” group and uncheck “Avoid methods with name too long.”

With that turned off, I run an analysis and open the “debt and issues per rule” query again. I see the following:

No more “avoid methods with name too long” in the debt computation. Oh, and while I’m checking the effects of that, take a look at my new debt grade.

My selection and deselection of rules affect this as well. You’ll find, in general, that your rule settings weave in pretty seamlessly with the debt computations. And, while I don’t advocate turning off rules to give yourself an A, it does provide a nice demonstration of how you can customize your settings to reflect what you prefer to see in the codebase.

The Value of This Integration

I’ll offer a sneak peek of something I intend to cover later. NDepend implements this functionality with a robust new part of its API and CQLinq oriented around issues and debt. In other words, the debt features are not a bolt-on but a first class, core part of the offering.

This counts for a lot, in my opinion. Now, instead of reasoning about things like “number of violations” and “severity” you can start to reason in units of time and currency throughout NDepend. So, sitting at your desk with a project manager, you can start to point out that certain projects or modules carry problems and create risk.

But I’d say the value goes well deeper than what you might communicate to some manager. It starts you thinking about properties of the codebase in terms of time and money. And, as much as we all enjoy the language of technocracy and the programming feedback loop, thinking in economic, business terms makes us better at doing our jobs.

tech debt

Published at DZone with permission of , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Stateful Stream Processing With Memphis and Apache Iceberg
  • 20 Concepts You Should Know About Artificial Intelligence, Big Data, and Data Science
  • 5 Steps for Getting Started in Deep Learning
  • Fixing Bottlenecks in Your Microservices App Flows

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: