Source Code Commit Reversion Detection for Accurate Metrics

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Static analysis of software source code struggles to accurately measure development effort due to inclusion of erroneous and reversed file operations, leading to noisy and misleading metrics.

Innovation Solution

A static analysis system that excludes partial and full reversions from source code metrics by analyzing file activity logs and generating metrics based on unreverted files, using a static analysis system with an analysis engine, metric engine, and file activity engine to identify and discount additions and deletions that do not represent lasting changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If all file operations are included in source code metrics, then the completeness of metrics is improved, but the accuracy and reliability of metrics deteriorates due to inclusion of erroneous and reversed operations

Engineering Contradiction:
Improveaccuracy of source code metricsVSAvoidcompleteness of metrics data
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent extracts and removes reversion operations from the set of all file operations before computing metrics. The system identifies operations where a file is added and then deleted, or deleted and then added, within a specified time window, and excludes these from the final metrics calculation. This extraction of harmful elements resolves the contradiction by maintaining completeness of legitimate operations while removing erroneous reversions.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces an intermediary processing layer between raw file operation logs and final metrics computation. This intermediary layer analyzes operation sequences, identifies reversions through pattern matching (add-delete or delete-add pairs), and filters them out before metrics are calculated. This mediator resolves the contradiction by selectively processing operations to maintain accuracy without losing legitimate data.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If reversion detection and filtering is implemented, then the reliability of metrics is improved, but the complexity of the analysis system increases

Engineering Contradiction:
Improvetrustworthiness of source code metricsVSAvoidcomplexity of static analysis system
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the metric computation process into distinct modules: raw data collection, reversion detection, filtering, and final metrics calculation. The reversion detection itself is segmented into identifying add operations, identifying delete operations, and matching them as reversal pairs. This segmentation resolves the contradiction by organizing complexity into manageable, independent components that can be maintained and understood separately.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs reversion detection and filtering as a preliminary action before final metrics computation. By pre-identifying and marking reversion operations for exclusion, the system avoids the need for complex conditional logic during the actual metrics calculation phase. This preliminary processing resolves the contradiction by front-loading the complexity into a separate preparation stage.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If partial reversions with intervening modifications are handled, then the precision of metrics is improved, but the difficulty of detecting and measuring increases

Engineering Contradiction:
Improveprecision of development effort measurementVSAvoiddifficulty of identifying partial reversions
Core Design Contradiction:
Measurement precisionVSDifficulty of detecting and measuring

Solution Approach 1:

The patent implements a dynamic approach to reversion detection that adapts to different scenarios. The system can detect simple reversions (direct add-delete pairs), partial reversions (with intervening modifications), and can be configured with adjustable time windows. This dynamic detection strategy resolves the contradiction by providing flexible measurement capabilities that handle increasing complexity of reversion patterns while maintaining precision.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent performs preliminary analysis to establish the baseline state of files before detecting reversions. By pre-processing the operation log to identify and mark intervening modifications, the system simplifies the subsequent detection of partial reversions. This preliminary action resolves the contradiction by preparing the data structure in advance, making the detection of complex patterns more straightforward.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10963244B2Commit reversion detection
Publication Date: 2021.03.30 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10963244B2 patent drawing
  • US10963244B2 patent drawing
  • US10963244B2 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for discounting source code contributions occurring in reverted commits. One of the methods includes identifying, in a time-ordered sequence of commits, one or more matching sequences of additions and deletions of the files which have the same file path, comprising. A value for a contribution metric is computed for a responsible developer entity including discounting portions of the metric resulting from additions and deletions in any of the identified matching sequence of additions and deletions for the files having the same file path.