Repository for "Combining Static and Dynamic Approaches for Mining and Testing Constraints for RESTful API Testing"
This repository contains the resources and code related to the paper "Combining Static and Dynamic Approaches for Mining and Testing Constraints for RESTful API Testing."
RBCTest_dataset
: Our self-collected dataset, contains of 8 services, including an OpenAPI specification for each service.agora_dataset
: AGORA's dataset.approaches
: Includes our ground-truth constraints, detected constraints from RBCTest, RBCTest-.src
: Source code.- Benchmark for API Constraints Mining in
approaches/ground_truth
.
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file under thesrc
directory with the following content:OPENAI_API_KEY=<your_openai_api_key>
Please ensure that your key supports the required models.
-
Request-Response Constraints:
- For our approach:
python src/request_response_constraint_mining.py
- For the ablation approach:
python src/response_property_constraint_mining_ablation.py
- For our approach:
-
Response Property Constraints:
- For our approach:
python src/request_response_constraint_mining.py
- For the ablation approach:
python src/request_response_constraint_mining_ablation.py
- For our approach:
- Run the script:
python src/constraints_test_generation.py
-
To re-evaluate constraints mining, run:
python src/evaluate_constraints_mining.py
-
To re-evaluate test generation, run:
python src/evaluate_test_gen.py
- All Dynamic (AGORA) detected invariants:
AGORA-eval/agora_all.xlsx
- All Static (LLM-based) detected constraints: see sub-folders in
approaches/rbctest_agora_data
- Overlapping analysis:
AGORA-eval/overlapping_analysis_all.xlsx
Annotation:
s
: Static constraint is betterd
: Dynamic invariant is better=
: Equivalent constraint
- Results Analysis:
approach_evaluation_test_gen.csv
- Details: see
approaches/rbctest_our_data
(each subfolder is an API-under-test)
- Results Analysis:
test_outcomes_analyze.csv
- Detected mismatches:
all_mismatches.xlsx
- Ablation study: see
approaches/ablation