Generic API Test Automation Using Reflection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software applications require extensive manual effort to create and manage request and response objects for API testing, which is time-consuming and limits the efficiency of automated testing across various APIs.

Innovation Solution

Automatically creating request and response objects at runtime using reflection and generic objects, populated with values from a property file, allows for automated API testing without manual code creation or GUI usage, enabling testing of any application and API with any automation tool.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If manual creation of request and response objects is used for API testing, then testing can be performed with basic automation tools, but the process becomes time-consuming and inefficient

Engineering Contradiction:
Improvetesting efficiencyVSAvoidtime to create objects
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs preliminary action by automatically generating request and response objects during runtime before actual API testing begins. The framework pre-creates these objects using reflection and property files, eliminating the need for manual creation beforehand and significantly reducing testing preparation time.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The testing framework implements self-service by automatically creating and managing request and response objects without requiring manual intervention. The system uses reflection to instantiate objects and populates them with test data from property files autonomously, making the testing process self-sufficient and highly efficient.

Inventive Principle:
Principle #25Self-service

2Adaptability or versatility

If manual code creation or GUI usage is required for testing, then specific automation tools can be used, but the approach limits adaptability across different applications and APIs

Engineering Contradiction:
Improvecompatibility with any APIVSAvoidtesting framework complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The testing framework achieves universality by designing a generic, tool-agnostic architecture that can test any application and API. It uses standard Java reflection mechanisms and property files that work across different automation tools and platforms, making the framework highly adaptable and versatile without being tied to specific toolsets.

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

Solution Approach 2:

The framework introduces an intermediary layer using property files and reflection that mediates between the testing logic and the actual API interactions. This intermediary approach abstracts the complexity, allowing the same framework to adapt to different APIs and applications without requiring tool-specific implementations.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If extensive manual testing is performed to ensure robust application releases, then quality can be maintained, but the testing process becomes lengthy and resource-intensive

Engineering Contradiction:
Improveapplication qualityVSAvoidtesting speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The framework enables continuous automated testing by systematically creating and executing test cases without manual intervention. The reflection-based object creation and property file-driven test data management allow testing to proceed continuously and efficiently, maintaining high application quality while significantly improving testing speed and resource utilization.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS9934135B2Generic test automation for application programming interface applications
Publication Date: 2018.04.03 CA TECH INC
  • US9934135B2 patent drawing
  • US9934135B2 patent drawing
  • US9934135B2 patent drawing

AI summary

A method for testing an application that invokes an application programming interface (API) comprises identifying signatures for APIs. A package associated with the API is identified in the application under test, and a package name of the API is identified in the signatures. During runtime of the application under test, request and response objects (or other objects) for the identified package are created using the package name and reflection. The created request object is then used to invoke the API to test the application under test and the response object is used to evaluate the response with expected response.