A-hunting We Will Go: Debugging pytest with Django
By Cris Ewing

So you’ve got a bug and you can’t see where to begin? Well, let me tell you, I’ve been there. Have a seat and I'll tell you a story of a bug that cost me three days and ended in three lines of code. I promise you’ll laugh, you’ll cry, and when we’re finished, you might see a path to start your own hunt.

Debugging code is a skill we all must learn, but one that is rarely taught particularly well. We speak about “reading the traceback” as if that alone is sufficient to lead us to the solution to all our problems. But what happens when it isn’t enough? When the traceback is the symptom of a problem that happened elsewhere, or elsewhen? How do you approach debugging when the leads are slim?

This talk presents the tools of debugging couched in a very specific tale of a particular bug hunt. The specific bug is a good one because it presents a number of the classic tough problems in debugging. It starts with an intermittent failure. It has a traceback that is completely remote from the actual cause of the problem. It involves the interaction of three separate systems: a web framework, a test framework, and a database. And in the end, the cause is so small, and the solution so simple, that it serves to remind us all to be humble in the face of the complexity we deal in daily.

During this talk, you'll learn about ways to use printing and logging as well as pdb. You'll see how core Python tools like dbapi2 and the inspect module can help to solve common problems. You'll learn how to spot new avenues for exploration, and how to figure out when you're in a blind alley.

The talk is entertaining for folks of any level, but it’s probably of most use to beginner and intermediate programmers.

Cris Ewing

Cris Ewing is a husband and father of two, and a developer with nearly 20 years of experience building software. He started in the field of computer music, and since 2001 has worked building web-based applications in a number of languages. He is currently employed as a software engineer at Coffee Meets Bagel in Seattle, WA where he develops services in a polyglot system that includes Python, Go, Scala, and Elixir. He has contributed code and documentation to such Open Source projects as Plone, Pyramid and EdX.

Cris joined the Plone open source community in 2006 and has served on the board of directors of the Plone Foundation and as the coordinator for Plone's presence in the Google Summer of Code. He has taught web development in Python for the University of Washington Professional and Continuing Education program and established the Python program at CodeFellows in Seattle, WA. He has twice been named "Educator of the Year" by the Puget Sound Programming in Python (PuPPy) meetup group.

Cris has spoken at meetups, trainings, conferences and events across the US and internationally, and was a Keynote Speaker at PyCon 2016 in Portland, OR.

Twitter

Sponsors