Select the search type
  • Site
  • Web
Search

 
 
✓ Featured Content

AI Models Videos

A curated playlist of specific YouTube content.

Hands-on Workshop

Ready to Transform Your Scrum Team with AI?

Join the Generative AI for Scrum Teams Workshop

Stop wondering how AI fits into your Agile workflow. In this hands-on workshop, you'll learn exactly how to integrate AI tools into every sprint ceremony, backlog refinement session, and delivery cycle—without disrupting the Scrum framework that already works for your team.

What You'll Master:

  • AI-powered user story creation and refinement techniques
  • Automated test generation and code review strategies
  • Sprint planning acceleration with AI assistance
  • Real-world prompt engineering for development teams
  • Ethical AI integration within Scrum values

Perfect for: Scrum Masters, Product Owners, Development Teams, and Agile Coaches who want to boost productivity while maintaining team collaboration and quality.

Taught by Rod Claar, Certified Scrum Trainer with 30+ years of development experience and specialized AI-Enhanced Scrum methodology.

Search Results

Rod Claar

Step 3: TDD with AI — Keeping You in the Driver’s Seat

Use AI to accelerate Test-Driven Development (TDD) without surrendering design intent or engineering judgment.

Step 3: TDD with AI — Keeping You in the Driver’s Seat

Objective
Use AI to accelerate Test-Driven Development (TDD) without surrendering design intent or engineering judgment.

The goal is not to let AI write your tests blindly. The goal is to use AI as a thinking partner while you remain the architect of the code.


Learning Path

1. Re-establish the TDD Loop

Before introducing AI, anchor on the classic cycle:

  1. Red – Write a failing test

  2. Green – Write the simplest code to pass

  3. Refactor – Improve design safely

AI should support this loop, not bypass it.

Key rule:

Tests define intent. AI assists implementation.


2. Use AI to Generate Test Ideas

AI is excellent at producing test scenarios you may not immediately think of.

Ask AI questions like:


 

Generate unit test scenarios for this function.
Include edge cases, boundary conditions, and failure cases.

Example function:


 

def calculate_discount(price, percentage):
return price * (percentage / 100)

Possible AI-generated scenarios:

  • Normal discount case

  • Zero discount

  • 100% discount

  • Negative percentage

  • Very large price values

  • Rounding behavior

Your job is to evaluate which tests reflect real system behavior.

AI suggests.
You decide.


3. Write the Tests Yourself

Do not copy-paste AI-generated test code.

Instead:

  1. Review the AI test ideas

  2. Select the meaningful ones

  3. Write the tests manually

This preserves:

  • understanding

  • design clarity

  • debugging ability

Example:


 

def test_zero_discount():
assert calculate_discount(100, 0) == 0


4. Compare Your Tests With AI Suggestions

After writing your tests:

Ask AI:


 

Compare these unit tests with your earlier suggestions.
What cases might still be missing?

This is where AI shines as a coverage reviewer.

You may discover:

  • missing edge cases

  • input validation gaps

  • boundary conditions


5. Implement the Code to Pass Tests

Now return to the TDD loop.

Let the tests drive implementation.

AI can help with:

  • implementation suggestions

  • refactoring

  • simplifying logic

  • identifying duplicated code

Prompt example:


 

Given these tests, suggest a simple implementation that passes them.
Do not add features not required by the tests.


6. Use AI for Safe Refactoring

Once tests pass, AI can help identify design improvements.

Ask:


 

Refactor this code while preserving behavior verified by the tests.
Focus on readability and simplicity.

Your safety net:

The test suite.

If tests pass, refactoring is safe.


Exercise

Goal

Practice using AI to expand test coverage while maintaining developer control.

Step 1 — Pick a Small Function

Choose something simple:

  • string parser

  • calculation function

  • validation logic

  • utility method


Step 2 — Ask AI for Test Cases

Example prompt:


 

Generate unit test cases for this function.
Include edge cases and failure scenarios.


Step 3 — Write Tests Yourself

Do not copy the AI output.

Instead:

  • read the suggestions

  • select meaningful ones

  • write tests manually


Step 4 — Compare Gaps

Ask AI:


 

Compare my tests with the earlier suggestions.
What important cases might still be missing?


Step 5 — Expand Coverage

Add the missing cases you agree with.

Your final test suite should reflect:

  • real requirements

  • edge conditions

  • error behavior


Key Principle

AI improves test discovery.

Developers maintain design ownership.

A useful mental model:

Role Responsibility
Developer Defines intent and architecture
Tests Protect behavior
AI Suggests cases and improvements

You stay in the driver’s seat.

Previous Article Step 2 — Boundaries first: modules, seams, and dependency direction
Next Article Step 5: Code Generation with Guardrails
Print
21 Rate this article:
No rating
Please login or register to post comments.

Search

Calendar

«March 2026»
SunMonTueWedThuFriSat
22232425
262728
123456
7
891011121314
1516
17181920
21
2223
2425262728
2930311234

Upcoming events Events RSSiCalendar export

AI News

Categories