Ruby Video
Talks
Speakers
Events
Topics
Leaderboard
Sign in
Talks
Speakers
Events
Topics
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
This video was recorded on http://wrocloverb.com. You should follow us at https://twitter.com/wrocloverb. See you next year! Slides: http://talks.chastell.net/wrocloverb-2014/ Piotr Szotkowski with INTEGRATION TESTS ARE BOGUS The Ruby community embraced testing early, with many developers switching full-time to test-driven development (and, more importantly, test-driven design); discovering the domain of a given problem and the mechanics required to make objects interact painlessly by implementing a system from outside in are oftentimes eye-opening experiences. Whether you like to write well-isolated (and fast!) unit tests or need to implement the outside of a system without having the inside nits-and-bolts in place beforehand there's a plethora of stubbing and mocking libraries to choose from. Unfortunately, heavy mocking and stubbing comes with a cost: even with the most well-tested-in-isolation objects you can't really say anything about their proper wirings without some integration and end-to-end tests -- and writing the former is often not a very enjoyable experience. This talk covers a new player on the Ruby testing scene: Bogus, a library for stubbing, mocking and spying that goes the extra mile and verifies whether your fakes have any connection with reality -- whether the faked methods exist on the actual object, whether they take the right number of arguments and even whether tests for a given class verify the behaviour that the class's fakes pretend to have. With Bogus quite a few of the famously derided integration tests come for free; a change to a method's name or its signature will make all of the related fakes complain, and all the missing pieces of a system written from outside in will present themselves ready to be implemented.
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 "Integration Tests Are Bogus," Piotr Szotkowski discusses the complexities and limitations of integration tests within the Ruby programming community. Szotkowski begins by defining integration tests and comparing them with other types of tests, including unit tests and end-to-end tests. He highlights the importance of different testing levels in achieving reliable software development. The talk emphasizes that integration tests, while useful, can often become problematic and lead to false security due to over-reliance on test doubles which can misrepresent interactions in code. Key points discussed include: - **Types of Tests**: Integration tests check the cooperation among objects, while end-to-end tests assess overall application functionality. Unit tests confirm that individual components behave as expected. - **Testing Strategy**: Szotkowski advocates for unit tests because they run quickly and help in isolating behaviors, facilitating efficient debugging and coding practices. - **Command Query Separation**: He introduces this principle, which proposes that methods should clearly distinguish between querying data (without side effects) and executing commands (which can change state). - **Risks of Test Doubles**: He warns against the excessive use of mocks and stubs, which can lead to ineffectual tests that pass without the real functionality being verified. Integration tests are advised as a necessary check against these pitfalls. - **Verified Doubles**: The introduction of the 'Bogus' library is pivotal; it ensures that methods being mocked or stubbed are correctly represented, thereby revealing discrepancies early. - **Mocking and Contract Tests**: Szotkowski explains the functionality of mocking calls in testing services and introduces the concept of contract tests to ensure the accuracy of method interactions. As a conclusion, he stresses the significance of efficient testing practices to foster robust software development. The audience is encouraged to engage with the 'Bogus' library and explore further resources for advanced learning on object-oriented design and testing methodologies in Ruby, reinforcing the idea that effective communication with testing doubles is critical for successful unit tests.
Suggest modifications
Cancel