Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
We know testing is vital and makes refactoring painless. But how to set sail to that TDD treasure? Yarr, we need to test to get experience, but need experience to test. Let’s draw a map with simple strategies for identifying test cases and building a robust test suite. X marks the spot w/ TDD tools for newbies and seasoned pirates alike.
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 his presentation "Your TDD Treasure Map" at RailsConf 2022, Christopher "Aji" Slater focuses on the importance of test-driven development (TDD) and offers strategies for applying it effectively. Slater begins by acknowledging that while testing is crucial in software development, many developers, especially those new to the field, struggle to implement it. Using the metaphor of a treasure map, he illustrates how flowcharts can help navigate the complexities of testing and writing code. ### Key Points Discussed: - **Significance of Testing**: Slater emphasizes that robust automated tests can prevent regressions, support refactoring, provide documentation, and guide design decisions. - **Treasure Map Analogy**: He introduces the idea of a treasure map as a visual representation of code flow, explaining that it can serve as a guide for developers to identify decision points in their code, which can lead to different outcomes, much like a flowchart leading to treasure or peril. - **Flowcharts in Testing**: Slater demonstrates how to create a flowchart based on acceptance criteria and then use it to generate test cases, reflecting the control flow in the application. He presents a practical example of a Rails controller handling user updates, showcasing how to derive test cases from the map. - **Contextual Testing**: The discussion includes how to handle different contexts within the testing framework and how variations in parameters or decision branches can affect the flow of execution. - **Incremental Development**: Slater highlights the iterative nature of TDD, encouraging developers to begin with simple tests and gradually add complexity based on user stories and acceptance criteria. - **Encapsulation of Logic**: He advises on encapsulating complex logic in service objects, discussing how this can simplify the flowchart and testing by abstracting responsibilities away from controllers. - **Final Thoughts**: The presentation illustrates that there are no strict rules for applying the treasure map technique; instead, it is a flexible approach that can be adapted to various development frameworks. ### Main Takeaways: - TDD is a valuable approach for ensuring software integrity and can be made approachable through visual mapping techniques. - Using flowcharts to visualize decision paths enables developers to better understand how to structure tests for their code. - The process of writing tests should be seen as non-linear; it evolves through iterative exploration and adjustment of the codebase. - Practical application examples are crucial to grounding testing strategies in real-world development scenarios. Through this engaging talk, Slater equips both novice and seasoned developers with insights and techniques for navigating the sometimes treacherous waters of TDD, ultimately steering them towards a more robust test suite.
Suggest modifications
Cancel