Session
Bob the Test Data Builder - Maintainable Tests Despite AI Code Generation
AI tools like GitHub Copilot have transformed how we write tests. A simple prompt - and seconds later we have a complete test suite. But this apparent time-saving has a hidden cost: massive code duplication in tests.
Each test creates its test data from scratch. Add a new required field to the data model or change a data type, and suddenly dozens or hundreds of tests need to be modified. Tests become unreadable as signal and noise get mixed together, and maintenance becomes a nightmare.
The solution is a proven pattern that has worked in practice for years: the Test Data Builder. This pattern encapsulates test data creation, provides sensible default values, and enables precise configuration through fluent APIs. The result: tests that focus on what matters and can be adjusted in exactly one place when models change.
In this session, I'll demonstrate through live coding:
- How to create Test Data Builders from the ground up
- How hierarchical builders elegantly model complex object structures
- How collection builders handle nested lists
- How to strategically use AI tools like GitHub Copilot through precise prompts and instruction files to generate consistent builders
You'll learn how traditional software engineering principles and modern AI support work synergistically. The goal: tests that don't just work, but are also maintainable, readable, and sustainable.
Target Audience: Developers with experience in unit testing who want to elevate their test quality to the next level.
Key Takeaways:
- Practical builder pattern for test data
- Integration with GitHub Copilot
- Patterns for complex object hierarchies
- Best practices for sustainable test architectures
- Duration: 45 minutes
- Format: Live coding session with practical examples
- Level: Intermediate
- Language: English
- Technology: C#, .NET, xUnit, GitHub Copilot
Alexander Rampp
XITASO GmbH, Head of Software Engineering, Clean Coder
Augsburg, Germany
Links
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