Upgrade to Pro — share decks privately, control downloads, hide ads and more …

1/27/25 - JChampionsConf - TDD: It's easier tha...

1/27/25 - JChampionsConf - TDD: It's easier than you think!

Everyone loves writing tests, don’t they? How do you write good tests? What tools are available for you to write good tests?

In this session, I will dive into the many features of Quarkus that help developers write good tests. I will highlight some of the features of Quarkus, Dev Services and Continuous Testing, which help make testing easier. Additionally, I will live code some tests for common use cases developers encounter, including unit, integration, and “black box” testing of imperative and reactive RESTful and event-driven applications that use common services, such as databases and Kafka brokers. I will discuss techniques such as mocking, spying, and interaction-based testing/verification.

I'll even spend some time showing how IDE-based AI assistants can help!

Once you see how easy TDD really can be there isn't a reason to not do it!

Eric Deandrea

January 27, 2025
Tweet

Video

More Decks by Eric Deandrea

Other Decks in Technology

Transcript

  1. TDD It’s easier than you think! Eric Deandrea Sr. Principal

    Developer Advocate @ Red Hat @edeandrea
  2. Who am I? • 25+ years software development experience ◦

    ~11 years as DevOps Architect in financial services / insurance Java Champion • Contributor to Open Source Projects Quarkus Spring Boot, Spring Framework, Spring Security LangChain4j (& Quarkus LangChain4j) Wiremock Microcks • Boston Java Users ACM Chapter Board Member • Published author • Avid boater & black belt in martial arts @edeandrea
  3. https://red.ht/quarkus-spring-devs • Showcase & explain Quarkus, how it enables modern

    Java development & the Kubernetes- native experience • Introduce familiar Spring concepts, constructs, & conventions and how they map to Quarkus • Equivalent code examples between Quarkus and Spring as well as emphasis on testing patterns & practices 3
  4. 6

  5. 6

  6. 11

  7. end-to-end tests unit tests integration tests low effort high realism

    tests with application server test REST endpoints tests with a database
  8. Kubernetes Native Java with Quarkus https://www.infoq.com/articles/native-java-quarkus Deployment Developer Joy •

    Quickly & easily build Kubernetes-Native Java applications • Industry leader in startup time and memory utilization for native and JVM applications • One step native executable generation • Leverage existing Java, Jakarta, MicroProfile, & Spring expertise • Imperative & reactive APIs side-by-side • Live coding with zero config @edeandrea