Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Are you confident that your code works the way you expect? Is it easy to change? Do you get accurate feedback when you do change it? If the answer to any of these questions is no, the problem is not your code: it's your tests. We'll look at the state-of-the-art Ruby testing libraries and frameworks to start you off with an effective testing toolset. In addition to the toolset, we'll also explore the testing mindset. Should I mock this or stub it? Should I write a unit test or an integration test? How do I write tests that allow me to refactor with confidence? If you've ever asked yourself questions like these, this session is for you. Intended for new testers; those who "just don't get this testing thing;" people with brittle, unwieldy test suites they need to work into shape; and everyone in between. Help us caption & translate this video! http://amara.org/v/GZSg/
Date
Summary
Markdown supported
In the video "Real World Ruby Testing" presented by Rein Henrichs at GoGaRuCo 2010, the speaker addresses the crucial aspects of Ruby testing, emphasizing its importance in ensuring code reliability and maintaining manageable changes over time. The talk is designed for new testers, those struggling with fragile test suites, and anyone eager to improve their testing strategies. Key points discussed include: - **Overview of Testing Frameworks**: Rein introduces various Ruby testing frameworks, including Test Unit, RSpec, Shoulda, MiniTest, Bacon, and Veritest, discussing their purposes and differences. He notes RSpec as leading in behavior-driven development (BDD). - **Selecting the Right Framework**: The decision on which framework to use hinges on familiarity and expressiveness, meaning how well the team knows the framework and how clearly the tests communicate the system state. - **Purpose of Testing**: Testing is essential for building confidence in code, driving development, and managing changes effectively. The benefits of testing extend to improved trust within teams and living documentation of the codebase. - **Writing Effective Tests**: Rein outlines what constitutes a good test, including fast feedback, single-purpose testing, and the necessity for tests to be independent. He highlights common problems such as state leakage, excessive setup, and fragile tests, which can undermine confidence in the test suite. - **Common Issues and Solutions**: Problems like state leak, setup duplication, long-running tests, and fragile tests are analyzed. Strategies to mitigate these issues include minimizing shared state, streamlining setup processes, and ensuring tests provide clear and actionable feedback. - **Best Practices**: Rein emphasizes regression testing, writing initial tests with confidence, and being cautious with techniques like mocking and stubbing. In summary, the hallmark of effective Ruby testing lies in creating a well-structured test suite that supports rapid development and encourages clear communication among team members. Testing is not merely a checkbox activity but a vital aspect of software development that promotes quality and trust in the code produced. The concluding message stresses the value of maintaining high standards in testing to foster both confidence in the code and better collaborative practices in development.
Suggest modifications
Cancel