Legacy Code Workshop

The legacy code workshop is designed to help your team take TDD from the classroom back to their daily work. This is an add-on to our TDD training courses, or can be stand alone. The workshop can be delivered with remote or on-site facilitation.

It works like this: you choose some existing legacy function to call (or class to instantiate). As a group, our coach guides you through the Legacy Code Change Recipe. Reacting to one problem at a time, we drag your code into the test environment, carefully dealing with the problems that cause your code to resist being tested.

In on-site workshops, after going through the recipe with the whole group, we may team-up people from similar technologies, compilers, products, and processors so they get more legacy code into the test environment. People work together share knowledge and discoveries in the workshop.

What's the goal of the workshop?

To shorten the time it takes for people to get their code into test harness, so they can use unit testing and TDD immediately in their daily work.

What is the criteria for choosing code to work on in the workshop?

We start by choosing a single function, or class to test. The code chosen for the workshop should meet these criteria. The criterial are in priority order.

  1. The code you choose should be important. -- This means it is actively in development, about to be changed, recently changed or just developed.
  2. It is representative of your code and the kinds of dependencies your code has. -- though probably not the most challenging code you have.
  3. The people in the workshop are familiar with the code. -- if this is not the case, that is OK. This activity will help us learn the code.

Workshop Starting Point

  • Test environment is checked into your code base.
  • There is a single test with a hard coded failure, demonstrating that the test runner gives expected results.
  • The test build has access to production code and execution environment header files.
  • The test build can do a clean build in a few seconds.
  • At least one participant has the environment on their machine (more than one is better).
  • Changes can be commited to your source repository.

Legacy Code Workshop Tooling

A couple weeks before an on-site course, we'll meet to discuss your off-target test environment.

Embedded C and C++ Off-Target Development Environment Options

You will need one of these off-target build and execution environments:
  • Linux: gcc or clang
  • Mac: gcc or clang
  • Windows: Linux virtual machine running in Docker
If you do not already have a unit test harness chosen, James suggests CppUTest. He is one of the authors. We can work with whatever you choose, though if you are beginners we can provide more help during the workshop with CppUTest. You can always switch to another test harness ass you learn more and grow your skills.

Non-Embedded C/C++Workshops

  • Likely that no special build tools are needed
  • Install the test harness of your choice and get a simple example test running

Starter kits for C and C++

James provides starter kits and instructions for getting a CppUTest environment set up.

You will also want to clone legacy-build script, for use in the workshop.

Why do I need different development tools for the legacy code workshop?

Unless you are a special case, your target build and execution environment is slowing you down. One goal of our TDD training and workshop is to help you get your code off the target for unit testing. We'll discuss many advantages during the course. In this training we'll start to reduce the impact of the target hardware bottleneck from your daily work.