Microservices Code Similarity Analysis for Risk Identification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In microservices architecture, managing and maintaining complex environments with hundreds of moving parts, coupled with the challenge of identifying and addressing risky code that is inefficient, error-prone, or causes application failures, is complicated by the lack of tools that account for code structure and duplication.

Innovation Solution

A system that identifies risky code in microservices by determining a similarity score between code segments across different microservices, using unified modeling language to generate a connected graph and a diff utility to recommend modifications made to similar code segments, thereby reducing engineering resources and improving customer experience.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If code duplication is avoided (DRY principle), then code quality improves, but coupling between microservices increases leading to distributed monolith

Engineering Contradiction:
Improvecode qualityVSAvoidcoupling between microservices
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the monolithic codebase into independent microservices, allowing each service to have its own code segments. This segmentation enables teams to work independently on different services without creating tight coupling, while still allowing selective code sharing when beneficial.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by allowing code duplication only in specific local contexts where it provides value, rather than enforcing global DRY principles. The system identifies similar code segments across microservices and allows selective sharing, maintaining code quality without forcing uniformity across the entire system.

Inventive Principle:
Principle #3Local quality

2Adaptability or versatility

If microservices are decomposed into smaller services, then modularity and independent deployment improve, but managing complex environments with hundreds of moving parts becomes difficult

Engineering Contradiction:
Improvemodularity and independent deploymentVSAvoidcomplexity in managing microservices
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal code management system that works across all microservices regardless of their specific function or team ownership. The system provides multi-functional capabilities including code segment identification, similarity analysis, and recommendation generation that apply uniformly across the entire microservices ecosystem.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent introduces an intermediary code management system that mediates between individual microservices and their development teams. This intermediary layer provides centralized visibility and control over code segments across all services, making it easier to manage complexity without sacrificing the independence of individual services.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If standard code analysis tools are used, then code efficiency can be identified, but tools do not account for code structure or duplication in microservices architecture

Engineering Contradiction:
Improvecode efficiency identificationVSAvoidhandling of code structure and duplication
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent changes the parameters of code analysis by introducing similarity scoring metrics specifically designed for microservices architecture. Instead of using standard code quality metrics, the system analyzes code segments based on their similarity to other segments across microservices, enabling identification of duplication patterns and refactoring opportunities.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11487641B1Micro services recommendation system for identifying code areas at risk
Publication Date: 2022.11.01 EMC IP HLDG CO LLC
  • US11487641B1 patent drawing
  • US11487641B1 patent drawing
  • US11487641B1 patent drawing

AI summary

Identifying risky code in microservices is described. A system identifies a modification to code segments in an application. The system determines a segments similarity score based on comparing the code segments, which are in a microservice of the application, against other code segments, which are in another microservice of the application. The system determines whether the segments similarity score satisfies a segments similarity threshold. The system outputs a recommendation to make the modification, which was made to the code segments in the microservice of the application, to the other code segments in the other microservice in the application, in response to a determination that the segment similarity score satisfies the similarity threshold.