Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
http://rubykaigi.org/2016/presentations/searls.html Until recently, we didn't talk much about "legacy Ruby". But today, so many companies rely on Ruby that legacy code is inevitable. When code is hard-to-understand, we fear our changes may silently break something. This fear erodes the courage to improve code's design, making future change even harder. If we combine proven refactoring techniques with Ruby's flexibility, we can safely add features while gradually improving our design. This talk will draw on code analysis, testing, and object-oriented design to equip attendees with a process for refactoring legacy code without fear. Justin Searls @searls Nobody knows bad code like Justin Searls—he writes bad code effortlessly. And it's given him the chance to study why the industry has gotten so good at making bad software. He co-founded Test Double, an agency focused on fixing what's broken in software.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk titled 'Surgical Refactoring,' Justin Searls addresses the challenges of managing legacy Ruby code, a concern for many developers as Ruby becomes increasingly essential in business applications. Searls emphasizes that refactoring is essential when maintaining and improving old code, especially since legacy code is often hard to understand, making changes risky and intimidating for developers. The core message of Searls’ presentation revolves around the idea that refactoring doesn't need to be frightening but can be approached systematically using specific techniques and tools. Key Points: - **Definition of Legacy Code**: Searls defines legacy code as code we do not understand well enough to change confidently, rather than the commonly used terms like old code or code without tests. - **Importance of Refactoring**: Refactoring is defined as changing the code's design without altering its observable behavior, aiming to improve implementation for future features or bug fixes. - **Challenges in Selling Refactoring**: Convincing stakeholders of the value of refactoring is difficult due to its often invisible nature and the inherent risks and costs involved. - **Refactoring Techniques**: Searls discusses several techniques to assist with refactoring: - Characterization Testing: Establishing a test harness for legacy code to ensure changes do not alter the expected output. - Incremental Refactoring: Making small changes gradually rather than large overhauls to reduce risk. - Use of Tools like Suture: A new gem created by Searls that helps manage the process of refactoring by creating “seams” in code that allow developers to test and validate changes effectively, minimizing risk during refactoring. - **Real-World Application**: Searls illustrates the application of these techniques through examples involving a Calculator Service and a Tally service in Ruby, where he shows how to identify bugs and implement fixes while minimizing disruption. Conclusions: - Searls reinforces that with proper planning, appropriate tools, and understanding of the legacy code’s intricacies, developers can refactor code confidently and effectively. To scale refactoring efforts, he suggests integrating refactoring routines as part of regular development processes. The ultimate goal is to foster a more sustainable software ecosystem that continues to support and improve legacy code usage.
Suggest modifications
Cancel