Browse articles about JAVA.
Review the previous 14 installments, see how TDD helps with maintenance, and explore what to learn next. Includes the complete example code repository.
Explore the costs, schedule pressures, and team buy-in involved in adopting TDD at work, and learn how to choose what to test.
Compare unit and integration testing in Spring Boot, and build an end-to-end integration test using @SpringBootTest and a controllable Clock bean.
Learn how to extend an existing project with a new discount policy using TDD while keeping its existing behavior safe.
Learn what makes code difficult to test, including hidden dependencies on time or randomness, and use dependency injection to make it testable.
Test input validation and business exceptions with @Valid and @RestControllerAdvice.
Test the Controller layer with @WebMvcTest and MockMvc, and learn to verify API requests and responses.
Explore Mockito in depth: understand state versus behavior verification and learn to isolate dependencies using Mock objects.
Replace an in-memory store with a JPA Repository and use @DataJpaTest to test database logic in isolation.
Learn why TDD should start with domain services and business rules before the web controller, and how to test domain objects independently.
Learn how to complete the Refactor step of TDD by improving internal structure and separating responsibilities with confidence from tests.
Explore TDD’s Green stage: fix compilation errors and learn the minimal implementation principle for passing tests in the simplest way.
Learn how to turn requirements into test cases and write failing tests (Red) before implementing a feature.
Set up a Spring Boot project for TDD and learn the basics of JUnit 5, AssertJ, Mockito, and test package organization.
Learn the fundamentals of TDD and the Red-Green-Refactor cycle, and see why test-driven development is useful in a Spring Boot environment.
Learn why Class Data Sharing can trigger a JVM warning during tests and how to suppress it with -Xshare:off.
Learn how encapsulation, inheritance, polymorphism, and abstraction help create flexible, maintainable software.
Learn why QueryDSL is a type-safe query builder for JPA, how to configure it, how Q-Types are generated, and how to write dynamic queries.
Learn how Spring AOP modularizes cross-cutting concerns, how its key concepts and proxy-based execution work, and where AOP is commonly used.
Learn dependency injection (DI) and inversion of control (IoC), how Spring Boot manages objects through DI, the benefits of constructor injection, and common interview questions.