
Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows with Prime
Try Prime
and start saving today with fast, free delivery
Amazon Prime includes:
Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited Free Two-Day Delivery
- Streaming of thousands of movies and TV shows with limited ads on Prime Video.
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
- Unlimited photo storage with anywhere access
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Refactoring: Improving the Design of Existing Code (2nd Edition) (Addison-Wesley Signature Series (Fowler)) 2nd Edition
Purchase options and add-ons
Fully Revised and Updated—Includes New Refactoring's and Code Examples
“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”–M. Fowler (1999)For more than twenty years, experienced programmers worldwide have relied on Martin Fowler’s Refactoring to improve the design of existing code and to enhance software maintainability, as well as to make existing code easier to understand.
This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape. Refactoring, Second Edition, features an updated catalog of refactoring's and includes JavaScript code examples, as well as new functional examples that demonstrate refactoring without classes.
Like the original, this edition explains what refactoring is; why you should refactor; how to recognize code that needs refactoring; and how to actually do it successfully, no matter what language you use.
- Understand the process and general principles of refactoring
- Quickly apply useful refactorings to make a program easier to comprehend and change
- Recognize “bad smells” in code that signal opportunities to refactor
- Explore the refactorings, each with explanations, motivation, mechanics, and simple examples
- Build solid tests for your refactorings
- Recognize tradeoffs and obstacles to refactoring
Includes free access to the canonical web edition, with even more refactoring resources. (See inside the book for details about how to access the web edition.)
- ISBN-100134757599
- ISBN-13978-0134757599
- Edition2nd
- PublisherAddison-Wesley Professional
- Publication dateNovember 30, 2018
- LanguageEnglish
- Dimensions0.8 x 7.4 x 9.2 inches
- Print length448 pages
Frequently bought together

More items to explore
From the Publisher

Refactoring is...
a disciplined way to clean up code that minimizes the chances of introducing bugs. Although it is focused on the code, refactoring has a large impact on the design of systems. It is vital for senior designers and architects, as well as professional programmers, to understand the principles of refactoring and to use them in their projects.
Editorial Reviews
Review
About the Author
Martin Fowler is Chief Scientist at ThoughtWorks. He describes himself as “an author, speaker, consultant and general loud-mouth on software development.” Fowler concentrates on designing enterprise software: exploring what makes a good design and what practices are needed to create one.
Product details
- Publisher : Addison-Wesley Professional; 2nd edition (November 30, 2018)
- Language : English
- Hardcover : 448 pages
- ISBN-10 : 0134757599
- ISBN-13 : 978-0134757599
- Item Weight : 1.6 pounds
- Dimensions : 0.8 x 7.4 x 9.2 inches
- Best Sellers Rank: #28,900 in Books (See Top 100 in Books)
- #4 in Object-Oriented Design
- #5 in Software Testing
- #20 in Software Development (Books)
- Customer Reviews:
About the author

For all of my career I've been interested in the design and architecture of software systems, particularly those loosely classed as Enterprise Applications. I firmly believe that poor software design leads to software that is difficult to change in response to growing needs, and encourages buggy software that saps the productivity of computer users everywhere.
I'm always trying to find out what designs are effective, what approaches lead people into trouble, how we can organize our work to do better designs, and how to communicate what I've learned to more people. My books and website are all ways in which I can share what I learn and I'm glad I've found a way to make a living doing this.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find the book's examples and concepts informative and helpful for refactoring. They describe it as a useful reference with great examples of following clean code guidelines. The book is well-written, concise, and easy to understand.
AI-generated from the text of customer reviews
Select to learn more
Customers find the book's examples and concepts informative. They find it a useful reference for refactoring, with great examples of following clean code guidelines. The content is helpful for identifying refactoring opportunities and the techniques to implement. Readers appreciate the depth of knowledge and technical precision of the author. Overall, they describe it as the best book on the topic, even for experienced programmers.
"...Other than that this book has taught me so much about refactoring and will be a go to book for the rest of my software development career." Read more
"Very solid pattern-oriented book. Must have for every software engineer." Read more
"...The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first..." Read more
"This is a comprehensive review of refactoring." Read more
Customers find the book easy to read and understand. They appreciate the concise writing style and clear explanations. The examples are practical but simple enough to focus on the core concepts. Readers also mention that the book is pattern-oriented and contains many diagrams.
"...Also, the book quality is high and there are lots of pretty diagrams if it matters for you (it certainly does for me)." Read more
"Very solid pattern-oriented book. Must have for every software engineer." Read more
"...This book is not a quick read but should be read in its entirety to really take in all that refactoring has to offer...." Read more
"...It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous..." Read more
Reviews with images

If you have the right 'why', you can bear almost any 'how'
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
- Reviewed in the United States on October 6, 2024This is a great book!
I'm a Java dev with 6yoe and I still learn from this book. There are some things I knew, some I forgotten or thought about but didn't know a proper name of and some I have never thought of. The language used is Javascript but it's syntax shouldn't be hard to follow.
Also, the book quality is high and there are lots of pretty diagrams if it matters for you (it certainly does for me).
- Reviewed in the United States on January 3, 2023Fantastic book and one that should be in every developers personal library. The depth of knowledge and technical precision the author has in regards to refactoring is immense. This book is not a quick read but should be read in its entirety to really take in all that refactoring has to offer. Refactoring has now become part of my everyday programming and development process.
There is only one thing I would change about the book and that is for the author to add the completed refactored code for some of the more complex methodologies to the end of each refactoring. Some of the refactoring methodologies can be quite extensive and by adding the completed refactored code to the end may help give a clearer picture of the information the author is imparting to the reader. Other than that this book has taught me so much about refactoring and will be a go to book for the rest of my software development career.
- Reviewed in the United States on July 7, 2024Very solid pattern-oriented book. Must have for every software engineer.
- Reviewed in the United States on October 27, 2023Code is written by humans, executed by machines. Live code is also read by (other) humans for about 10x more than the time it took to write it. This is where "refactoring" comes to play. It is sort of making continuous improvement to code so it is more readable. It is cleaning up cobwebs from the corners.
One of the most popular CS papers ever ("Hints for Computer System Design", 1983) suggests 3-step process about writing code - first, make it work; second, make it right; finally, make it fast". This book, a succinct second edition of a very popular first, is an excellent "show and tell" for the second part.
It has a catalog of "code smells" and an inventory of "refactoring tricks" mapped to each. The first edition had working Java examples. The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first version" of code. Apart from the content, the insights that pops out can only be gleaned from years of deep experience. One example, say, most developers encode a "phone number" attribute as string in the first attempt of modeling. Soon enough, one needs to add "spam rules", "blocking number", "area code" etc. That necessitates phone number to be 'refactored' from string (i.e., a primitive type) to its own object model (say, a class called PhoneNumber). The author cheekily refers to the former type of behavior as "stringly typed" variables. Word play is a hallmark of many good engineers I'd worked with, but it is also a phenomenal way to remember things. Humor shortens the retrieval curve.
What I liked most about the book is a broad adoption of "Paracelsus' Maxim" - the difference between a poison and something benign is the dose. Most of the refactoring pattens come in pairs. You can "extract function" from a big one, or "inline function code" if it is short, obvious and singularly used, say. You can "replace parameter with query" or "replace query with a parameter". The only unpaired pattern shows up with large/complex conditionals (say, a switch, or a multiway nested conditional with 'guard clause) - most/all of them are pain to read and should ideally be refactored, say, with "replace conditional with polymorphism". Live book site has 4 more patterns beyond the book.
I found the refactoring patterns could be of three principal dimensions - one, structure -- variable, method, class, conditional; two, usage and locality -- depending on how much they're used and if they are used within/outside the module (class); three, data and mutation -- there is a clear separation between refactoring a data (or, value) object/data passed as value- or reference; separating data (query) from command etc. On top of that, some of the refactoring could be thought of as "helping the original developer" (say, to modularize or DRY better) vs. "helping others who may read the code later".
When I read the first edition years ago, IDEs were not as robust nor opinionated enough about refactoring. These days, majority if not all the refactoring is done by default - one just needs to click to accept, say, extracting a method. It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous integration"/Kaizen etc. One could argue that lowers the importance of such book. While the IDE may do the grunt work, key decisioning remains with humans, for now. Especially since most refactoring could appear in polar opposites it is therefore even more important to understand the context - the "why" - which this book brilliantly lays out.
4.0 out of 5 starsCode is written by humans, executed by machines. Live code is also read by (other) humans for about 10x more than the time it took to write it. This is where "refactoring" comes to play. It is sort of making continuous improvement to code so it is more readable. It is cleaning up cobwebs from the corners.If you have the right 'why', you can bear almost any 'how'
Reviewed in the United States on October 27, 2023
One of the most popular CS papers ever ("Hints for Computer System Design", 1983) suggests 3-step process about writing code - first, make it work; second, make it right; finally, make it fast". This book, a succinct second edition of a very popular first, is an excellent "show and tell" for the second part.
It has a catalog of "code smells" and an inventory of "refactoring tricks" mapped to each. The first edition had working Java examples. The present one shows JavaScript ones. The examples are real-life but simple enough to not distract from the core - how to simplify the "first version" of code. Apart from the content, the insights that pops out can only be gleaned from years of deep experience. One example, say, most developers encode a "phone number" attribute as string in the first attempt of modeling. Soon enough, one needs to add "spam rules", "blocking number", "area code" etc. That necessitates phone number to be 'refactored' from string (i.e., a primitive type) to its own object model (say, a class called PhoneNumber). The author cheekily refers to the former type of behavior as "stringly typed" variables. Word play is a hallmark of many good engineers I'd worked with, but it is also a phenomenal way to remember things. Humor shortens the retrieval curve.
What I liked most about the book is a broad adoption of "Paracelsus' Maxim" - the difference between a poison and something benign is the dose. Most of the refactoring pattens come in pairs. You can "extract function" from a big one, or "inline function code" if it is short, obvious and singularly used, say. You can "replace parameter with query" or "replace query with a parameter". The only unpaired pattern shows up with large/complex conditionals (say, a switch, or a multiway nested conditional with 'guard clause) - most/all of them are pain to read and should ideally be refactored, say, with "replace conditional with polymorphism". Live book site has 4 more patterns beyond the book.
I found the refactoring patterns could be of three principal dimensions - one, structure -- variable, method, class, conditional; two, usage and locality -- depending on how much they're used and if they are used within/outside the module (class); three, data and mutation -- there is a clear separation between refactoring a data (or, value) object/data passed as value- or reference; separating data (query) from command etc. On top of that, some of the refactoring could be thought of as "helping the original developer" (say, to modularize or DRY better) vs. "helping others who may read the code later".
When I read the first edition years ago, IDEs were not as robust nor opinionated enough about refactoring. These days, majority if not all the refactoring is done by default - one just needs to click to accept, say, extracting a method. It has been a huge time saving and long-term benefit for collaborative work and fits very well within the philosophy of "continuous integration"/Kaizen etc. One could argue that lowers the importance of such book. While the IDE may do the grunt work, key decisioning remains with humans, for now. Especially since most refactoring could appear in polar opposites it is therefore even more important to understand the context - the "why" - which this book brilliantly lays out.
Images in this review
- Reviewed in the United States on August 18, 2024This is a comprehensive review of refactoring.
- Reviewed in the United States on September 17, 2023One of the best software developer books, If you have the challenge of redesign a software application this is the book you need to read but before buy it, make sure the application you are going to refactor has unit-tests, if not as the book mentioned first you need to read: Working Effectively with Legacy Code of Michael Feathers, read this book first and later read this one.
Thank you so much to Martin Fowler.
- Reviewed in the United States on March 9, 2024Best book related to this topic, examples are easy to understand.
Book arrived in perfect conditions to Bolivia.
- Reviewed in the United States on August 16, 2022This book is a quick read but is unusually clear and practical. I recommend it to everyone on my team and have see it change the way people program for the better.
Top reviews from other countries
- wataru oguchiReviewed in Canada on December 16, 2023
5.0 out of 5 stars Read this right now. It will change your behaviour.
I have been in the software development industry for more than 10 years. I met this book 5 years ago, and instantly thought I wish I had this book earlier in my career. Oh well, you can't turn back the clock.
Since then, I have kept recommending this book in my community. I even bought some copies for young developers to help their growth.
-
RafaelReviewed in Mexico on January 26, 2023
5.0 out of 5 stars Excelente libro
Muy buen libro, desde las primeras páginas me dio tips para realizar refactor en mis proyectos.
-
Marina SobotzikReviewed in Germany on February 18, 2025
5.0 out of 5 stars Sehr gutes Buch
Refactoring gut verständlich und mit Beispielen
- Francisco GiraldoReviewed in the Netherlands on December 30, 2024
3.0 out of 5 stars Cover is hard but the pages are very thin
The hard cover is good but the pages are so thin like a bible. They feel they can be damaged very easily.
-
LucaReviewed in Italy on September 10, 2024
5.0 out of 5 stars Un must per ogni programmatore
è un libro essenziale per chiunque sia coinvolto nello sviluppo del software. Mi è piaciuto particolarmente il modo in cui il libro affronta il refactoring in maniera sistematica, offrendo tecniche concrete per migliorare la qualità del codice esistente senza alterarne la funzionalità.
Il libro è ricco di esempi pratici che rendono chiari i concetti anche per chi non ha una grande esperienza in materia. Inoltre, le annotazioni di Kent Beck aggiungono ulteriore valore, fornendo una prospettiva aggiuntiva sui metodi agili. Ho usato questo libro principalmente per migliorare il design del codice in progetti legacy, e devo dire che ha cambiato il mio approccio al refactoring.
In sintesi, è un libro che ogni sviluppatore dovrebbe avere nella propria libreria, non solo per apprendere nuove tecniche
LucaUn must per ogni programmatore
Reviewed in Italy on September 10, 2024
Il libro è ricco di esempi pratici che rendono chiari i concetti anche per chi non ha una grande esperienza in materia. Inoltre, le annotazioni di Kent Beck aggiungono ulteriore valore, fornendo una prospettiva aggiuntiva sui metodi agili. Ho usato questo libro principalmente per migliorare il design del codice in progetti legacy, e devo dire che ha cambiato il mio approccio al refactoring.
In sintesi, è un libro che ogni sviluppatore dovrebbe avere nella propria libreria, non solo per apprendere nuove tecniche
Images in this review