Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
When you write tests, you are interacting with your code. Like any user experience, you may encounter friction. Stubbing endless methods to get to green. Fixing unrelated spec files after a minor change. Rather than push on, let this tedium guide you toward better software design. With examples in RSpec, this talk will take you step-by-step from a troublesome test to an informed refactor. Join me in learning how to attune to the right signals and manage complexity familiar to any Rails developer. You’ll leave with newfound inspiration to write clear, maintainable tests in peace. Your future self will thank you!
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 presentation titled "So writing tests feels painful. What now?" delivered at RailsConf 2024, Stephanie Minn addresses the common struggles software developers, especially in the Rails community, face when writing tests. She suggests that friction and pain experienced while testing could be indicators of a need for better software design. Key points discussed include: - **Stages of Change Model**: Minn relates stages of change to the testing experience, helping attendees identify where they stand in terms of improving their testing practices. - **Common Challenges in Testing**: She highlights issues like stubbing multiple methods, dealing with confusing test data, and the tendency to force tests to pass without understanding their purpose. - **Working Example**: A hypothetical application named "Patreon for pets" is used to illustrate concepts. The example involves classes handling tier upgrades and notifications, which complicate the testing process. The class interfaces are discussed, pointing out areas of confusion and dependencies on external classes, like the Stripe API. - **Mindset Shift in Testing**: Minn argues for a shift in perspective where tests should not just pass but also clearly communicate how the code works for current and future developers. She highlights the importance of tests providing clarity, akin to leaving a torch in a dark tunnel. - **Refactoring for Clarity**: After navigating through an overwhelming test, she emphasizes the necessity of breaking down complex functionalities into clearer components, thereby managing complexity better and making future changes easier. - **Code Smells and Trustworthy Tests**: The session reinforces that if tests are painful, it often points to underlying code health issues. An approach highlighted is to focus on writing tests that are trustworthy to avoid fear of making changes in code. - **Collaboration and Feedback**: Minn talks about the value of discussing code design with colleagues and utilizing collective wisdom to deepen understanding. - **Encouraging Small Changes**: She encourages developers to make small steps towards improvement, such as reorganizing code or simplifying tests, to gradually foster a healthier codebase. In conclusion, the talk emphasizes that the quality of tests reflects the quality of software design, urging developers to seek clarity and ease in their work. By acknowledging and addressing test pain, developers can not only improve their coding practices but also enhance their overall experience and effectiveness in building applications.
Suggest modifications
Cancel