4 November meetup: more confidence and better testing
Details
Are you ready for an evening of insightful talks and great company? Join us on Tuesday, November 4th for an exciting JUG Noord meetup in Leeuwarden, focusing on testing!
📅 Date & Time:
- Venue opens: 16:30
- First talk starts: 17:00
- Food & drinks: Provided between the sessions
📍 Location: Tesselschadestraat 3, 8913 HA Leeuwarden
🇬🇧 Better Assertions with AssertJ by Tim te Beek (Moderne)
Not all testing libraries are equal. Sure they all run your tests, but what happens when they fail? “Expected ‘true’, was ‘false’” won’t help you much. Your choice of library determines whether you can immediately jump to a fix, or first have to debug for more details.
In this talk we’ll explore AssertJ, and the fluent assertions API it provides. We’ll contrast this to alternatives like JUnit and Hamcrest, and show how subtle differences improve the experience. We’ll also look at the `MockMvcTester` added to Spring Boot 3.4, and how you can now finally have unified fluent assertions for all your tests, and the path to get there.
For existing AssertJ users we will optimize its use to get more expressive assertions and meaningful messages from existing tests. Finally, a quick few OpenRewrite recipes help you apply all these best practices at once, and continuously going forward.
🇬🇧 Gain confidence in your code with mutation testing by Simone Romani (ING)
One of the best ways to assess if code is resilient against bugs is to break it on purpose and see how it reacts.
The reaction should be a failure in the tests. If there is no reaction, it means that the tests are not effective enough, meaning their assertions are broad and imprecise.
Mutation testing comes to the rescue for this specific challenge. This methodology changes the source code and then runs the unit tests against the mutated codebase. The generated report helps the engineer find where the weak spots in the tests are.
In this talk we will cover the theory behind this methodology, followed by a live demo where code which could be described as "100% tested" would still be subject to bugs and how its related tests can be improved.
This approach will offer a way for engineers to gain confidence in their code and especially in their tests. With a high test strength, source code will not only be strong but also malleable to modifications, with the safe guardrails of unit tests protecting them from introducing bugs.
The audience will learn how to write more efficient and resilient tests due to the mutation tests giving them a different perspective on their code quality, compared to the normal tests. Mutation testing will also drive better production code, following the principle of Test Driven Design.
About the speakers
Tim te Beek is a staff software engineer at Moderne, which automates software refactoring at scale. He has extensive experience contributing to and presenting on Open Source software within the Java ecosystem. Previously he worked as a consultant specializing in migration engineering and developer productivity.
Simone Romani is a Senior developer and engineering manager at ING. Always up to date with the latest standards and never out of touch with code.
Test-driven development enthusiast and testing advocate. Striving to deliver always the most reliable code while being understandable.