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

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 VirtualBox
  • Windows: cygwin (Default install + 'Devel' package)
  • Windows: Visual Studio 2012 or later

  • For windows we highly recomend using a Linux virtual machine for your unit test environment. The Linux command line is very powerful for automating repetitive programming activities.

    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.
  • CppUTest gcc starter kit -- you may need to tweak the warn ing flags.
  • CppUTest Visual Studio starter kit -- you may have to tweak the project files.

  • 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.