This document provides a comprehensive analysis of why this project qualifies as a framework and outlines a roadmap for transforming it into a world-class open source API automation framework.
A framework is distinguished from a library by its inversion of control - the framework calls your code, not the other way around. Our project exhibits all the key characteristics of a true framework:
Current Implementation:
// Framework controls the flow - you define methods, framework calls them
@ConfigProperty("BASE_URL")
String getBaseUrl(); // Framework invokes this through dynamic proxy
@RequestTemplateFile("requests/login.json")
RequestSpecBuilder loginRequest(String username, String password); // Framework processes this
// Framework calls your step definitions
@Given("I have valid user credentials")
public void i_have_valid_user_credentials() {
// Your implementation
}
Framework Control Flow:
ConfigFactoryProxy
Custom Annotations System:
// Users extend framework through annotations
@ConfigProperty("CUSTOM_PROPERTY")
String getCustomProperty();
@RequestTemplateFile("requests/custom-request.json")
RequestSpecBuilder customRequest(String param1, String param2);
Abstract Base Classes:
// Framework provides extensible base classes
public abstract class ValidateResponse<SELF_TYPE extends ValidateResponse<?>> {
// Framework provides common validation methods
public SELF_TYPE httpStatusCodeIs(int statusCode) { }
public SELF_TYPE matchesSchema(String fileClassPath) { }
// Users extend with custom validation
public SELF_TYPE customValidation() { return selfType; }
}
Enforced Structure:
org.aditi.api_automation/
├── api/ # API domain classes (convention)
├── config/ # Configuration management (convention)
├── requests/ # Request factories (convention)
├── asserts/ # Validation classes (convention)
└── steps/ # Step definitions (convention)
Resource Organization:
src/main/resources/
├── environment/ # Environment configs (convention)
├── requests/ # JSON templates (convention)
└── response/schemas/ # JSON schemas (convention)
High-Level API Testing Abstractions:
// Framework provides domain-specific abstractions
public class UserApi {
public static Response login(UserLoginRequest request) { }
public static Response createUser(UserCreateRequest request) { }
}
// Framework provides fluent validation
ValidateGenericResponse.assertThat(response)
.httpStatusCodeIs(200)
.matchesSchema("schemas/user-schema.json")
.validateJsonPathData("data.id", 1);
Framework Defines Structure:
// Framework defines the testing pattern
@Given("I have valid user credentials") // Framework pattern
@When("I attempt to login") // Framework pattern
@Then("I should receive a successful response") // Framework pattern
Users Provide Implementation:
public void i_have_valid_user_credentials() {
// User provides implementation
loginRequest = new UserLoginRequest("testuser", "testpass");
}
Framework Characteristic | Current Implementation | Maturity Level | Score |
---|---|---|---|
Inversion of Control | Dynamic proxies, annotations | ✅ Strong | 9/10 |
Extensibility | Custom annotations, abstract classes | ✅ Good | 8/10 |
Convention over Configuration | Enforced structure, naming | ✅ Strong | 9/10 |
Abstraction Level | High-level API abstractions | ✅ Good | 8/10 |
Documentation | Comprehensive guides | ✅ Excellent | 10/10 |
Testing | BDD with Cucumber | ✅ Good | 8/10 |
Configuration Management | Environment-aware | ✅ Strong | 9/10 |
Error Handling | Custom exceptions | ⚠️ Basic | 6/10 |
Plugin System | Not implemented | ❌ Missing | 0/10 |
Performance | Basic optimization | ⚠️ Basic | 5/10 |
Overall Framework Score: 7.2/10 - A solid foundation with room for enhancement
This enhancement roadmap will transform the current solid framework into a world-class, enterprise-ready API automation framework that can compete with commercial solutions while remaining open source and community-driven.
For detailed technical implementation, see Technical Enhancements Guide.