Working Effectively with Legacy Code (Robert C Martin)

ClanBrandon Books
view more info on this item
click here for more details, find new or used items

Michael Feathers

Our price £17.99 (£35.99)
New from £17.92
Used from £17.09

Pages: 456 (Paperback)

ISBN: 0131177052

Pub: Prentice Hall

Pub date: 2004-10-07

Amazon.co.uk Sales Rank: 40915

Check for 3rd party sellers (new/used)

Reader Reviews:


5/5 stars

A very useful book (1/1 people found this helpful)

The biggest single problem I had when I moved from working for myself as a programmer back to the mainstream was dealing with other people's code. For nearly twenty years I only had to deal with my own code. Suddenly I had to understand and change other people's code. It was quite a culture shock, and one of the most difficult things I've done.

I wish I'd found Michael's book earlier, it would have helped ease the transition. Of course, not everyone else's code is legacy code, but even if you are not handling true 'legacy' code, this book will help you deal with the problems you face.

The book is in three parts. The first is a discussion of how you go about changing software that is badly structured and has complex interactions and side effects. Where do you start, and how do you make sure that you don't break things further down the convoluted chain of dependencies. The answer to the latter, of course, is testing, testing, testing, and the author makes a good enough case to persuade even the most sloth like to get into the testing mode.

The second part of the book is organised almost like an FAQ with chapters devoted to common problems like 'I don't understand the code well enough to change it'. This one crops up all too often, and is an excellent example of how the author doesn't avoid difficult questions. The final part of the book is a useful catalog of mostly pattern based techniques that can be used to break dependencies.

The book is well written and features clear examples that are written in either C++, Java, C and C#, and the problems caused by the different features, or lack of them, available to the different languages are discussed and work arounds suggested. I enjoyed reading this book.

Highly recommended!


5/5 stars

Excellent book (2/4 people found this helpful)

Got the book after attending one of the authors presentations. Excellent advice on how to apply TDD to existing code. Anyone involved in maintenance programming who wants to start using TDD within their project should give it a try.

4/5 stars

practical and helpful advice on testing (13/13 people found this helpful)

This book focuses on how best to treat existing, large and probably poorly designed code, when needing to add features. This is most likely to happen when you have big old code that needs maintaining, but a lot of the advice is directly applicable to open source projects that lack tests and documentation. Therefore this can be considered as a valuable addition to the literature on testing and refactoring.

The advocated approach is rooted in writing unit tests and refactoring. Each chapter is themed around a problem (e.g. "Dependencies on Libraries is Killing Me", "I Don't Understand the Code Well Enough to Change It"), and then a series of techniques are suggested. At the back of the book are a series of refactorings, specifically for dealing with large classes, with some platform specific approaches, such as C++ forbidding the use of virtual functions that resolve to subclasses in constructors.

The code is mainly in Java, with a large number of examples in C++, and a handful in C and C#. You can probably get by with just knowing Java.

To get the most out of this book, I would suggest having read Martin Fowler's Refactoring first. It would also help to be familiar with the JUnit Java testing framework, which is used for the testing examples throughout. If you don't already know JUnit, you can pick up enough knowledge from the many articles on the web, and you certainly don't need to have read a book on Test Driven Development.

A reasonable measure of the quality of a book such as this is if it changes the way you code. It did so for me, and I recommend this as another high quality book in the Robert C. Martin series.

4/5 stars

A guide to retrofitting unit tests to existing code. (6/10 people found this helpful)

The books definiton of Legacy code is code not covered by unit tests.
This book covers adding unit tests to existing code.
It has a set of techniques for changing code so that it is more suitable to be covered by unit tests.

Similar Products

Refactoring: Improving the Design of Existing Code (Object Technology Series)

Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin)

Test Driven Development (The Addison-Wesley signature series)

Refactoring to Patterns (Addison-Wesley Signature Series)

xUnit Test Patterns: Refactoring Test Code (Addison Wesley Signature): Refactoring Test Code

Categories

Amazon.co.uk places this book into the following categories:

Books -> Special Features -> Regular Stores -> Up to 50% off selected Computing & Internet Books
Books -> Special Features -> Regular Stores -> Paperback Deals
Books -> Subjects -> Computing & Internet -> Digital Lifestyle -> Online Shopping -> Amazon
Books -> Subjects -> Computing & Internet -> General
Books -> Subjects -> Computing & Internet -> Programming -> Languages -> C & C++ -> General AAS
Books -> Subjects -> Computing & Internet -> Programming -> Languages & Tools -> General AAS
Books -> Subjects -> Computing & Internet -> Programming -> Software Design, Testing & Engineering -> General AAS
Books -> Subjects -> Computing & Internet -> Programming -> General AAS
Books -> Subjects -> Computing & Internet -> General AAS
Books -> Refinements -> Language (feature_browse-bin) -> English
Books -> Refinements -> Format (binding_browse-bin) -> Paperback
Books -> Refinements -> Font Size (format_browse-bin) -> Regular Size

 

ClanBrandon Books | Prague airport transfer | Dreamweaver | Short Term Missions | English Teacher Jobs in the Czech Republic
Czech Republic | Operation Mobilisation | Czech Republic Map