Provenance-Based Software Code Reuse via Clustering

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software development teams face inefficiencies in reusing software code due to the time-consuming and error-prone process of manually searching and adapting similar code fragments across multiple scripts, leading to redundant development and reduced readability.

Innovation Solution

A provenance-based method that extracts and encapsulates similar source code fragments, creating reusable code fragments through pairwise comparison and clustering, stored in a searchable database with provenance data, annotations, and asset management, facilitating efficient reuse during new script development.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If developers manually search and adapt similar code fragments across multiple scripts, then code can be reused, but the process is time-consuming and error-prone

Engineering Contradiction:
Improvecode reuse efficiencyVSAvoidtime for searching and adapting code
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by automatically extracting, comparing, and clustering code fragments before they are needed for reuse. The code similarity analysis and clustering are performed in advance, creating a ready-to-use repository of reusable code fragments that developers can access without manual searching.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates copies of code fragments through automatic identification and encapsulation. Instead of manual copying and adapting, the system automatically identifies similar code fragments across multiple scripts, encapsulates them as reusable units, and stores them in a repository for efficient retrieval and reuse.

Inventive Principle:
Principle #26Copying

2Productivity

If developers manually adapt code fragments to new requirements, then code can be reused, but the process becomes error-prone

Engineering Contradiction:
Improvecode reuse efficiencyVSAvoidaccuracy of code adaptation
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs self-service by automatically identifying similar code fragments, comparing them, and encapsulating reusable units without human intervention. The automated code similarity analysis and clustering algorithms handle the entire process, eliminating manual errors and ensuring consistent, reliable code reuse.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system replaces the mechanical manual process of searching and adapting code with an automated computational system. The mechanical actions of manual code comparison and adaptation are substituted with algorithmic code similarity analysis and automatic clustering, improving both efficiency and reliability.

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

3Adaptability or versatility

If similar code fragments are scattered across multiple scripts, then code can be accessed, but readability and maintainability decrease

Engineering Contradiction:
Improvecode accessibilityVSAvoidcode readability
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The system segments code into discrete, identifiable fragments through automatic extraction. By dividing the codebase into reusable fragments and organizing them through clustering, the system improves readability while maintaining accessibility. Each fragment is encapsulated as a distinct reusable unit with clear boundaries and metadata.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system merges scattered similar code fragments into unified reusable units through clustering. Code fragments that are similar in functionality and structure are combined into single encapsulated units, reducing duplication and improving readability while maintaining the ability to access and reuse the code across multiple scripts.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS11474817B2Provenance-based reuse of software code
Publication Date: 2022.10.18 EMC IP HLDG CO LLC
  • US11474817B2 patent drawing
  • US11474817B2 patent drawing
  • US11474817B2 patent drawing

AI summary

Techniques are provided for provenance-based software script reuse. One method comprises extracting provenance data from source code including, for example, source code fragments, wherein the extracted provenance data indicates a control flow and a data flow of the source code; encapsulating source code fragments from the source code that satisfy one or more similarity criteria as a reusable source code fragment; and providing a repository of encapsulated reusable source code fragments for reuse during a development of new software scripts. The repository of encapsulated reusable source code fragments optionally comprises a searchable database further including, for example, the provenance data, data annotations, input parameters and generated results for the corresponding source code fragment.