Skip to content
SciTools Blog
Menu
  • Home
  • Blog
  • Support
  • Contact
  • Login
  • Pricing
  • Free Trial
Menu

Scoping a Refactoring Effort for My Boss

Posted on August 21, 2023

TLDR

You’ve been asked to consider replacing 2 open source modules–here is how to use Understand’s Architectures and Dependency analysis to let your boss know how much effort/risk this will entail.

Refactored dependency graph.

Details

Let’s imagine my boss asked me to replace some open source packages that were inactive, might have security issues, and that could be replaced with newer actively-maintained projects.  Sound familiar?  Yes, I’m a boss, and I’ve asked for that very task more than once…

In my last example, I showed how to use Architectures to identify, measure, and track dependence on Open Source code. We are going to use a similar technique in this article to divide our code into what we will keep and what we will remove (refactor).

The projects in question are cmark and lpeg and libssh2.

I create a simple Architecture graph called Refactor, with “Keep” and “Refactor Out.”

Architecture graph called Refactor, with "Keep" and "Refactor Out."

I dragged all the source into “Keep” and then moved cmark, lpeg, and libssh2 into “Replace.”

Now I’m ready to see what the damage is…. I’ll make a graph of it by choosing “Graphs->Dependency Graphs -> Refactor, which yields this:

Refactored dependency graph.

And I’m pleased to report… Hey boss, we aren’t EVEN USING cmark and lpeg. We can take them out entirely.

We use functions from libssh2 42 times. I expand the graph and find that most of the uses are coming from the _other_ open source packages.

That’s a bit thorny. I’m not sure I want to muck around in their code…

Expanded dependency graph.

The code that uses it, that we did create, has just 7 uses. And, I can see exactly where they are in the Dependency Browser.

Using the Dependency Browser to see where the could we created is.

So I tell my boss, “Good news! It’s not that bad…in our code. Bad news–we’d have to mess around with open source code we don’t maintain to rip out libssh2.”

May the meetings begin!

Summary

  • Make an Architecture divided into Keep and Refactor
  • Use Dependency Graphs to visualize and measure the dependence on what we want to refactor.  This includes what parts of our remaining code will be touched. 
  • Use the Dependency Browser to visit all those uses when the time comes to do the work. 
  • Instagram
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Learn more about Understand's Features

  • Dependency Graph
    View Dependency Graphs
  • Comply with Standards
  • View Useful Metrics
  • Team Annotations
  • Browse Depenedencies
  • Edit and Refactor

Related

  • API
  • Architectures
  • Business
  • Code Comparison
  • Code Comprehension
  • Code Navigation
  • Code Visualization
  • Coding Standards
  • Dependencies
  • Developer Notes
  • DevOps
  • Getting Started
  • Legacy Code
  • Licensing
  • Metrics
  • Platform
  • Plugins
  • Power User Tips
  • Programming Practices
  • Uncategorized
  • Useful Scripts
  • User Stories
  • May 2025
  • January 2025
  • December 2024
  • November 2024
  • August 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • April 2023
  • January 2023
  • December 2022
  • November 2022
  • September 2022
  • August 2022
  • May 2022
  • April 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

©2025 SciTools Blog | Design: Newspaperly WordPress Theme