You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Spring Boot REST API that teaches code refactoring techniques for BS Software Engineering (6th semester) students. Each technique provides a description, a bad code example, and a good code example side-by-side.
Getting Started
Prerequisites
Java 17+
Maven 3.6+
Run the application
mvn spring-boot:run
The API will be available at http://localhost:8080.
Run tests
mvn test
API Reference
All Techniques
Method
Endpoint
Description
GET
/api/techniques
List all refactoring techniques
GET
/api/techniques/categories
List all categories and their techniques
GET
/api/techniques/search?q=keyword
Search techniques by name, description, or category
GET
/api/techniques/{technique}/comparison
Get bad vs good code comparison for a technique
By Category
Method
Endpoint
Description
GET
/api/composing-methods
All Composing Methods techniques
GET
/api/composing-methods/{technique}
A specific Composing Methods technique
GET
/api/moving-features
All Moving Features techniques
GET
/api/moving-features/{technique}
A specific Moving Features technique
GET
/api/organizing-data
All Organizing Data techniques
GET
/api/organizing-data/{technique}
A specific Organizing Data technique
GET
/api/simplifying-conditionals
All Simplifying Conditionals techniques
GET
/api/simplifying-conditionals/{technique}
A specific Simplifying Conditionals technique
GET
/api/simplifying-method-calls
All Simplifying Method Calls techniques
GET
/api/simplifying-method-calls/{technique}
A specific Simplifying Method Calls technique
GET
/api/dealing-with-generalization
All Dealing with Generalization techniques
GET
/api/dealing-with-generalization/{technique}
A specific Dealing with Generalization technique
Response Format
Technique response (RefactoringTechniqueResponse)
{
"name": "Extract Method",
"category": "Composing Methods",
"description": "When you have a code fragment that can be grouped together...",
"badCode": "// BAD: One long method doing everything...",
"goodCode": "// GOOD: Each logical section is its own well-named method..."
}
Comparison response (RefactoringCodeComparison)
{
"name": "Extract Method",
"category": "Composing Methods",
"badCode": "// BAD: One long method doing everything...",
"goodCode": "// GOOD: Each logical section is its own well-named method..."
}