Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The CodeMRI® ROI Tool tool is a scenario analysis tool to help provide Return on Investment (ROI) information that can help determine the most cost-efficient way to refactor a codebase given a scenario , or set of scenarios, for a refactoring initiative. It can be used to help determine what may be the most cost efficient way to refactor a code base. For the ROI tool, the different scenarios available are:

  1. Reduce code complexity by reducing the McCabe Complexity score.

  2. Reduce technical health complexity by reducing the size of any Cores.

  3. Both reduce code and technical health complexity.

Initial Set-up

In order to create the scenario analysis, two pieces of information are needed to calculate the Return on Investment information: the Preferences and the Scenarios.

...

First, a set of Preferences should be filled in. The different Preference options are:

  • Cost per developer - The average annual cost of developers working in the scanned codebase: sum of developer cost / total developers.

  • Estimated total cost - The estimated total cost of a refactoring initiative.

  • Yearly code turnover - The feature lines of code modified or added in a year divided by total lines of code.

  • Downstream cost per bug LOC - The Average or expected monetary impact per defect (typical and bad) shipped in the product.

  • Interest rate for capitalization - The interest rate used in technical debt calculations. Using yearly interest payments and interest rate, Silverthread computes technical debt in the codebase.

  • Years to capitalize - The length of time (years) over which to calculate the return on investment of the proposed refactoring initiative.

The default Silverthread values are filled in, however, this may differ for each organization. These values should be updated to properly tune results to your organization.

In Excel, this is done on the Preferences tab, and has the Silverthread default values filled in.

...

Figure 1. The Preferences tab of the Excel Return on Investment (ROI) report.

...

The Refactoring Initiative section provides the ability to do one or more scenarios, and each scenario is a row of four sections that need to be filled out: Area, Name, Target Code Quality, Target Design Quality. The target code and design quality values are what the goals are for the end state of the scenario analysis.

Please note that if more than one scenario is filled in, then the scenarios are evaluated together.

Excel allows for five scenarios, the Web does not have a limit. All five scenarios do not need to be filled out in Excel, the options are just available. On the Web, please press the plus button at the end of the scenario row in order to add another scenario, if desired.

...

  • Overall System

    • This option will apply the scenario target code and design quality to every file in the code base.

  • Not in Core

    • This option will apply the scenario target code and design quality only to files that do not belong in a Core.

  • Component

    • This option will apply the scenario target code and design quality to only the files in the component specified in the Name section.

  • Core

    • This option will apply the scenario target code and design quality to only the files in the Core number specified in the Name section.

    • Note that this option is only for files inside a Critical or Emerging Core.

  • Directory (Excel only, coming soon to the Web)

    • This option will apply the scenario target code and design quality to all files under the directory chosen.

    • Note that this option requires a directory path to be filled in, and it must match the file structure as listed in the File List tab.

...

  • n/a

    • This option chooses not to change the code quality for the scenario.

  • Low (McCabe 50+)

    • This option says that a low refactoring initiative effort should be done regarding code quality.This option says that we need all files at a McCabe score of 50 or below. In other words, there should be no files with a Very High Complexityspecifies that all of the files will have a McCabe Cyclomatic Complexity of at most 50 after refactoring is complete. This requires a minimal effort of code quality improvement, and will only yield decent improvement in overall defect density for codebases with extreme quality challenges.

  • Moderate (McCabe 20+)

    • This option says that a moderate refactoring effort should be done regarding code quality.This option says that we need all files at a McCabe score of 20 or below. In other words, all files must have a Low or Medium Complexityspecifies that all files will have a McCabe Cyclomatic Complexity of at most 20 after refactoring is complete. This requires a moderate effort of code quality improvement, and should yield significant improvements in overall defect density for codebases with severe code quality challenges.

  • High (McCabe 5+)

    • This option says that a high refactoring effort should be done regarding code quality.This option says that we need all files at a McCabe score specifies that all files will have a McCabe Cyclomatic complexity of 5 or below . In other words, all files must have a Low Complexitywhen refactoring is complete. This is the highest level of effort for refactoring code quality, and should yield vast improvements in overall defect density for codebases with code quality challenges.

Target Design Quality

The target design quality field defines what level of Core reduction is desired for the Area/Name combination. The following options are available:

  • n/a

    • This option chooses not to change the Core sizes for the scenario.

  • Low (20% Core Removed)

    • This option says that a low refactoring initiative effort should be done regarding Core reduction.Means specifies that the number of files in this Area/Name combination that are part of a Core should be reduced by 20%. This requires a minimal effort of code quality improvement, and will only yield decent improvement in overall defect density for codebases with extreme quality challenges.

  • Moderate (60% Core Removed)

    • This option says that a moderate refactoring initiative effort should be done regarding Core reduction.Means specifies that the number of files in this Area/Name combination that are part of a Core should be reduced by 60%. This requires a moderate effort of code quality improvement, and should yield significant improvements in overall defect density for codebases with severe code quality challenges.

  • High (100% Core Removed)

    • This option says that a high refactoring initiative effort should be done regarding Core reduction.Means specifies that the number of files in this Area/Name combination that are part of a Core should be reduced by 100%, meaning all Emerging and Critical Cores will be completely removed.. This is the highest level of effort for refactoring code quality, and should yield vast improvements in overall defect density for codebases with code quality challenges.

Note that the ROI tool does not say how to reduce the size of a core. For one possibility on doing so, please see the Technical Health Improvement Plan, which is also described in the CodeMRI® Care User’s Guide, https://silverthread.atlassian.net/wiki/spaces/CKB/pages/961773820/CodeMRI+Care+User+s+Guide#CodeMRI%C2%AECareUser%27sGuide-ImprovingTechnicalHealth .

...