Ted M. Young
Principal Technical Coach
San Mateo, California, United States
Actions
Java technical coach, trainer, and learning designer.
Links
Area of Expertise
Topics
Your Tests Don't Have to be Hard to Write (and Read)
We all know good unit tests are important, but why can they be so hard to write and maintain? It's the architecture. Mixing your business logic with infrastructure aspects forces your tests to be more complex.
A solution is the Testable Architecture combined with patterns from Domain-Driven Design. Combining Hexagonal and Clean Architecture concepts, this architecture helps make it clear how to organize your code into easily testable chunks, and scales from the smallest microservice to large, well-structured monoliths.
Through a mix of diagrams and real-world Java code, you’ll learn the Testable Architecture and understand how it makes testing easier and results in more readable code.
Playing to Learn Test-Driven Development
What are the benefits of Test-Driven Development (TDD)? Come and play JitterTed’s TDD Game and find out!
TDD is not new, and those who love it swear there is no better way to write code. Yet still it is not the norm: The majority of jobbing software developers do not use TDD. The reasons are various – some feel they don’t have time, others don’t know how, and still others are actively antagonistic towards it. But despite it being deceptively simple to describe (it’s just red-green-refactor, right?), there are many subtleties that make TDD a practice that can be hard to adopt and easy to abandon.
Things that are difficult and take time to learn can also be dispiriting, and this is where an engaging approach such as playing a game can really come into its own. This game has been developed with the goal of experiencing, via both engagement and discussion, not only the many subtle and varied benefits of TDD, but also the pitfalls you can encounter when you’re new to this way of working.
The game has been played at events all over the world and gets an enthusiastic response wherever it goes. Whether your goal is to learn more about TDD or explore a tool you can use to convince others of its benefits, this workshop will be hugely enjoyable.
Attendees will come away with a better understanding of:
* Why Test-Driven Development reduces risk
* The true purpose of the failing (red) test
* The power of taking small, safe steps
* Why writing less code at each step is important
* The use of prediction to verify test validity and code comprehension
Master Java Unit Tests with AssertJ
If you're a Java developer, you probably use JUnit for your tests. But tests full of repeated "assertEquals" and "assertTrue" can be hard to decipher. When tests fail -- and they will -- you quickly want to know why, without having to dig deep into the test code.
AssertJ is a popular add-on for your JUnit testing, and this session will show you how easy it is to write more readable tests. You'll learn patterns for writing good unit tests, as well as ways to take existing tests and break them down into easier to digest pieces.
Come learn why succesful projects, such as the Spring Framework, use AssertJ to make unit testing easier.
Testable Architecture: Keep 'em Separated
One of the most important, yet misunderstood, aspects of Hexagonal, Clean, and Onion architectures not their folder structure, but how they keep I/O and domain logic separate. Why? The clear separation makes it easier to write tests: by moving away from the confusing terms of "unit" and "integration" tests to "I/O-based" and "I/O-free", there's no longer any confusion about how the test should be structured.
In this Java code-filled session, we'll look at how to combine Hexagonal Architecture with Domain-Driven Design's context boundaries and tactical patterns to make it clear what code goes where, and how to test it. We'll also see how to refactor "mixed up" code to separate I/O from domain and application logic. The result is extremely fast tests for the most important part of your application, the domain, while also reducing the amount of tests needed for coordination.
Event Sourcing and the End of DDD Tactical Patterns
Event-sourcing allows the business to ask questions about your application's data that weren't thought of when the system was created, such as "how often are customers changing their shipping address?".
However, it requires a mind-shift from the well-known DDD Tactical Patterns (Aggregates and Repositories), but the benefits are more flexible systems, with a state-change trail that AI can leverage.
In this session, you'll learn how event-sourcing works at the code level without event-sourcing libraries getting in the way of deeper understanding. We'll walk through a codebase for a Concert Ticketing system and see how straightforward the implementation can be.
We start with "Event Modeling" the system, defining the commands (user actions) that generate them, the aggregates that make business decisions (and how to move to "deciders"), and the projections used to generate the user interface. We'll see how event-sourcing makes testing easier to write and understand.
We'll end by touching on the challenges to using event-sourcing, such as performance and schema evolution.
Ted M. Young
Principal Technical Coach
San Mateo, California, United States
Links
Actions
Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.
Jump to top