HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Hillel Wayne - Beyond Unit Tests: Taking Your Testing to the Next Level - PyCon 2018

PyCon 20183 HN recommenders · recommended in 3 months, 2018-2023
YouTube
38K views · 8 years ago · talk · evergreen

Hillel Wayne's PyCon 2018 talk on testing beyond pytest and mypy. It introduces property-based testing with the Hypothesis library and design-by-contract with dpcontracts, and shows how to combine them with an existing test suite.

HN commenters point to it as a concise, convincing case for better testing practice short of full formal methods.

Testing, debugging & developer toolsPython, Ruby & scripting languagesLogic & formal methods#hypothesis#contracts#python#testing#formalmethods

3 comments from Hacker News

@spion2023 · in “What if writing tests was a joyful experience?”

Most of the non-joyful experience of writing tests lies in the context preparation, not so much in the expected outputs. I think we need a modern version of design by contract instead. Its one of the most powerful techniques of testing software is unfortunately often ignored and overlooked these days... Some less known things about design by contract: - you can easily test way more than types in preconditions and postconditions - extreme web controller postcondition example: every time there is a 200 response to a POST /new request, there should be at least one document more in storage than there was before the request. (caveat: unless there are deletes - then sum the deletes up too) - things important to the business look a ton like contracts - e.g. a diff of two legal documents always contains the full content (list of words) of both documents (never accidentally swallow content!) - your postconditions can surprisingly often fully describe the desired function behavior - with sufficient amount of pre and postconditions, your property tests look like "exercise the module or entire system with random actions" -> unit and integration tests (see Hilel Wayne's excellent video on this topic ▶ this video ) Some things that could really help modernize design by contract - Test at a certain sampling rate in production for expensive contracts (do not turn them off) - Report contract violations via observability mechanisms (tracing, sentry etc) - Better language support for contract DSLs

RecommendsView on HN
@jononor2019 · in “The Case for Formal Methods”

I found this talk (by the same person being interviewed) to be concise and convincing on how to do better than typical practice, without going to full formal methods. Hillel Wayne - Beyond Unit Tests: Taking Your Testing to the Next Level - PyCon 2018 ▶ this video

Strongly recommendsView on HN
@sn92018 · in “Ask HN: Best talks of 2018?”

Some of my favorite talks from Strange Loop: * Contracts For Getting More Programs Less Wrong: link * "It's Just Matrix Multiplication": Notation for Weaving: link * Hackett: a metaprogrammable Haskell: link * Git from the Ground Up: link From PyCon: * Beyond Unit Tests: Taking Your Testing to the Next Level: ▶ this video * Dataclasses: The code generator to end all code generator: link * Automating Code Quality: link There are probably more I might add later as I remember them.

RecommendsView on HN
John Hughes - Testing the Hard Stuff and Staying Sane47:17

John Hughes - Testing the Hard Stuff and Staying Sane

ClojureTV
39K views • 12 years ago
Keynote - Preventing, Finding, and Fixing Bugs On a Time Budget | Raymond Hettinger @ PyBay201840:01

Keynote - Preventing, Finding, and Fixing Bugs On a Time Budget | Raymond Hettinger @ PyBay2018

SF Python
27K views • 8 years ago
Jake Vanderplas - Statistics for Hackers - PyCon 2016.mp440:45

Jake Vanderplas - Statistics for Hackers - PyCon 2016.mp4

PyCon 2016
93K views • 10 years ago
Raymond Hettinger - Dataclasses:  The code generator to end all code generators - PyCon 201845:08

Raymond Hettinger - Dataclasses: The code generator to end all code generators - PyCon 2018

PyCon 2018
130K views • 8 years ago
David Beazley - Lambda Calculus from the Ground Up - PyCon 20193:26:34

David Beazley - Lambda Calculus from the Ground Up - PyCon 2019

PyCon 2019
52K views • 7 years ago
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)1:03:55

🚀 TDD, Where Did It All Go Wrong (Ian Cooper)

DevTernity Conference
619K views • 8 years ago
Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 201832:17

Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 2018

PyCon 2018
30K views • 8 years ago
Autonomous Testing and the Future of Software Development - Will Wilson32:02

Autonomous Testing and the Future of Software Development - Will Wilson

The Linux Foundation
7K views • 7 years ago
A Talk Near the Future of Python (a.k.a., Dave live-codes a WebAssembly Interpreter)1:01:45

A Talk Near the Future of Python (a.k.a., Dave live-codes a WebAssembly Interpreter)

David Beazley
26K views • 7 years ago
James Powell: So you want to be a Python expert? | PyData Seattle 20171:54:11

James Powell: So you want to be a Python expert? | PyData Seattle 2017

PyData
508K views • 9 years ago
Rails Conf 2013 The Magic Tricks of Testing by Sandi Metz32:23

Rails Conf 2013 The Magic Tricks of Testing by Sandi Metz

Confreaks
144K views • 13 years ago
Debugging with the Scientific Method - Stuart Halloway49:09

Debugging with the Scientific Method - Stuart Halloway

ClojureTV
25K views • 10 years ago
Build Your Own Async2:12:42

Build Your Own Async

David Beazley
60K views • 7 years ago
Transforming Code into Beautiful, Idiomatic Python48:51

Transforming Code into Beautiful, Idiomatic Python

Next Day Video
1.1M views • 13 years ago
Ruby Conf 12 - Boundaries by Gary Bernhardt45:55

Ruby Conf 12 - Boundaries by Gary Bernhardt

Confreaks
58K views • 13 years ago
VisiData Lightning Demo at PyCascades 20184:51

VisiData Lightning Demo at PyCascades 2018

Saul Pwanson
41K views • 8 years ago
Leslie Lamport: Thinking Above the Code59:50

Leslie Lamport: Thinking Above the Code

Microsoft Research
403K views • 12 years ago
The Clean Architecture in Python49:54

The Clean Architecture in Python

Next Day Video
114K views • 12 years ago
"Tackling Concurrency Bugs with TLA+" by Hillel Wayne30:06

"Tackling Concurrency Bugs with TLA+" by Hillel Wayne

Strange Loop Conference
24K views • 9 years ago
Cory Benfield - Building Protocol Libraries The Right Way - PyCon 201631:38

Cory Benfield - Building Protocol Libraries The Right Way - PyCon 2016

PyCon 2016
15K views • 10 years ago