Time-Weighted Risk Score for Software Bug Prediction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The rapid increase in software complexity leads to a higher likelihood of undetected software bugs, which can cause disastrous results due to the time-consuming process of detection and the potential for bugs to go undetected during rigorous testing.

Innovation Solution

A classification-type machine learning model is developed to compute a risk score for source code files based on features such as time-weighted bug density, addition and deletion factors, and complexity factors, which are weighted to prioritize recent changes and dependency relationships within the code base, providing a probability of future software bugs and a rationale for the score.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If software complexity increases, then functionality and features improve, but the number of software bugs increases rapidly

Engineering Contradiction:
Improvesoftware functionalityVSAvoidsoftware bug rate
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The system performs preliminary analysis of source code files by computing risk scores before bugs are detected. It analyzes historical data, code complexity, and change patterns to predict which files are most likely to contain bugs, enabling preventive measures to be taken in advance rather than reacting after bugs are discovered.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent replaces manual, mechanical code review processes with an automated machine learning system. The system uses algorithms to analyze code features, historical bug patterns, and developer behavior to automatically identify high-risk files, substituting human inspection with computational analysis.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Reliability

If rigorous testing is performed, then software reliability improves, but time consumption for bug detection increases

Engineering Contradiction:
Improvesoftware qualityVSAvoidbug detection time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary identification of high-risk code files using machine learning models before actual testing begins. By predicting which files are most likely to contain bugs based on historical data and code characteristics, the system enables testers to focus on specific areas rather than reviewing entire codebases, significantly reducing detection time.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Instead of applying uniform testing to all code, the system identifies local areas of high risk within the codebase. It analyzes individual source code files for specific risk characteristics such as high change frequency, complex logic patterns, and historical bug patterns, directing testing resources only to files with elevated risk scores.

Inventive Principle:
Principle #3Local quality

3Measurement precision

If bug tracking and monitoring systems collect more information, then prediction accuracy improves, but system complexity increases

Engineering Contradiction:
Improvebug prediction accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system segments the codebase into individual source code files for analysis. Instead of treating the entire software system as one complex unit, it breaks down the analysis into file-level components, each with its own risk score calculation based on localized features such as change history, code complexity, and dependency patterns.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary machine learning model layer between raw code data and bug prediction outputs. This model processes and transforms complex code features into risk scores, acting as a mediator that simplifies the relationship between numerous code characteristics and bug likelihood without requiring direct complex analysis of all code interactions.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP3740873B1Time-weighted risky code prediction
Publication Date: 2023.11.01 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3740873B1 patent drawingFigure 1
  • EP3740873B1 patent drawingFigure 2
  • EP3740873B1 patent drawingFigure 3

AI summary

A classification machine learning model is trained to predict the likelihood that a software program is likely to have a software bug in the future. The model is based on features from different source code files having changes made to fix a software bug and source code files having changes that were not made for a bug fix. The features include a time-weighted bug density, a time-weighted addition factor, and a time-weighted deletion factor for a source code file and its dependent code, a page rank, and complexity features representing a number of different types of code elements in the source code file.