How neiryerit/tdd-by-example works
Main Components
• Maven Build & Project Configuration: Represent the pom.xml along with the Maven Wrapper files (mvnw, mvnw.cmd, and Maven’s configuration under .mvn). This component underlines how the project is built and managed.
• Production Code: Show the src/main/java component. Since the code is under package guru.springframework (and its subdirectories), this node represents the core domain logic—the implementation of the Money example and possibly related business rules.
• Resource Files: Include the src/main/resources element (notably application.properties) which holds runtime configuration. This is important even in a basic example as it shows configurable properties.
• Test Code: Represent the src/test/java segment. This component is critical because it covers the TDD aspect of the project, where unit tests (using JUnit 5 and running under Java 11) are driving design and ensuring that the business logic behaves as expected.
Architectural Patterns and Design Principles
• Core TDD cycle (Red/Green/Refactor) by visually linking the Test Code and Production Code components. Although the project is simple, this is a fundamental pattern being taught.
• The separation of concerns is visibly represented by dividing the project into production code, test code, and configuration; this is in line with clean code and TDD principles.
Relevant Technologies and Tools
• Maven (pom.xml, mvnw): Indicate that Maven is used for dependency management and build orchestration.
• JUnit 5: Identify that test cases leverage JUnit 5, an important part of the TDD process.
• (Optionally) The mention of Spring in the package name (guru/springframework) might be included if the project leverages any Spring concepts, though from the file structure it appears to be more of a demonstration rather than a full Spring Boot application.
Instructing the Principal Software Engineer
• A “Maven Build/Configuration” node that encapsulates the build process (Maven, mvnw, and the pom.xml).
• A “Production Code” node for the src/main/java directory, ensuring to note it contains the core Money example logic.
• A “Resource” node that represents configuration files (application.properties).
• A “Test Code” node for src/test/java, highlighting the role of JUnit 5 tests in driving the design.
• From “Maven Build” to both “Production Code” and “Test Code” (indicating that the build process compiles and runs tests).
• From “Test Code” to “Production Code” (emphasizing the TDD feedback loop).