Notes on test coverage

These are a few quick notes to self, rather than a cogent thesis. I want to get this out while it’s still fresh, and I want to lower my own mental barrier to publishing here.

I’ve been thinking about test coverage recently, inspired by conversations that followed DRMacIver …

more ...

Announcing quay-admin

We use quay.io a fair bit at work—all our internal Docker images are stored there. I like it a lot, but the website makes it really hard to see who can access your repositories.

In particular, if someone ever leaves your organization, you have to click through all …

more ...

Site updates

I am pleased to announce that the recent TLS certificate problems and outages to jml.io have been fully resolved.

Here are some notes on what happened and what I did about it.

Background

jml.io is a statically generated blog that’s hosted on AWS. The HTML pages are …

more ...





SPAKE2 in Haskell: the journey begins

There’s a joke about programmers that’s been doing the rounds for the last couple of years:

We do these things not because they are easy, but because we thought they would be easy.

This is about how I became the butt of a tired, old joke.

My friend …

more ...





Patterns are half-formed code

If “technology is stuff that doesn’t work yet”[1], then patterns are code we don’t know how to write yet.

In the Go Programming Language, the authors show how to iterate over elements in a map, sorted by keys:

To enumerate the key/value pairs in order, we …

more ...

Evolving toward property-based testing with Hypothesis

Many people are quite comfortable writing ordinary unit tests, but feel a bit confused when they start with property-based testing. This post shows how two ordinary programmers started with normal Python unit tests and nudged them incrementally toward property-based tests, gaining many advantages on the way.

Background

I used to …

more ...


Debugging Python with gdb

Here’s a quick reference for getting set up to debug Python with gdb, aimed at Debian and Ubuntu users.

Although I’d love to make this a full-fledged write up, it’s going to have to be a note to my future self for now.

It assumes you have …

more ...

Bazel! Correct, reproducible, fast builds

Bazel is a build tool from Google that I used a lot during my time there. Happily, it’s been open sourced, and so I can look into using it for my own Python projects.

Let me tell you why I’m excited about it, and then follow up with …

more ...



Isn’t it Pythonic?

I really should be over this by now.

Here’s how you test exceptions in Python 2.7 and later:

with self.assertRaises(SomeException) as cm:
    do_something()

the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)

(as recommended in the unittest documentation)

Here’s how you test exceptions in earlier Pythons …

more ...