Faking It - The Art of Testing Using Verified Fakes
Offered By: EuroPython Conference via YouTube
Course Description
Overview
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
Related Courses
A Brief History of Data StorageEuroPython Conference via YouTube Breaking the Stereotype - Evolution & Persistence of Gender Bias in Tech
EuroPython Conference via YouTube We Can Get More from Spatial, GIS, and Public Domain Datasets
EuroPython Conference via YouTube Using NLP to Detect Knots in Protein Structures
EuroPython Conference via YouTube The Challenges of Doing Infra-As-Code Without "The Cloud"
EuroPython Conference via YouTube