Automatic API Class Generation via Reflection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Creating runtime scenarios for testing API source code that accesses or modifies enterprise database records is a difficult, time-consuming, and error-prone process, especially for users unfamiliar with the API layer or OS implementations.

Innovation Solution

A method and system that automatically generates linkable building block classes from API source code using reflection to create a reusable runtime pool, allowing for efficient and accurate execution of runtime scenarios through dynamically reading API command classes and embedding metadata for logical sequencing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If runtime scenarios are manually created for testing API source code, then test coverage and accuracy can be ensured, but the process becomes time-consuming and error-prone

Engineering Contradiction:
Improvetest accuracyVSAvoidscenario creation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system automatically copies and transforms API source code into executable runtime scenario code. The code generation engine analyzes API source code and automatically creates corresponding runtime scenario implementations, eliminating manual copying and reducing errors while maintaining test accuracy.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system enables self-service automated generation of runtime scenarios from API source code. The code generation engine autonomously analyzes API interfaces, generates appropriate test scenarios, and creates executable code without requiring manual intervention, thereby reducing time consumption while maintaining reliability.

Inventive Principle:
Principle #25Self-service

2Reliability

If users manually understand and implement API layer and OS implementation details, then runtime scenarios can be accurately created, but the complexity and difficulty increase significantly

Engineering Contradiction:
Improvescenario accuracyVSAvoidimplementation complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The code generation engine acts as an intermediary between API source code and runtime scenario implementation. It automatically analyzes API interfaces and generates the necessary runtime scenario code, eliminating the need for users to directly understand complex API layer and OS implementation details while ensuring accurate scenario creation.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs self-service by automatically analyzing API source code and generating runtime scenario implementations without requiring users to manually understand underlying complexities. The code generation engine handles the complex analysis and code transformation tasks autonomously.

Inventive Principle:
Principle #25Self-service

3Productivity

If runtime scenarios are created without automation, then full control over test logic can be maintained, but productivity and efficiency decrease

Engineering Contradiction:
Improvescenario generation efficiencyVSAvoidgeneration automation level
Core Design Contradiction:
ProductivityVSExtent of automation

Solution Approach 1:

The system automatically copies API source code structures and transforms them into runtime scenario code. This automated copying process significantly improves productivity by eliminating manual code writing while maintaining the logical structure and control flow of the original API interfaces.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The code generation engine provides self-service automated generation of runtime scenarios, dramatically improving productivity. The system autonomously analyzes API source code, generates test scenarios, and creates executable code without manual intervention, thereby increasing efficiency while maintaining adequate automation control.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS8881127B2Systems and methods to automatically generate classes from API source code
Publication Date: 2014.11.04 SAP SE
  • US8881127B2 patent drawing
  • US8881127B2 patent drawing
  • US8881127B2 patent drawing

AI summary

According to some embodiments, Application Programming Interface (API) source code, including command design patterns, is determined to be executed as a runtime scenario. Class may then be automatically generated as linkable building blocks in accordance with the API source code and command design patterns. For example, API command classes and associated methods may be dynamically read using reflection, and a building block class associated with each API command class may be generated. Runtime readable embedded metadata may be planted in the building block classes, at least some of the metadata being provided by the reflection. According to some embodiments, a logical sequence of the building blocks classes may be linked in accordance with the runtime scenario.