Annotation-based adaptation of the Metamorphic Testing-as-a-Service (MTaaS) architectural pattern for the Java programming language.
The project implements an annotation-driven approach for describing metamorphic relations, automatic relation discovery, source generation, and optional service integration for metamorphic testing workflows.
This repository contains a research prototype focused on adapting the original C# MTaaS concept to Java.
Metamorphic testing is a software testing technique designed to address the oracle problem by validating relations between multiple executions instead of checking a single expected output.
The original MTaaS concept introduced decomposition of metamorphic relations into separate components together with automatic generation of executable testing infrastructure.
This project adapts that idea to Java using:
- Java annotations
- Annotation Processing API
- Compile-time source generation
- YAML-based relation specification generation
- Optional integration-layer generation
mtaas-core/
Core annotations
Annotation processor
Relation collection and validation
Source generators
YAML generation
mtaas-integration/
Integration-layer generation support
mtaas-sample/
Local execution examples and metamorphic relation test cases
mtaas-sample-integration/
Local and Spring-based integration examples
docs/
Generated artifact examples
research/
Supplementary research-related materials
The framework decomposes a metamorphic relation into several independent roles.
| Annotation | Purpose |
|---|---|
@ArtifactEntry |
Entry point of the tested artifact |
@DataGenerator |
Generates source test data |
@InputMetamorphosis |
Transforms input data |
@OutputMetamorphosis |
Transforms output data |
@OutputModelComparer |
Compares transformed outputs |
Relations are grouped using the relationName parameter.
Example:
@OutputMetamorphosis(relationName = "order-total")The framework operates during compilation using Java Annotation Processing.
- Annotation discovery
- Relation grouping by
relationName - Semantic validation
- Source generation
- YAML specification generation
Additional architectural diagrams are available in:
research/diagrams/
During compilation, the framework automatically generates:
MetamorphicRelation_*MetamorphicFunction_*MetamorphicServiceAdapter_*MetamorphicServiceRegistryspec.yaml
Representative generated artifacts are included in:
docs/generated/
The examples are organized by generation category:
core/
Generated relation and function wrappers
integration/
Generated service adapters and registry
yaml/
Example generated relation specifications
Actual generated files are normally produced inside the Maven target/ directory and are excluded from version control.
- Java 17+
- Maven 3.9+
mvn clean installAdditional annotation processor debug output can be enabled using the debug Maven profile:
mvn clean install -Pprocessor-debugThe repository contains two separate sample modules.
This module demonstrates local usage of the generated MTaaS artifacts without a service layer.
It includes examples based on:
- order total calculation;
- convex hull computation.
These examples are executed as local tests and show how annotation-defined metamorphic relations can be discovered, generated, and validated during the build process.
This module demonstrates integration-oriented usage of the framework.
It includes a text normalization example and shows how generated service adapters can be used together with a Spring-based controller.
The module demonstrates:
- annotation-based relation definition;
- generation of integration adapters;
- execution through a local adapter;
- execution through a Spring controller.
This repository represents a research-oriented prototype created for evaluating the feasibility of adapting the MTaaS architectural pattern to Java using annotation processing and compile-time code generation.
The project also includes supplementary research materials, architectural diagrams, and infrastructure for experimental evaluation using object-oriented software quality metrics.
Additional research information is available in:
research/
MIT License
