CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/springboot-project-structure

Spring Boot project structure — package-by-feature, record DTOs, Flyway migrations, multi-profile config, actuator, proper test structure

84

4.04x
Quality

76%

Does it follow best practices?

Impact

97%

4.04x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-4/

{
  "context": "Tests whether the agent proactively applies Spring Boot project structure best practices when building a multi-domain microservice. The task asks to build an order processing service without specifying how to organize the code — criteria check for package-by-feature layout, record DTOs, configuration profiles, Flyway migrations, proper test structure, and global exception handling.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Package-by-feature layout",
      "description": "Code is organized by feature/domain (order/, menuitem/ or menu/, shared/) rather than by layer (controller/, service/, repository/ at the top level). Each feature package contains its own controller, service, repository, and DTOs together.",
      "max_score": 15
    },
    {
      "name": "Record DTOs separate from entities",
      "description": "Request and response DTOs are defined as Java records (not classes with getters/setters). JPA entities are not returned directly from controllers. Separate DTO types exist for API input/output.",
      "max_score": 12
    },
    {
      "name": "Configuration classes in config package",
      "description": "A dedicated config/ package exists containing @Configuration classes (e.g., SecurityConfig, WebConfig). Configuration classes are not scattered across feature packages.",
      "max_score": 8
    },
    {
      "name": "Multi-profile application.yml",
      "description": "Configuration uses application.yml (not .properties) with at least two profile-specific files (e.g., application-dev.yml, application-prod.yml or application-test.yml). Environment-specific values use ${ENV_VAR:default} placeholders.",
      "max_score": 10
    },
    {
      "name": "Flyway or Liquibase migrations",
      "description": "Database schema is managed with Flyway migration files (V1__*.sql in db/migration/) or Liquibase changelogs, not schema.sql or hibernate ddl-auto in production config. Flyway/Liquibase dependency is in pom.xml.",
      "max_score": 10
    },
    {
      "name": "Global exception handler",
      "description": "A @RestControllerAdvice class exists that handles exceptions globally and returns consistent structured error responses (e.g., ErrorResponse record with code and message). Handles at least validation errors, not-found, and unexpected exceptions.",
      "max_score": 10
    },
    {
      "name": "Test directory mirrors main",
      "description": "Test classes are organized in packages mirroring the main source tree. Tests exist for multiple layers (not just one test class for everything).",
      "max_score": 8
    },
    {
      "name": "Slice tests used",
      "description": "Controller tests use @WebMvcTest and/or repository tests use @DataJpaTest, rather than using @SpringBootTest for all tests.",
      "max_score": 7
    },
    {
      "name": "Entity-DTO mapping",
      "description": "A mapping mechanism exists between entities and DTOs — either MapStruct @Mapper interfaces or dedicated mapper/converter methods. Not inline conversion scattered across controllers.",
      "max_score": 5
    },
    {
      "name": "OSIV disabled and graceful shutdown",
      "description": "spring.jpa.open-in-view is set to false. server.shutdown is set to graceful.",
      "max_score": 5
    },
    {
      "name": "Actuator configured",
      "description": "spring-boot-starter-actuator is included as a dependency and health/metrics endpoints are configured in application.yml.",
      "max_score": 5
    },
    {
      "name": "CRUD endpoints functional",
      "description": "All five endpoints are implemented with correct HTTP methods and appropriate status codes (200 for reads, 201 for creation, etc.).",
      "max_score": 5
    }
  ]
}

evals

tile.json