Code From Nothing: Procedural Generation of Python Source Code

How to break linters and why you should do that

Kirill Borisov

Code Analysis Compiler and Interpreters Python 3 Python Skills python

See in schedule

This talk will be about using Hypothesis and tools derived from it to test existing Python linters and fixers. While it is possible to test them by using hand-crafted pieces of code, sheer expression power of Python makes it very hard to think about every corner case that can be encountered. Even mature, widely-used tools like black or (gasp!) Python parser still manage to get it wrong.

So what be can done about that? Who can help you? Why would you even care?

Look no further than this talk for answers.

This talk is primarily for people who are interested in working on tools that analyze source code in general and Python source in particular (e.g. flake8, libcst). It shows novel ways in which such tools can be tested and delves a little bit into how source-code fuzzing using Hypothesis works. It would help if the attending person has some knowledge about parsers and programming language design, but ultimately it is not required as a barebones explanation will be provided.

Type: Talk (30 mins); Python level: Intermediate; Domain level: Beginner

Kirill Borisov

For the last 10+ years, I've been working on a wide range of systems, from kindergarten accounting systems to authentication backends that serve millions of users. In the process, "legacy code" became my personal nemesis and forced me to tackle it using a variety of techniques.

My spare time is devoted to tinkering with electronics (MicroPython, anyone?), caring for my cats, and sharing my experience with the world. :)