Engineering Unit Tests with AI Agents
A practical training on engineering a feedback driven development process where AI agents collaborate with developers to produce small, readable, maintainable, and trustworthy unit tests.
Overview
By joining this training, you will learn how to engineer unit tests that are small, focused, and meaningful, and how to use AI agents as part of a disciplined development process rather than as ad hoc generators of test code.Contrary to common belief, the greatest benefit of unit testing done right is not higher coverage or fewer bugs. The real value lies in how well designed unit tests shape code design decisions, making change inexpensive and safe. In this training, AI agents are used inside an explicit feedback loop that critiques, refines, and improves tests against clear quality rules, reinforcing sound object oriented design principles and practices.
As a result, unit tests become readable and trustworthy for human developers, acting as executable documentation and a safety net for refactoring, rather than a liability to maintain.
The outcome is higher code quality achieved through structure and process, leading to improved productivity, predictable change, and software that remains maintainable over the long term.
Motivation
Many teams adopt AI tools expecting productivity gains, only to find that unit tests become harder to trust and more expensive to maintain. Without structure, AI accelerates output but not quality.
This training addresses that gap by teaching how to engineer a development process where AI agents reinforce good unit testing practices. The result is readable, maintainable, and trustworthy unit tests that reduce the cost of change, improve developer productivity, and support long term system evolution.
Learning Objectives
- Develop a clear and shared understanding of what effective unit testing really means in modern development
- Learn how to engineer a healthy unit test suite that delivers real value, not just coverage
- Learn how to use AI agents in a feedback driven process to produce unit tests that are readable, focused, and inexpensive to maintain
- Understand how well designed unit tests apply constructive pressure on production code and drive better code design decisions
- Learn practical techniques for refactoring production code toward a testable and maintainable design
- Learn how to introduce automated unit tests into legacy codebases using structured, AI assisted workflows
Target Audience
Any software developer would benefit greatly from this training.
Powerhouse Format Outline
➟ online only: one 4-hour session
The Powerhouse Workshop format is a concise, cost-effective, and impactful learning experience. In this format, the content is condensed and focuses on concepts, structure, and process rather than extensive hands-on labs. The emphasis is on understanding how AI agents can be integrated into a disciplined unit testing workflow.
Outline:
- Foundations of Unit Testing in an AI Assisted Workflow
- Understanding Mocks, Stubs, and Test Doubles with AI Agents
- Core Techniques for Engineering Good Unit Tests
- How Good Unit Tests and AI Agents Drive Code Quality
- Maintaining Unit Tests with Agent Assisted Feedback
- The Three Pillars of Good Unit Tests
- Automated Test Types and Where AI Agents Fit
Standard Format Outline
➟ onsite: two full days
➟ online: three days with 4-hour sessions each
The training is structured in two parts.
The first part focuses on explaining, exemplifying, and discussing the technical concepts and the engineered process for using AI agents in unit testing.
The second part is hands-on and focuses on building and exercising an AI assisted feedback loop that produces readable, maintainable, and trustworthy unit tests.
Custom formats are also available, offering extended durations with deeper practice and application on a specific project or codebase. These formats are designed to support teams in adopting AI assisted unit testing practices in a controlled and sustainable way.
Outline
Section 1: Foundations of Unit Testing
- What defines a GOOD Unit Test
- Unit Tests vs Integration Tests in an AI assisted context
- Why unit testing still matters in the age of AI
- What to test and what not to test
- How many unit tests are enough
Section 2: Tools, Frameworks, and AI Agents
- Test Frameworks
- Isolation Frameworks
- Code Coverage Tools
- AI Agents as collaborators in unit testing
- Constraints, rules, and boundaries for AI generated tests
Section 3: Core Techniques for Engineering GOOD Unit Tests
- Isolation and dependency control
- Test inhibiting design and how AI agents expose it
- Understanding Mocks vs Stubs
- Test Doubles and their correct usage
- Preventing over mocking with agent feedback
Section 4: Good Unit Tests Ask for Quality Code
- Why quality code matters more than test coverage
- How good unit tests apply positive pressure on design
- How AI agents reinforce design principles through test critique
- Patterns and principles emerging from test driven feedback
- Test Code Cycle and AI assisted iteration
- Code coverage as a signal, not a goal
Section 5: The Unit Test Code
- Treating test code as production code
- Testing abstract classes and boundaries
- Good practices for writing readable unit tests
- Unit test types and intent focused naming
- Test class organization and structure
- Using AI agents to refactor and simplify test code
Section 6: The Three Pillars of GOOD Unit Tests
- Readability as the primary success criterion
- Maintainability and cost of change
- Trustworthiness and developer confidence
- How AI agents help validate each pillar
Section 7: Automated Test Types
- Test granularity and responsibility boundaries
- Types of integration tests and their role
- Clear separation between unit tests and higher level tests
- Introducing automated tests into legacy code with AI assisted workflows
Section 8: Code Demonstration
- Live demonstration of an AI assisted unit testing feedback loop
- From initial test generation to refined, trustworthy tests
- Human decision points and trust gates
Section 9: Assisted Practice
- Guided exercises using AI agents under explicit constraints
- Practicing test critique and refactoring loops
- Applying the process to real world scenarios
We have trained hundreds of developers, helping them build the skills to design code that minimizes the cost of change. We have also designed and led the execution of numerous software systems, ensuring they meet their commitments.
Here is what some of our clients have to say about their experience of working with us.