| |
|
|
Test Driven Development (TDD), one of the most profound eXtreme Programming practice, which has been adopted by nearly all the Agile methods. While there is such huge acceptance and appreciation for this practice, a lot of new teams struggle understanding and implementing this practice at work.
This 3-day workshop teaches you the thought process and the steps involved during a typical Test Driven session. You'll understand how developers take a user story and drive the development (design and implementation) using acceptance tests and unit tests. We'll discuss various techniques of TDD and their implications on the resultant code and its design. And you will discover just how much confident, faster you can go by writing test first!
Good object-oriented design principles are emphasized throughout. You will learn how to keep your designs clean and simple by applying those design principles through various refactoring techniques. You will learn how to identify poorly designed code by using our elaborate code smell vocabulary. Once we've identified the code smell, you understand how to apply refactorings techniques to simplify the code. You will learn to incrementally transform complex and difficult classes into readable, well-structured, and well-designed code, while keeping them running at all times. You will also learn how to take advantage of the automated refactoring support available in the IDEs.
As you participate in our hands-on environment, you will learn how to approach design from the outside-in; one test case at a time, driving the system to better and simpler design while it continues to pass all its tests. You will learn how unit tests and acceptance tests can be used to incrementally grow well-factored systems that are easy to understand and maintain.
|
Objectives
|
By the end of this workshop, you will be able to:
- Understand Automated Unit and Acceptance Testing Techniques
- Perform test -first development for user stories on your project
- Recognize poor code constructs and build a common vocabulary of code smells
- Understand OO design principles and Improve design of existing code in small safe steps
- Use the xUnit framework (Junit/Nunit) for unit testing
- Know how and when to refactor
- Write executable requirements using Acceptance Tests
- Know how and when to use Mock objects and other testing patterns
- Know how to deal with Legacy Code (code without tests)
|
Course Outline
|
- Automated Unit Testing and xUnit Framework
We'll cover the philosophy of developer unit testing, provide a detailed overview of xUnit framework, including how to write and organize tests, which assert methods to use, how to deal with exceptions within tests and test naming conventions. All these techniques are introduced using the unit testing tools available in an Integrated Development Environment (IDE) like eclipse. A small presentation will be followed by a demo and lots of discussion.
- Test-Driven Development
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 to extend the demonstration code.
- Code Smells
Code smells identify common design problems in object-oriented code. This
interactive lecture provides a good overview of code smells defined by Martin
Fowler & Kent Beck in their book "Refactoring: Improving the Design
of Existing Code." In addition, you'll learn about some new smells that
have been categorized by Joshua Kerievsky and his colleagues.
Technical lecture with lots of code snippets. Followed by an exercise to identify code smells on a sample code base.
- Refactoring
Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. We'll demonstrate how using automated Refactoring tools available in IDEs we can evolve the design of existing code using a series of small behavior preserving transformations. We'll cover most common refactoring techniques listed in Martin Fowler's classic catalog of refactorings.
Technical lecture with lots of code snippets. Followed by a lab exercise.
- Acceptance Test Driven Development
Acceptance TDD involves writing one or more systems-level acceptance tests (or "customer unit tests") from a customer's perspective, before coding the solution.
This practices encourages collaboration on the team by bringing together product management, developers, and testers at the start
of each feature to clarify and align on its goals. This workshop highlights the importance of speaking a common, useful, and relative unambiguous language and how to create requirements as executable tests. This workshop explains what happens between writing user stories and convert them into working
software. Details about Acceptance Criteria and Acceptance tests using
FitNesse and FitLibrary are described in this workshop. We'll also cover
Patterns and Anti-Patterns associated with ATDD.
To understand the essence of TDD and how it applies to customer level end
to end tests, we'll take some scenarios and explain how to write acceptance
criteria and tests for the same. Will conclude with an exercise where the
participants will write acceptance tests for a given problem.
- Test Doubles
Implementing TDD on real world projects often calls for introducing Test Doubles: Fakes, Stubs, Mocks, Spys, etc. When writing test and production code, it's useful to know when to introduce test doubles and which situation requires which flavor of test doubles. This workshop will help you understand the philosophy and frameworks associated with Integration based testing. To fully understand mock objects, you need to get your hands dirty. We'll give you a lab exercise where you'll build a small application using a mocking framework
- Test Driving Enterprise Code
Test-driving enterprise code isn't easy. In this workshop we'll dive right
into the deep end of enterprise applications. You will learn how to apply the
techniques of test-driven development to enterprise components, including
handling web requests, accessing databases and asynchronous communication.
We'll leverage on lightweight containers like Spring to demonstrate these
techniques. For the whole workshop to be of any use one must focus on learning how to
practice TDD in real world not on simple money example. During this workshop
we'll demo these topics in details and follow it up with a lab.
- Refactoring Fest : Clean up Legacy Code
To refactor code, we need a safety net of tests. But for legacy application
which have no tests of any form, how do we refactor the code? Most real world
projects are today in this state. This hands-on workshop attempts to provide
some guidance to help participants understand how to go about refactoring
legacy projects. We'll apply the lessons learnt from books like:
- Refactoring: Improving the Design of Existing Code: Martin Fowler
- Refactoring to Patterns: Joshua Kerievsky
- Working Effectively with Legacy Code : Michael Feathers
We'll provide the participants with a hands-on-experience of real world
refactoring by taking an open source project with absolutely no tests and
refactoring it
- 3 day workshop Retrospective
We'll wrap up the 3 day Testing and Refactoring workshop with a
retrospective to understand what worked, what could be improved next time and
what kind of topics might be interesting if we conduct similar training
again.
|
Software Required: |
- Java :
- .Net
We also need a web server and a web application. We have this pre-configured with some code modifications. Hence we'll bring that along with us during the training.
Note: Before deciding on the training and its agenda, 3-4 members of your team will have to take up a programming assessment. Based on the review of the solutions sent, we can finalize the exact content and duration for each topic.
|
|
|