Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf AU 2016: Red, Green, Refactor is a persistent mantra that is drilled into us from day one. As a developer new to Ruby, how do we know how to write the right kind of test? When should we refactor? What tricks and techniques can we use to improve our tests and recognise the feedback they give us to build well designed applications? We’re going to take a look at how our tests give us feedback on our application. We’ll identify some testing smells, and how to determine when to make that refactoring and when not to.
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 "Explicit Tests Tell a Better Tale," presented by Tom Ridge at RubyConf AU 2016, the focus is on improving the clarity and communicative power of tests in software development, particularly within the Ruby programming language. Ridge emphasizes the importance of writing explicit tests that provide meaningful feedback about the application under test and help steer the developer towards effective refactoring. **Key Points Discussed:** - **Importance of Test Clarity:** Ridge argues that tests should clearly communicate the intention of the code to developers, akin to telling a good story. He stresses that unclear tests can lead to confusion and misinterpretation. - **Testing Anti-Patterns:** The talk highlights several common issues in testing, which he refers to as "testing smells" or anti-patterns, particularly focusing on obscure tests that fail to document their logic well. - **Overuse of Domain-Specific Language (DSL):** Ridge discusses how overusing DSL, such as 'let' and 'subject' in testing frameworks, can obscure the context and make tests harder to read. He advocates for more straightforward and explicit code even at the potential expense of some abstractions. - **Examples of Poor Test Documentation:** Ridge provides examples comparing poor tests with good ones, illustrating how clarity in method names and logical flow can make tests more understandable. - **Use of Test Data and Fixtures:** He points out the pitfalls of relying on test data setups that are not clearly linked to the test's intention. Instead, he suggests using more explicit fixtures or factories to ensure that the context is clear and relevant. - **Explicit Setup and Variables:** He encourages developers to maintain explicit setups within tests, using intention-revealing variable names to alleviate cognitive load and enhance documentation. **Significant Examples:** - Ridge shares practical scenarios where tests enhance or obscure communication. He contrasts tests that provide adequate documentation and context with those that leave room for ambiguity, reinforcing the need for explicitness. - Discussions on the application of factories instead of fixtures underscore his message about improving clarity in tests. **Conclusions and Takeaways:** - Developers are encouraged to embrace the mantra of being explicit in their tests. - Good tests should serve as a guide for refactoring, providing insight into how code dependencies interact and revealing the logical flow of methods. - Overall, simpler and clearer tests result in better feedback and a more streamlined development process.
Suggest modifications
Cancel