Code Branch Merge Simulation via Relationship Graph

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Merging software code branches can introduce errors due to unawareness of dependencies and similarities between branches, and traditional methods do not allow for selective merging of sub-sections, leading to tedious and error-prone processes.

Innovation Solution

A method that simulates the merge by identifying differences between code branches, generating a differences list, and building a relationship graph with nodes and edges representing dependencies and similarities, allowing users to selectively merge sub-sets of changes and filter unwanted changes before actual merging.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional code branch merging is performed without simulation, then the merging process is simple and fast, but errors are introduced due to unawareness of dependencies and similarities between branches

Engineering Contradiction:
Improvemerge accuracyVSAvoidmerge process complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent performs a simulation of the code branch merge before the actual merge operation. The simulation phase identifies differences between branches, builds a relationship graph showing dependencies and similarities, and allows users to review and select which changes to merge. This preliminary action prevents errors by making dependencies visible before the actual merge occurs.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a relationship graph as an intermediary representation between the code branches and the merge operation. The graph visually displays dependencies and similarities between code segments from different branches, serving as a mediator that helps users understand the implications of merging before actually merging the code.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If traditional code branch merging is performed, then the process is quick, but it is tedious and error-prone due to inability to selectively merge sub-sections

Engineering Contradiction:
Improveselective merging capabilityVSAvoidmerge evaluation time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The patent segments the code differences into discrete units represented as nodes in a relationship graph. Each node corresponds to a specific code segment or function, and edges represent dependencies between them. This segmentation allows users to selectively choose which segments to merge by selecting individual nodes or groups of nodes, rather than being forced to merge entire branches at once.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent enables partial merging by allowing users to select only the subset of code changes they want to merge, rather than requiring a complete merge of all differences between branches. Users can review the relationship graph and choose to merge only certain nodes (code segments) while excluding others, performing a partial merge action that is tailored to specific needs.

Inventive Principle:
Principle #16Partial or excessive action

3Loss of information

If code branches are merged without visualizing dependencies, then the process is straightforward, but errors occur due to unawareness of relationships between code segments

Engineering Contradiction:
Improvedependency information visibilityVSAvoidanalysis process complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent transforms the flat, linear view of code differences into a multi-dimensional relationship graph that displays dependencies and similarities as spatial relationships between nodes. The graph adds a visual dimension to the merge process, showing connections and relationships that would be difficult to perceive in a linear text-based diff view. This dimensional transformation makes hidden dependencies visible.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS10146530B1Simulating and evaluating code branch merge
Publication Date: 2018.12.04 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10146530B1 patent drawing
  • US10146530B1 patent drawing
  • US10146530B1 patent drawing

AI summary

One embodiment provides a method, including: receiving a request to merge at least one code branch with a first code branch, wherein the at least one code branch and the first code branch comprise different versions of software code; and simulating the merge via: identifying the differences between the at least one code branch and the first code branch; generating a differences list comprising a list of (i) added code snippets, (ii) deleted code snippets, and (iii) changed code snippets, wherein code snippets are clustered in the differences list by difference chunks comprising connected code snippets; and building a relationship graph comprising a plurality of nodes and a plurality of edges, wherein each of the plurality of nodes represent a difference chunk and wherein each of the plurality of edges comprise a relationship between two of the plurality of nodes; each of the plurality of edges comprise a cost vector.