Legacy Change Algorithm

Michael defines the legacy code change algorithm as:

  1. Identify change points.

  2. Find test points.

  3. Break dependencies.

  4. Write tests.

  5. Make changes and refactor.

1. Identify Change Points

One bit of good news: Michael’s algorithm starts the way you always start to change legacy code; you have to find the parts of the existing code that you think you need to change.

2. Find Test Points

Once the change points are identified, consider how to test it. Where are the natural points to sense what is happening in the code, and where does the code get its inputs? Test points are most often evident in the seams formed by function calls.

Test points don’t have to be seams, as we will see in Test Points . Global variables, ...

Get Test Driven Development for Embedded C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.