The Agile Test Driven Development course lays the foundation for modern Agile development by teaching your team what unit testing is all about and how, if this is done properly, you can have the courage to design and write better code in a manner consonant with Agile principles. We can only break the back of Big Design Up Front by having a codebase that allows us to refactor our code relentlessly as the need arises. The only way to insure that we can refactor relentlessly, and not have heart palpitations about the unintended side effects of our changes, is to be able to insure that each and every check-in to the repository happens in a way that no functionality is changed unintentionally as we rethink our solutions to the new realities of what the application is to do as we learn more about it.
This course is a mixture of practice and principle. We discuss what testing is, and why unit testing is not testing as it is commonly perceived, but a coding practice. We get familiar with the fact that in an Agile setting, we adopt a no excuses policy when it comes to unit testing. We will learn the basics of JUnit, and how to use it effectively in an Eclipse environment. But since Test Driven Development is more than simply test first development, we also learn how to avoid the pitfalls of an Architecture Centric Development model, and how Test Driven Development allows the architecture to organically rise up from project needs, rather than be imposed by artificial up front thought on what design decisions we think we might need, especially given our lack of complete knowledge of what is actually needed at that stage. We teach the necessity to be aware of the Continuous Integration nature of most Agile projects, and the process for insuring that our code never "breaks the build". Appropriate XP coding practices are discussed and used. We also speak about what refactoring is, and how you know the need for it when you smell it. Practical use of the refactoring tools built into Eclipse is taught and practiced, but the emphasis is on learning how to accomplish thoughtful and more heavyweight refactorings. Finally, we discuss the importance of designing for testing and the role of the Inversion of Control pattern on the design of hard to test code (the stuff that has dependencies that might otherwise tempt lesser developers to shrink away from unit testing at all) in the realm of Test Doubles and their kindred sorts.
The course is taught with a mixture of lecture and labs. Later labs benefit from the designation of a central lab machine to be the repository for the class, but this can be avoided in situations where no networks are allowed. Students will use Java, Eclipse, JUnit and SubVersion during the course.
Topics Included
• Why Test First?
• JUnit, the TDD workhorse
• The TDD Rhythm
• Testing and its Impact on Architecture
• Using Test Doubles
• Refactoring Patterns and Anti-patterns
Course Details
Prerequisites: Agile Foundations, Java programming background and software deisgn
Audience: Developers
Duration: 3 Days
Lab to Lecture Ratio: 60/40
Course Outline
Day 1
Lectures
• What is testing? Why do we test? Who would have though that unit testing isn't testing as we normally think of it (after the fact), but a coding activity?
• Why bother with unit testing? What's to gain? What are the top ten reasons for not testing? Why none of that matters, as we now adopt a No Excuses Policy when it comes to coding and unit tests.
• Introduction to JUnit.
• Introduction to The Rhythm.
• What to test for, namely your RIGHT-BICEP.
• How TDD turns our old notions of how to develop on their head, and why this is a good thing.
• Are design and architecture merely bad 20th century memories? Are there situations where we actually do design first?
• Test Doubles versus The Nine Circles of Hell.
Labs
• Hello JUnit World and Beyond!
• Test First Development, brought to you by The Rhythm.
• TTT meets TDD, and has a mocking good time remembering who, what, and when.
Day 2
Lectures
• The importance of Simple Design and Relentless Refactoring
• What could possibly go wrong? Is it OK to stop with this testing madness now?
• Bringing Agility to the TDD process with XP practices.
• Translating Stories into Tests.
• The Pairwise Programming Game.
• SCM is not a 4 letter word and why we want it!
• The concept of Collective Code Ownership.
• The Teamsafe Process For Never Breaking The Build.
Labs
• Raising Our Comfort Level With SubVersion in an Eclipse environment.
• Test Driven Development With Agile Tendencies - Iteration 1 - Introduction to the Media Sharing Cooperative
Day 3
Lectures
• Why Refactor? The Zen of Refactoring. Refactoring as a path to clarity and understanding.
• What's that smell? Your code stinks!
• Refactoring support in Eclipse.
• Testing the Tough To Test and the Role of Designing Testable Code.
• The xUnit suite of tools.
Labs
• Test Driven Development With Agile Tendencies - Iteration 2 - Adding Functionality and Fixing Abominations.
• Test Driven Development With Agile Tendencies - Iteration 3 - Finally Getting It Right (this lab is optional, based on time constraints needed to fit in the certification examination)











