Test Driven Development (TDD) and Refactoring Workshop
Duration: 3 Days
The TDD and Refactoring Workshop offers a comprehensive, hands-on introduction to evolutionary design, clean code and automated testing.
Over the past decade, eXtreme Programming practices like User Stories, Test-Driven Development (TDD), Behavior Driven Developer (BDD), Refactoring, Continuous Integration and Automation have fundamentally changed software development processes and inherently how engineers work.
This workshop explores the foundations of TDD, unit testing, automated refactoring and improving the design of legacy code with the help of various patterns, strategies, tools and techniques. Students will learn essential test-first approaches via interactive discussions, multimedia content, hands-on exercises and quizzes.
Learning Outcomes
- Understand the thought process and steps involved during a typical test-driven session.
- Drive the development (design and implementation) of a User Story using automated tests.
- Discover improved confidence and increase in development speed by writing automated tests first!
- Identify poorly designed code by using our elaborate code smell vocabulary.
- Learn various automated refactoring techniques and strategies to carefully clean the identified code smells.
- Practice key techniques to break coupling between classes and micro-test each component independently.
- Incrementally transform complex and difficult classes into readable, well-structured, and well-designed code, while keeping them running at all times
Course Outline
- Unit Testing
- Philosophy of Developer Unit Testing
- Anatomy of Unit Testing Framework
- Automated Tests
- Overview of xUnit
- Levels of Testing
- Code Smells
- Common Code Smells
- Dealing with Code Smells
- Refactoring
- Purpose of Refactoring
- Refactoring Patterns
- Using Automated Refactoring
- Inside Out Test First – Test Driven Development
- Introduction to TDD
- Test First Vs Test Last
- TDD Rhythm: Red, Green, Refactor
- Crucial Design Principles
- Driving Design using TDD
- Different Styles of TDD
- Outside In Behaviour First – Behaviour Driven Development
- Driving Implementation and Design from Scenarios
- Creating an Application from Scratch using Scenarios
- Crafting acceptance criteria for user stories
- Writing executable examples for each criteria
- Documenting Scenarios with Gherkin
- Demo of BDD frameworks (Cucumber, FitNesse, SpecFlow, Jasmine)
- Automation Hazards
- Safe Automation Practices
- Beyond Basics
- Test Doubles/Fakes – Stubs, Mocks, Spy, Simulators…
- TDD in Legacy Code
- Breaking Dependencies in Legacy Code
- Patterns for writing effective tests
Additional Information – Inside Out and Outside In Test First
Test-Driven Development (TDD) is a practice for efficiently evolving useful code. While its name implies that it’s mostly about testing, test-driven development is primarily about design: it keeps programmers focused on exactly what they need to build and helps them avoid over-engineering. We’ll demonstrate the TDD Rhythm. Participants will understand how TDD simplifies evolving lean, useful, fully tested software.
We’ll give a small live demo of TDD and then Participants will get their hands dirty by using TDD on 3 different problems. We’ll conclude by highlighting the different styles of TDD.
Behavior-Driven Development (BDD) combines the general techniques and principles of TDD with ideas from domain-driven design and object-oriented analysis and design to provide software developers and business analysts with shared tools and a shared process to collaborate on software development, with the aim of delivering “software that matters”.
Although BDD is principally an idea about how software development should be managed by both business interests and technical insight, the practice of BDD does assume the use of specialized software tools to support the development process. Although these tools are often developed specifically for use in BDD projects, they can be seen as specialized forms of the tooling that supports test-driven development. The tools serve to add automation to the ubiquitous language that is a central theme of BDD.
Strongly Recommended
- 1 or 2 Days of Mentoring via Pair Programming with Developers on your code base
- To get your team kick-started with the learning from the workshop, we recommend, that our trainer spends a day or two, working with your team on your code base.
- Each day will be reserved for 4 pair programming sessions. During these sessions, the workshop participants will take specific examples from their projects, where they are finding it difficult to apply any of the practices learned in the workshop. The trainer will then pair with an individual to show how to resolve those challenges.
- At the end of the day, the 4 volunteers will summarize their learning by showing before and after code from their respective pairing session to the rest of the group.
- Pre-Post Programming Assessment
- The goal of these programming assessments is to identify real and quantifiable measures for the learning achieved through our workshop.
- Objective:
- Get a quick understanding of your knowledge and skill level with respect to Designing & Programming
- Establish a baseline against which the effectiveness of the workshop may be measured
- Customize our workshop based on specific areas identified in this assessment
- Pre-Assessment: Before the workshop, we’ll send a problem description, your developers will spend max 4 hours and solve the problem and send us the code. We’ll evaluate the code and send you detailed feedback about the code, including areas for improvement. We can send different types of problems (fresh development, cleaning up existing code and so on.)
- Post-Assessment: 2 week after the workshop, we send another problem and evaluate the solution code. A comparison between the Pre and Post Assessment should be able to clearly quantify per-participant level improvement.
- Click on the image to download the sample report…
Method of Instruction
- Interactive Dialogues, Programming Exercises, Demos, and Instructional Games
Transfer %
- Knowledge: 50%, Skill-Building: 50%
Target Audience
- Primary: Sr. Object-Oriented Programmers, Architects, and Designers
- Secondary: Technical Managers, Business Analysts, Testers, Technical Writers
Course Level
- Intermediate to Advanced
Course Prerequisites
- Required: some understanding of OO concepts and an OO language
- Highly Recommended: basic understanding of the life-cycle of software projects
Development Tools
Java
- Latest Java JDK
- Latest Standard Eclipse OR IntelliJ Idea
- JUnit, Mockito, JBehave, FitNesse or Cucumber JVM
C#
- Latest .Net Framework
- Latest Visual Studio
- Latest ReSharper Plugin
- SpecFlow‘s Visual Studio IDE Integration or FitNesse
JavaScript
- Latest WebStorm JavaScript IDE
- Latest Chrome Browser
- Latest Jasmine Framework
- Latest JsTestDriver
C/C++
- Latest Eclipse CDT OR Visual Studio
- Latest GTest
Ruby
PHP
Flex
- Latest Flex SDK
- Latest Flash Builder OR IntelliJ Idea
Our Trainings
+ Mastering Agile Scrum
+ Certified Scrum Master
+ Certified Scrum Product Owner
+ PMI Agile Certified Professional (PMI – ACP)