You are previewing Working Effectively with Legacy Code.
O'Reilly logo
Working Effectively with Legacy Code

Book Description

Get more out of your legacy systems: more performance, functionality, reliability, and manageability

Is your code easy to change? Can you get nearly instantaneous feedback when you do change it? Do you understand it? If the answer to any of these questions is no, you have legacy code, and it is draining time and money away from your development efforts.

In this book, Michael Feathers offers start-to-finish strategies for working more effectively with large, untested legacy code bases. This book draws on material Michael created for his renowned Object Mentor seminars: techniques Michael has used in mentoring to help hundreds of developers, technical managers, and testers bring their legacy systems under control.

The topics covered include

  • Understanding the mechanics of software change: adding features, fixing bugs, improving design, optimizing performance

  • Getting legacy code into a test harness

  • Writing tests that protect you against introducing new problems

  • Techniques that can be used with any language or platform—with examples in Java, C++, C, and C#

  • Accurately identifying where code changes need to be made

  • Coping with legacy systems that aren't object-oriented

  • Handling applications that don't seem to have any structure

This book also includes a catalog of twenty-four dependency-breaking techniques that help you work with program elements in isolation and make safer changes.

© Copyright Pearson Education. All rights reserved.

Table of Contents

  1. Title Page
  2. Copyright Page
  3. Contents
  4. Foreword
  5. Preface
  6. Introduction
  7. Part I: The Mechanics of Change
    1. Chapter 1: Changing Software
    2. Chapter 2: Working with Feedback
    3. Chapter 3: Sensing and Separation
    4. Chapter 4: The Seam Model
    5. Chapter 5: Tools
  8. Part II: Changing Software
    1. Chapter 6: I Don’t Have Much Time and I Have to Change It
    2. Chapter 7: It Takes Forever to Make a Change
    3. Chapter 8: How Do I Add a Feature?
    4. Chapter 9: I Can’t Get This Class into a Test Harness
    5. Chapter 10: I Can’t Run This Method in a Test Harness
    6. Chapter 11: I Need to Make a Change. What Methods Should I Test?
    7. Chapter 12: I Need to Make Many Changes in One Area. Do I Have to Break Dependencies for All the Classes Involved?
    8. Chapter 13: I Need to Make a Change, but I Don’t Know What Tests to Write
    9. Chapter 14: Dependencies on Libraries Are Killing Me
    10. Chapter 15: My Application Is All API Calls
    11. Chapter 16: I Don’t Understand the Code Well Enough to Change It
    12. Chapter 17: My Application Has No Structure
    13. Chapter 18: My Test Code Is in the Way
    14. Chapter 19: My Project Is Not Object Oriented. How Do I Make Safe Changes?
    15. Chapter 20: This Class Is Too Big and I Don’t Want It to Get Any Bigger
    16. Chapter 21: I’m Changing the Same Code All Over the Place
    17. Chapter 22: I Need to Change a Monster Method and I Can’t Write Tests for It
    18. Chapter 23: How Do I Know That I’m Not Breaking Anything?
    19. Chapter 24: We Feel Overwhelmed. It Isn’t Going to Get Any Better
  9. Part III: Dependency-Breaking Techniques
    1. Chapter 25: Dependency-Breaking Techniques
  10. Appendix: Refactoring
  11. Glossary
  12. Index