3

I have an assignment that consists of creating a method to detect the impact of changes in an application. Can anyone help me with some instructions? I don't know where to begin, and need someone to put me on the right track.

Amson
  • 74
  • 8

1 Answers1

0

For .NET platform, you can use the tool NDepend for detecting the impact of changes in a .NET application (Disclaimer: I am the lead developer of this tool).

NDepend provides the facility to write C# LINQ queries to query your code base, but also to query diff between 2 different versions of your code bases. Around 200 default LINQ queries (code rules) are provided and it is easy to write your own.

For example the default code rules below, list methods that became more complex between two versions:

// <Name>Avoid making complex methods even more complex (Source CC)</Name>
// To visualize changes in code, right-click a matched method and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

warnif count > 0 
from m in JustMyCode.Methods where
 !m.IsAbstract &&
  m.IsPresentInBothBuilds() &&
  m.CodeWasChanged()

let oldCC = m.OlderVersion().CyclomaticComplexity
where oldCC > 6 && m.CyclomaticComplexity > oldCC 

select new { m,
    oldCC ,
    newCC = m.CyclomaticComplexity ,
    oldLoc = m.OlderVersion().NbLinesOfCode,
    newLoc = m.NbLinesOfCode,
}

The result can be shown live in Visual Studio, or in HTML+js reports:

Diff complexity with NDepend

In the Rules groups Code Quality Regression and Code Diff Summary many others default code rules will help you list impact of diff/changes in terms of code quality, code structure and code maintainability. A 14 days full featured trial is available for download.

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92