API Traceability via Abstract Syntax Tree Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In medium and large enterprise computing environments, frequent changes to source code and software dependencies lead to a lack of awareness of API functionality, resulting in production software instability and system errors due to incomplete or outdated API documentation.

Innovation Solution

The system automatically discovers and traces APIs by parsing source code using abstract syntax trees (ASTs), generating an end-to-end lineage of API usage without requiring source code modifications, and constructing a neutral API model for enhanced visibility and migration capabilities.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Loss of information

If manual documentation efforts are used to track API functionality, then documentation can be created, but it becomes outdated and incomplete due to frequent source code changes

Engineering Contradiction:
ImproveAPI documentation accuracyVSAvoidTime to update documentation
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system performs preliminary actions by automatically discovering and documenting API functionality directly from source code at the time of code commit, rather than relying on manual updates later. The AST-based parser proactively captures API information as it exists in the codebase, ensuring documentation is current without requiring manual intervention.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The documentation system serves itself by automatically parsing source code and generating API documentation without human intervention. The system uses AST parsers to self-extract API information from the codebase, eliminating the need for developers to manually update documentation and ensuring it remains synchronized with the actual code.

Inventive Principle:
Principle #25Self-service

2Loss of information

If comprehensive API documentation is maintained manually, then API information can be captured, but developer effort and resources are significantly consumed

Engineering Contradiction:
ImproveAPI functionality awarenessVSAvoidDeveloper productivity
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

The system eliminates manual documentation efforts by implementing self-service automated discovery using AST parsers. The system automatically extracts API information from source code, eliminating the need for developers to spend time manually documenting APIs while maintaining comprehensive API functionality awareness.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces the mechanical manual process of documentation creation with an automated computational system. AST-based parsers automatically analyze source code and extract API information, substituting human manual effort with machine-based automated analysis, thereby freeing developers to focus on core development tasks.

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

3Measurement precision

If API documentation is updated frequently to reflect source code changes, then accuracy is improved, but the complexity of maintaining documentation increases

Engineering Contradiction:
ImproveAPI documentation accuracyVSAvoidDocumentation maintenance complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system replaces complex manual documentation maintenance processes with automated AST-based parsing. The parser automatically analyzes source code and extracts API information, eliminating the complexity of manual tracking and updating while maintaining high accuracy through direct code analysis.

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

Solution Approach 2:

The system implements continuous feedback by automatically re-parsing source code and updating API documentation whenever code changes occur. This feedback loop ensures documentation accuracy is maintained automatically without manual intervention, as the system continuously monitors and updates based on the current state of the codebase.

Inventive Principle:
Principle #23Feedback

4Loss of information

If manual tracking of API lineage is performed, then API usage information can be captured, but it is incomplete and requires significant developer effort

Engineering Contradiction:
ImproveAPI lineage informationVSAvoidTime to track API usage
Core Design Contradiction:
Loss of informationVSLoss of time

Solution Approach 1:

The system replaces manual API lineage tracking with automated AST-based analysis. The parser automatically traverses the codebase using abstract syntax trees to discover and map API relationships, eliminating manual tracking efforts while capturing complete and accurate lineage information across the entire codebase.

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

Data Source

PatentUS10929211B1Identification and traceability of application programming interface (API) functionality in a distributed computing environment
Publication Date: 2021.02.23 FMR CORP
  • US10929211B1 patent drawing
  • US10929211B1 patent drawing
  • US10929211B1 patent drawing

AI summary

Methods and apparatuses are described for identification and traceability of application programming interface (API) functionality in a distributed computing environment. A server retrieves source code comprising API calls from source code repositories, and parses the source code to identify a first set of APIs, each having one or more attributes. The server retrieves API definitions and parses the API definitions to identify a second set of APIs, each having one or more attributes. The server compares the first set of APIs and the second set of APIs to determine matching APIs. Using the matching APIs, the server detects backend systems associated with each API and generates a call graph for each API by traversing abstract syntax trees (ASTs) associated with the source code. The server builds an API model object for each API, comprising the attributes of the API, the detected backend systems, and the call graph.