Llewelyn Falco, creator of approval tests, discusses the power of approval testing as a higher level alternative to traditional unit tests. They explore the pitfalls of code coverage and the process of approval testing. They also talk about using approval tests to improve test clarity and reduce duplication, testing non-deterministic chat bots, making code testable, and the importance of specification in software development.
Read more
AI Summary
AI Chapters
Episode notes
auto_awesome
Podcast summary created with Snipd AI
Quick takeaways
Approval Testing focuses on behavior-oriented testing at a higher level than traditional unit tests.
Approval Testing enables easier verification of complex outputs like graphical images or sound files.
Approval Tests simplifies the testing process, reduces manual effort, and improves documentation and collaboration.
Deep dives
Testing Landscape and Approval Testing
Approval Testing is discussed as a testing methodology that fits into the larger testing landscape. The speaker explains how Approval Testing differs from traditional unit testing and how it provides a more high-level and behavior-oriented approach. Instead of focusing on detailed assertions and specific outputs, Approval Testing aims to verify the overall behavior and outcomes of a system. By capturing and approving the actual results of a test in various file formats, such as text, images, CSV, or sound files, Approval Testing offers more insight and granularity for understanding test results. The speaker highlights the benefits of Approval Testing in scenarios where more complex or dynamic outputs, like graphical representations or voice recordings, are involved.
Benefits and Use Cases of Approval Testing
The speaker delves into the benefits and use cases of Approval Testing. One key advantage is the ability to capture and approve test results as files, which provides a more intuitive and visual representation of system behavior. Approval Testing allows for easier verification of complex outputs, such as graphical images or sound files, and enables easy comparison of changes to these outputs over time. The speaker mentions specific use cases like image processing and text-to-speech, where Approval Testing helps validate the desired output. Additionally, Approval Testing aids in reducing duplication and simplifying complex tests by focusing on the high-level conversation or behavior being tested, rather than multiple assertions. By ensuring faster feedback and enabling iterative development, Approval Testing improves productivity and software quality.
Language and Framework Support for Approval Testing
The speaker discusses the broad language and framework support for Approval Testing. Approval Testing has been implemented in multiple languages and frameworks, including Java, .NET, C++, PHP, Python, Swift, JavaScript/TypeScript, Perl, Go, Lua, Ruby, and Objective-C. The availability and feature parity of Approval Testing in each language depend on the contributions and expertise of developers working with the specific language. The speaker highlights the importance of collaboration and pairing with individuals skilled in different languages to maintain and improve Approval Testing in those respective ecosystems. While feature parity may vary across languages, iterative development and input from different collaborators help enhance the documentation and overall quality of Approval Testing in each supported language.
Using Approval Tests for Testing
Approval Tests is a powerful tool that simplifies the process of testing software. By using Approval Tests, the test code becomes more concise and easier to understand. Instead of writing complex assertions, developers can use the verify function to compare the actual output of a system with an approved output. If there are any differences, the developer can easily review and update the approved output. This approach reduces the amount of manual effort required for testing and allows for faster feedback in the development process. Approval Tests also provides support for custom printers, which can be used to format the output of complex data structures in a more readable way. Overall, Approval Tests offers a simple and effective way to improve the testing process and ensure software quality.
Documentation and Explanation in Approval Tests
In addition to its testing capabilities, Approval Tests also offers benefits in terms of documentation and explanation. The tool allows for the integration of code snippets directly from unit tests into documentation, ensuring that the samples are always up-to-date and accurate. This close connection between tests and documentation helps to ensure consistency and reduce the chances of outdated or incorrect examples being used. Furthermore, Approval Tests encourages developers to provide thorough explanations of their code, including its architecture, history, and reasoning. This helps to improve understanding and collaboration among team members, and also facilitates the onboarding process for new developers. By combining testing, documentation, and explanation, Approval Tests provides a comprehensive approach to software development.
Llewelyn Falco, creator approval tests, talks with SE Radio host Sam Taggart about testing code in general and the various types of testing that developers perform. Llewelyn elaborates on how approval tests can help test code at a higher level than traditional unit tests. They also discuss using approval tests to help get legacy code under test. This episode sponsored by Data Annotation.
Get the Snipd podcast app
Unlock the knowledge in podcasts with the podcast player of the future.
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode
Save any moment
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Share & Export
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
AI-powered podcast player
Listen to all your favourite podcasts with AI-powered features
Discover highlights
Listen to the best highlights from the podcasts you love and dive into the full episode