TDD and refactoring can help you write cleaner,
clearer code, faster. You can produce
nearly bug-free code that is much easier to extend and maintain.
As useful as this is for new code, it can be a lifesaver
for legacy code.
Once you get the hang of it, TDD is also more fun. It is,
as they say, infectious. But don't take our word for any of
these claims. Take the course and see for yourself.
Our 3-day course covers the basic tools and techniques for doing TDD.
The class at our facilities is conducted in
Java, using JUnit and a good refactoring Java IDE.
On-site versions of the course are also
available in other OO languages. Short morning lectures are followed by
hands-on programming sessions. You start using TDD as soon as possible,
and for as long as possible each day.
You'll learn to write good tests, organize them
clearly, and work in tiny increments of design/test/code/refactor.
You'll learn to retrofit tests into legacy code without
destroying pressing production schedules.
We supply example code and tasks that enable you to explore TDD and refactoring
challenges and techniques thoroughly. But we try to design our on-site classes
around the use of your actual production code as much as we can.
Note: Course contents are subject to improvement without notice. :-)
|
Day
|
Time
|
Contents
|
|
Day 1
|
09:00 - 09:30
|
Brief Intro
· TDD: How can this possibly work?
· Refactoring
· A New Way of Working
· New Code vs. Old Code
|
|
09:30 - 12:00
|
· JUnit Basics
· Write tests for the "Trivia Game" example
|
|
12:00 - 13:00
|
Lunch
|
|
13:00 - 13:30
|
Refactoring
· Refactoring in baby steps
· Code "smells" in test-last exercise
· Fixtures and Test Suites
· The Rhythm: a little test, a little code, a little refactoring.
|
|
13:30 - 14:00
|
Refactor code from initial exercise,
using fixtures and test suites.
|
|
14:00 - 17:00
|
Use full-up TDD/refactoring to extend
the trivia game example.
|
|
Day 2
|
09:00 - 10:00
|
Taking it Deeper
· Fakes and Mocks
· Static vs. Dynamic Mocks
· Interfaces Are Key
|
|
10:00 - 12:00
|
Next Steps for The Trivia Game
· Persisting to a Flat File
· Mocking a Flat File Statically
· Mocking a Flat File Dynamically
· Additional Features (as time permits)
|
|
12:00 - 13:00
|
Lunch
|
|
13:00 - 16:00
|
Applying Mocks to the Trivia Game
· Persisting to a DB
· Mocking the DB
· Additional Features (as time permits)
|
|
16:00 - 17:00
|
Retrospective
· Static vs. Dynamic experiences
· Cost-benefit analysis
· Lessons learned
|
|
Day 3
|
09:00 - 10:00
|
Dealing With Legacy Code
· Duplication and Dependencies
· Retrofitting Tests
· Bite-sized Chunks
· Go Straight for the Pain
|
|
10:00 - 12:00
|
Writing Tests for Legacy Code
· Break into teams
· Select local production code
· Each team gets different code
|
|
12:00 - 13:00
|
Lunch
|
|
13:00 - 16:00
|
Continue With Legacy Code Exercise
|
|
16:00 - 17:00
|
Retrospective
· Bring in the managers
· Team leaders present results
· Lessons learned
· Next steps?
|
|