Refactoring in Ruby (Google eBook)

Front Cover
Pearson Education, Oct 15, 2009 - Computers - 288 pages
0 Reviews

The First Hands-On, Practical, All-Ruby Refactoring Workbook!


Refactoring—the art of improving the design of existing code—has taken the world by storm. So has Ruby. Now, for the first time, there’s a refactoring workbook designed from the ground up for the dynamic Ruby language.


Refactoring in Ruby gives you all the realistic, hands-on practice you need to refactor Ruby code quickly and effectively. You’ll discover how to recognize “code smells,” which signal opportunities for improvement, and then perfect your program’s design one small, safe step at a time.


The book shows you when and how to refactor with both legacy code and during new test-driven development, and walks you through real-world refactoring in detail. The workbook concludes with several applications designed to help practice refactoring in realistic domains, plus a handy code review checklist you’ll refer to again and again. Along the way, you’ll learn powerful lessons about designing higher quality Ruby software—lessons that will enable you to experience the joy of writing consistently great code.


Refactoring in Ruby will help you

  • Recognize why poor code design occurs, so you can prevent it from occurring in your own code
  • Master better design techniques that lead to more efficient, reliable, and maintainable software
  • Fix code that’s too long, large, or difficult to follow
  • Ferret out duplication, and express each idea “once and only once”
  • Recognize missing or inadequately formed classes
  • Simplify overly complex relationships between classes and their subclasses
  • Achieve the right balance of responsibilities among objects
  • Make your code easier to test and change
  • Cope with incomplete library modules, and fix runaway dependencies
  • Learn the next steps to take after you refactor

What people are saying - Write a review

We haven't found any reviews in the usual places.


Part IThe Art of Refactoring
Chapter 1 A Refactoring Example
Chapter 2 The Refactoring Cycle
Chapter 3 Refactoring Step by Step
Chapter 4 Refactoring Practice
Part IICode Smells
Chapter 5 Measurable Smells
Chapter 6 Names
Chapter 13 Accommodating Change
Chapter 14 Libraries
Part IIIPrograms to Refactor
Chapter 15 A Simple Game
Chapter 16 Time Recording
Chapter 17 Calculator
Part IVAppendices
Appendix A Answers to Selected Questions

Chapter 7 Unnecessary Complexity
Chapter 8 Duplication
Chapter 9 Conditional Logic
Chapter 10 Data
Chapter 11 Inheritance
Chapter 12 Responsibility
Appendix B Ruby Refactoring Tools
Inside Front Cover
Inside Back Cover

Common terms and phrases

About the author (2009)

William C. Wake is a senior consultant with Industrial Logic, Inc. From 2007 to early 2009, he managed development at Gene Codes Forensics, Inc., a producer of bioinformatics software. From 2001 through 2006, he was an independent consultant focused on agile software. He’s the author of the Refactoring Workbook (Addison-Wesley, 2004) and coauthor of Design Patterns in Java (Addison-Wesley, 2006). His web site is


Kevin Rutherford, Ph.D., is an independent agile and TDD coach based in the United Kingdom. He has worked in software development for more than 25 years, and since 1997 has been coaching organizations to become highly responsive service providers. He founded the U.K.’s AgileNorth group and is regularly involved on the agile conference circuit. His working practices focus on use of the Theory of Constraints and code quality, and he is the author of the Reek tool for Ruby. His web site is

Bibliographic information