Bulletproof Python – Writing fewer tests with a typed code base
07-19, 15:30–16:00 (Europe/Prague), South Hall 2B

A fully typed code base requires less test code to achieve the same level of confidence in its correctness. We'll analyze specific code examples and see how dependent types and exhaustiveness checking make certain classes of tests obsolete.


A type system forms a set of rules that is imposed on a programming language with the goal to avoid invalid operations. Type checking Python code is particularly interesting, because it happens before running the code or the test code. This allows software engineers to perform checks on the source code that otherwise would have to be performed at runtime.

The typing module in the Python standard library provides powerful concepts to provide hints to the type checker. Specifically, we'll look at use cases for NewType, dependent functions, and exhaustiveness checking.

Audience members are expected to be able to read and understand Python code and have a basic understanding of unit testing.


Expected audience expertise

intermediate

See also:

Michael is a consulting software engineer and trainer who helps product teams to develop Python software in the cloud. He enjoys deleting code more than writing it and is constantly looking for ways to make software easier to maintain.