Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2016 - Better Code Through Boring(er) Tests by Betsy Haibel Your tests are annoying. Whenever you update your application code, you need to change a lot of them. You've built yourself some test macros, and some nice FactoryGirl factories, and installed this really cool matcher gem... and your tests are still annoying. What if you changed your application code instead? In this talk, you'll learn what "listening to your tests" means in the real world: no mysticism, no arrogant TDD purism, just a few practical refactorings you can use tomorrow at work.
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 RubyConf 2016 talk "Better Code Through Boring(er) Tests", speaker Betsy Haibel addresses the common frustrations developers face with testing and offers practical solutions. She emphasizes the need for tests that are simple and easy to manage, echoing developers' desire for 'boring' code that is easy to understand over time. Key points discussed throughout the talk include: - **Understanding Developer Frustration:** Haibel asserts that despite the general agreement on the value of testing, many developers find their tests annoying and troublesome, partly because they often reflect our imperfect understanding during development. - **Test Smells:** She identifies three specific "test smells" that can complicate testing: - **Testing Private Methods:** Instead of directly testing private methods, developers should consider making these methods public or extracting them to a new class, thereby simplifying tests. - **Test Duplication:** Haibel cautions against mirroring application code in tests, which can lead to conflicts during refactoring. Instead, she proposes capturing shared functionalities in application code directly instead of in testing code. - **Inventing the Universe:** She warns against excessive setup in tests that leads to unnecessary complexity. Developers should wait until they have multiple test cases before creating abstractions within their tests. - **Complex Test Setups:** Haibel discusses how using tools like FactoryGirl can mask complexities in testing setups. She encourages developers to pull essential logic into application code to maintain clarity and control. - **Boring Tests as a Strategy:** Overall, the main argument is that boring tests lead to more maintainable and comprehensible code. By striving for simplicity and avoiding clever or complex constructs, developers can ensure that their tests remain useful as the application evolves. The talk concludes with the notion that listening to your tests can highlight opportunities for refactoring both the tests and the application code, ultimately reducing the frustration associated with both. Better understanding and structuring of tests can lead to better application development practices, aligning both the tests and the code for future enhancements.
Suggest modifications
Cancel