TDD / Legacy Code Classes

TDD Foundations

3 days

The best place to start for most development teams. This class covers TDD fundamentals, sustainable tests, refactoring/continuous design, test doubles/mocks, and–what every developer wants to learn–how to start rescuing your legacy code.

» details

TDD Foundations (3 days)

Test-driven development (TDD) helps developers craft and sustain a high-quality code base. TDD complements agile processes such as Scrum particularly, but it can also provide you with numerous benefits if you’re not at all agile.

In this course, you’ll obtain a solid foundation for doing test-driven development (TDD). You’ll learn:

how continual attention to design simplifies your work and extends the life of your software

how TDD encourages continuous design improvement

how to craft tests that help you understand and control a higher-quality system

how to deal with troublesome dependencies that can make unit testing tough

how to tackle the tough challenges of a legacy code base (pretty much every developer’s reality)

specific concepts and themes for approaching the high risk of a legacy codebase

how to manage a larger refactoring in a legacy codebase using the Mikado method

TDD Jump-Start

2 days

This fast-paced class provides a solid foundation for the agile technique of test-driven development (TDD). Core class topics include the basic TDD cycle, maintainable tests, continuous design, and dependency management with test doubles.

» details

TDD Jump-Start (2 days)

Test-driven development (TDD) helps developers craft and sustain a high-quality code base. TDD complements agile processes such as Scrum particularly, but it can also provide you with numerous benefits if you’re not at all agile.

In this course, you’ll obtain a solid foundation for doing test-driven development (TDD). You’ll learn:

how continual attention to design simplifies your work and extends the life of your software

how TDD encourages continue design improvement

how to craft tests that help you understand and control a higher-quality system

how to deal with troublesome dependencies that can make unit testing tough.

Topics Covered

Overview of Test-Driven Development

– Red-green-refactor

Basic TDD technique

Your Unit Testing Tool

TDD and design

– What’s the next test?

Uncle Bob’s TPP (overview)

Test smells

Code katas

Refactoring and design

Refactoring drivers

– Code smells

– Simple design

– Classic design principles

Basic refactoring

Additional catalog refactorings

Macro refactoring

– Backing into tests

Basic “mock” technique

– Test double variants

– Implementing test doubles

– Mock injection techniques

Additional test double topics

– Using mock tools

– Challenges/best practices

Sustaining and Succeeding with TDD

» hide details

Conquering Legacy Code

3 days

Get your legacy codebase under control! Immerse in a three-day workshop of hands-on techniques, themes, and concepts to help you conquer your legacy code.

» details

Conquering Legacy Code (3 days)

In this three day class, you'll transition a difficult legacy codebase into something that is highly maintainable and a joy to work with. You'll learn how to write characterization tests for challenging code by using numerous techniques for safely breaking dependencies. You'll also learn techniques for managing large-scale, invasive code refactoring.

Topics Covered

Review: TDD & refactoring

Legacy code defined

Legacy "quick start"

Legacy themes

Sprout method / sprout class

Characterization testing

The legacy change algorithm

Effects analysis

Static code analysis guidelines

Hotspot analysis

Breaking dependencies

Seams

Safety techniques:

- Safe refactoring

- Preserve signatures

- Leaning on the compiler

Dependency breaking techniques:

- Expose static method

- Extract and override call

- Parameterize constructor

- Extract and override factory method

- Extract interface

- Adapt parameter

Legacy strategies

Large-scale legacy refactoring

- The Mikado Method

» hide details

Continuous Design with TDD

2 days

What does it mean to constantly address design while building code? In this class we will all jointly develop a small codebase, Randori style. You'll contribute to the continuous design decisions needed to grow a healthy system while having fun in a fun, slightly boisterous but safe and comfortable environment.

» details

Continuous Design with TDD (2 days)

Topics Covered

The value of up-front design

The TDD cycle

- TDD schools

Test-first vs. test-after

Simple Design

- Incrementalism

- Minimizing duplication

- Maximizing expressiveness

- Minimizing speculative design

Other design heuristics

- Code smells

- SOLID

- Design patterns

Refactoring

Dependency management

- Test doubles / mocks

Measuring design health

Sustaining quality

» hide details

Teaching TDD

2 days

Create effective, scalable TDD training for your organization.

» details

Teaching TDD (2 days)

Are you part of a training organization in a larger company? If so, you're no doubt weighing the cost of hiring third-party TDD trainers against building and delivering internal training.

TDD is a tricky beast. Consider the perspective of seasoned, sharp developers: They've achieved some level of success in their career, yet the TDD training they're asked to attend challenges the techniques that they've ingrained and used to achieve that success. Getting developers to move out of their comfort zone and accept that there's something potentially better requires a deft approach.

I've been doing TDD for over 16 years, and I've taught it successfully to hundreds of students. In this class, I'll share my best secrets about designing and delivering effective TDD training. I'll provide you with the information you'll need to begin creating your own test-driven development courseware.

Topics Covered

Ice Breakers

Create a Safe, Effective Learning Environment

Physical Considerations

Minimizing Angst

Dealing with Dissent

Solid Answers to Inevitable Questions

Essential TDD Topics

Topic Breakdowns: Discussion, Demo, Exercise, Review

What First?

Designing Appropriate Exercises

Facilitating Classrooms with Pairing

Facilitating Katas

Facilitating Randoris

Facilitating Group Activities

Emphasizing TDD Benefits while Resisting Overselling

The Cost of Course Design

An Agile Approach to Course Design

Presentation Recommendations

Feedback Mechanisms

Effective Evaluations

» hide details

TDD Masters Series

The TDD Masters Series is a 5-class curriculum designed to help developers to learn test-driven development in a manner that emphasizes retention by practice, and in a configuration that’s compatible with their work demands.

Developers start with the one-day TDD Fundamentals class, applying what they’ve learned in the subsequent week to their day-to-day work (optionally assisted by a coach). They return to the classroom each week to complete all five of the one-day classes in the series. Each subsequent class begins with a review of prior week material and experiences.

1 | TDD Fundamentals

1 day

Provides a solid foundation in core TDD concepts and technique.

» details

TDD Fundamentals (1 day)

Topics Covered

The TDD Cycle

TDD Fundamentals

TDD Mindsets: Doing TDD Well

Pairing on TDD Fundamentals

Test-after vs Test-first

TDD Schools and Variant Approaches

Test Naming

What’s the Next Test?

Overview of the Transformation Priority Premise (TPP)

TDD Kata

Test Smells

Improving Tests

TDD and Continual Design

Refactoring Basics

Miscellaneous (as appropriate):

– BDD

– Ten-minute Rule

– Code Coverage

– Testing Private Behavior?

Sustaining TDD

» hide details

2 | Test-Driven Refactoring: Continual Design

1 day

Learn an incremental/iterative approach to growing out a system, using a constant focus on design concepts.

» details

Test-Driven Refactoring: Continual Design (1 day)

Topics Covered

Architectural Concepts in Agile

Accommodating Continuous Design via TDD

Simple Design Rules

SOLID Class Design Principles

Code Smells

Test Doubles and Dependency Management

Incrementalism and the TPP

Private Behavior and the SRP

» hide details

3 | Test Doubles

1 day

Teaches students how to manage dependency issues when practicing test-driven development by using test doubles.

» details

Test Doubles (1 day)

This class initially demonstrates the construction of test doubles in a hand-coded fashion. After students understand the rudiments of building test doubles themselves, they will go on to use a tool to assist with the creation of test doubles. In Java, the preferred tool is Mockito, although customers can request the introduction of alternate tools.

Topics Covered

Testing Challenges

Test Doubles

Test Double Terminology

- Mocks, stubs, fakes, spies

Test double implementation

Self shunt

Dependency injection

Factory-based injection

Override-based injection

Injection tools

Mock tools

Mock tool caveats

Test double motivations

London school

Classic school

School of moderation

Design considerations

» hide details

4 | Tackling Legacy Code

1 day

Get your legacy codebase under control! A one-day workshop to get your feet wet with hands-on techniques, themes, and concepts to help you conquer your legacy code.

» details

Tackling Legacy (1 day)

You'll work with an existing code base throughout the day in a series of exercises designed to mirror the challenges you see in day-to-day development against a legacy codebase.

Topics Covered

Review: Test-driven development and refactoring

Legacy code

Legacy "quick start"

Sprout method / sprout class

Characterization test

Legacy change algorithm

Effects analysis

Exercise

Breaking dependencies

Seams

Safety techniques:

- Safe refactoring

- Preserve signatures

- Leaning on the compiler

Expose static method

Extract and override call

Parameterize constructor

Extract and override factory method

Extract interface

Adapt parameter

Legacy strategies

Mikado Method overview

» hide details

5 | Advanced TDD

1 day

You're ready to move on to mastery! Learn some techniques for getting the most value out of test-driven development (TDD) now that you've mastered the fundamentals of TDD.

» details

Advanced TDD (1 day)

Topics Covered

Test naming and organization

Test Smells

Test Patterns

Specification by Example

Testability and Design

Incrementalism in TDD

The Transformation Priority Premise (TPP)

Successful Approaches to Mocking

Simple Standards

Hardcore Refactoring

Design and TDD

Simple Design

Practice, Paraphrase, Pair

Professionalism in TDD

» hide details

Additional Technical Classes

Fitnesse Programming Crash Course

2 days

Immerse in understanding and building Fitnesse fixtures!

» details

Fitnesse Programming Crash Course (2 days)

Fitnesse combines the ease of use of a Wiki with the power of being able to define acceptance tests via a series of tables. Fitnesse tests can act as the negotiation point between programming and the business. This course will get you embarked on using Fitnesse effectively within your organization. Be prepared for lots of hands-on coding!

Note that the default configuration for this class is the SLIM test runner. I can also deliver it for FIT fixture development.

Currently I am able to support Java and C# fixture development. If you're looking to develop fixtures in other languages, such as Ruby, C++, or Python, I can build support within a reasonable time frame--please don't hesitate to ask!

Topics Covered

Fitnesse overview

Downloading and Installing Fitnesse

Using the Fitnesse Wiki

The value of a Wiki

Organizing Pages in Sub Wikis

Building Test Tables

Escaping Tables

Page Properties

Finding Fixtures with the Classpath

Running Tests

Decision Tables

Comment Tables

Passing Arguments to Fixtures

Query Fixtures

Debugging Fixtures

Data Types and Parse Delegates

Action Fixtures

Special Purpose Fixtures

Summary Fixtures

Script Tables

Scenario Tables

Custom Fixtures

Using Virtual Wikis

Negotiating Tests

Fitnesse Design Strategies

» hide details

Developer Testing in Clojure

1 day

Get your Clojure code under test! Learn the best strategies for testing in a Clojure codebase: When to use REPL-driven development, unit testing/TDD, and integration testing; how to design tests for readability and maintainability.

» details

Developer Testing in Clojure (1 day)

Topics Covered

The value of unit testing Clojure code

- REPL-driven vs. test-driven

- test-first or test-after?

- Documenting the shape of things

- with-test

clojure.test basics

- First tests: deftest, testing, is, are

- Using thrown? to expect

Running tests

- repl testing

- lein-test-refresh

- leiningen test selectors

Using fixtures

- once and each

Custom assertions using test-is

Project organization

Testing private functions?

Stubbing functions using with-redefs

Spying using with-redefs

Using a mocking framework

- meredydd/expect-call

Midje

- Facts & checkables

- Running autotest in the repl

- Combining with clojure.test

- Metaconstants

- Using regular expressions

- Built-in checkers

-- truthy and falsey

-- contains

- Mocking with prerequisites

- Background prerequisites

SpeclJ for BDD

Generate Tests Using test.generative

Best practices

- Test granularity

» hide details

Not seeing training on the topic you need?

You might be looking for a non-technical class. Refer to the Process Training page for information on the following training topics:

Agile in a Flash

BDD / Specification by Example

Cucumber

Distributed Development

Fitnesse

User Stories

If it’s in the agile space, chances are good that we can create and deliver a customized class. Call Jeff at +1-719-287-GEEK, or use the contact form at the bottom of the page.