Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Are you supporting legacy code? Would you like to stop? A good testing strategy can transform legacy code into living code that is resilient and easy to evolve. Learn why legacy code is so difficult to maintain and identify where tests can make the most impact. Not just any tests, though! We'll dive into the characteristics of high-value versus low-value tests and learn techniques for writing tests that minimize the cost of change. Developers of any experience level can benefit from these concepts. Familiarity with Rails and an automated testing framework is helpful but not required.
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 Maeve Revels' talk at RailsConf 2022, titled "Testing Legacy Code When You Dislike Tests (and Legacy Code)", she discusses the challenges developers face when dealing with legacy code and the importance of a good testing strategy. Revels shares her experience and knowledge to help developers transform legacy code, often viewed negatively, into code that is easier to maintain and evolve. The key points of her presentation include: - **Definition of Legacy Code**: Legacy code is defined as any code in production without tests, regardless of its age. This creates a heavy support burden due to the risks associated with making changes. - **The Cost of Change**: The costs associated with changing legacy code can escalate quickly, especially when it is coupled both internally and externally, leading to unexpected regressions. Revels explains this growth with the Gompertz growth model, which illustrates how risks increase over time if left unaddressed. - **High-Value vs Low-Value Tests**: Revels emphasizes the need for testing strategies that prioritize high-value tests—those that catch the most crucial regressions and have the lowest maintenance costs. High-value tests should pass as long as the application behavior remains unchanged. - **Testing Techniques**: The presentation covers various testing techniques suitable for legacy code, including integration tests, functional tests, and unit tests. Each type of test has its advantages and challenges, with integration tests offering the highest value for ensuring user-facing functionality works as expected. - **The Seam Model**: Revels introduces the seam model, which focuses on how to modify behavior without changing the underlying code directly. This allows for safer refactoring and testing within application seams. - **Legacy Tests**: She discusses the pitfalls of poorly designed legacy tests that break upon minor changes. Strategies are presented for maintaining tests, emphasizing the need for tests to only change when there is a corresponding change in behavior rather than simply structural changes. Overall, Revels' talk encourages developers to embrace testing as a powerful tool in managing legacy code, focusing efforts on understanding behavior, creating high-value tests, and gradually bringing legacy code under test coverage. The session serves as a practical guide, underscoring the significance of testing in mitigating risks associated with legacy systems and improving code maintainability.
Suggest modifications
Cancel