Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the concept of verified fakes in software testing through this EuroPython conference talk. Delve into the advantages of using verified fake implementations for simplified testing while maintaining confidence in code behavior. Examine a case study demonstrating how to write and verify fake implementations of public APIs. Learn how to create reusable tests that validate both fake and real implementations. Discover real-world examples of verified fakes in open-source projects, including Flocker's block device backend and Eliot's memory logger. Understand the limitations of unverified mocking and the potential benefits of incorporating verified fakes in libraries like Boto and Docker-py. Gain insights into writing effective tests for public APIs and implementation details.
Syllabus
Intro
Introduction • Problems (5) • Solution (15) . Questions (5)
Problem 2: Inaccurate mocks
Nova Docker (for example)
Can we do better?
A "verified" fake A class that
So let's make a start
Where is the docker-py API defined?
A public testtools module
A Tests Mixin
And now we can start fleshing out the interface
Starting with a test for empty list of containers.
Test, write code, refactor, repeat
Complications
Test public APIs not implementation details
Further Reading
Mimic
Eliot
Summary
Taught by
EuroPython Conference