Refactoring – “improving the design of existing code without changing its behavior” – is a key skill in developing software. These resources can help you improve.
If you just want practice with refactoring, choose some Exercises. If you’re just starting out, consider the E-Learning or Books section.
Related Resources: BDD, TDD (Test-Driven Development), CI/CD (Continuous Integration / Continuous Delivery).
[Disclosure: Note that I wrote some of the material mentioned below, and I work for Industrial Logic.]
Newest entries are bolded. [Last update 2020-08-04]
Exercises
- “Gilded Rose Refactoring Kata” [multiple languages]
- “Refactoring Challenge: The Amazing Maze” [Java]
- “Tennis Refactoring Kata” [multiple languages]
- “Video Store Refactoring” [Java]
E-Learning
- Industrial Logic’s Code Smells [multiple languages]
- Industrial Logic’s Refactoring [multiple languages]
Books
If you have to pick only one, go with Martin Fowler’s Refactoring: Improving the Design of Existing Code.
- Ambler, Scott W., and Pramod J. Sadalage. Refactoring Databases: Evolutionary Database Design, Addison-Wesley, 2006.
- Ellnestam, Ola, and Daniel Brolund. The Mikado Method, Manning, 2014.
- Feathers, Michael. Working Effectively with Legacy Code, Prentice-Hall, 2004. [multiple languages]
- Fields, Jay, et al. Refactoring: Ruby Edition, Addison-Wesley, 2009. [Ruby]
- Fowler, Martin, et al. Refactoring: Improving the Design of Existing Code, Addison-Wesley, 1999. [Java examples but mostly language-independent]
- Fowler, Martin, et al. Refactoring: Improving the Design of Existing Code (2/e), Addison-Wesley, 2018. [Updated, mostly language-independent but with Javascript examples]
- Kerievsky, Joshua. Refactoring to Patterns, Addison-Wesley, 2005. [Java]
- Wake, William. Refactoring Workbook, Addison-Wesley, 2003. [Java]
- Wake, William, and Kevin Rutherford. Refactoring in Ruby, Addison-Wesley, 2009. [Ruby]
Web Sites
- http://corgibytes.com
- https://martinfowler.com/tags/refactoring.html
- https://refactoring.com
- https://xp123.com/articles/tag/refactoring/
- https://refactoring.guru
Web Articles
- Belshee, Arlo. “Good naming is a process, not a single step“
- Cheung, Ka Wei. “How about a refactorthon?“
- Hill, Mike. “Large-Scale Refactorings“
- Hill, Mike. “Refactoring: Invert Dependency with Observer“
- Mäntylä, Mika. “A Taxonomy for ‘Bad Code Smells’“
- Industrial Logic, “Smells to Refactorings Cheat Sheet“.
- Zuill, Woody (with Llewellyn Falco). “Code Excellence For The Average Programmer – video of a session “Practical Refactoring, 2-Minutes to Better Code”.
Videos
- Metz, Sandi. “All the Little Things“
- Rutherford, Kevin. “Red, Green, … now what?!“
Tools
- Eclipse [Java]
- JetBrains: IntelliJ IDEA [Java], ReSharper [Visual Studio plugin for C#], RubyMine [Ruby]
- Microsoft Visual Studio [C#, C++]
[I welcome further suggestions of resources you’ve found useful. Thanks! – Martin Nadeau]
Original release: May 17, 2015.