Testing - TDD - AI or barbarism
- TDD - AI
Why we test
Every change costs
a little more.
The cost of change
Accidental complexity.
Tests and software quality
How do I refactor?
The same behaviour before and after.
Testing fundamentals
Check the
behaviour.
Compiler and static analysis
Automated tests
Testing fundamentals
Types of testing
Manual · Automated
Functional · Non-functional
Test distribution
The test
pyramid.
E2E
Integration
Unit tests
Test distribution
Other ways to
distribute tests.
Acceptance tests
Does it satisfy the
business rule?
Link the acceptance criteria to the test.
Unit tests
One unit.
One behaviour.
Fast
Isolated
Atomic
Maintainable
Deterministic
Readable
Test-driven development
Why TDD?
Red
See the expected failure
Green
Make the case pass
Refactor
Review the design
Example · 2 + 2
First, red.
const sum = () => 0;
expect(sum(2, 2)).toBe(4); Expected: 4 · Received: 0
Example · 2 + 2
Make it pass.
Then refactor.
const sum = () => 4;
expect(sum(2, 2)).toBe(4); const sum = (a, b) => a + b;
expect(sum(2, 2)).toBe(4); Pass · 2 + 2 = 4
What about AI?
Do we still need TDD?
Model, harness, agent and environment
What is an agent?
- Model
- Generates responses from context.
- Harness
- Connects the model to the environment and runs tools.
- Agent
- A model and harness operating in an environment.
- Environment
- The files, services and resources it interacts with.
Agents · Skills, tools and MCP
What can it use?
Skill · How we want to work
Tool · An action the agent can take
MCP · Connect tools and resources
How we work as a team
The change is cultural.
“Simplicity is the ultimate sophistication.”Attributed to Leonardo da Vinci