Skip to content

Programming

Python Table-Driven Tests

Table-driven tests (TDT) are a popular form of unit testing that allow you to rapidly iterate over multiple different inputs to your system in a way that is easily readable and understandable. This post will show my approach to TDT in Python and why all the current implementations of it are insufficient.

Worse is Better

When I design software systems, my modus operandi is generally to design the minimally acceptable set of features required by the business needs. This methodology allows me to be efficient with my time as I am focusing my energy on the known business problems. It also reduces the expectations your users have which is strangely a huge benfit: lower expectations usually translates to lower maintenance burdens. It allows you to focus your effort on the biggest problems your users face.

Profile Guided Optimizations in Go

A view of the mountains from the top of Pikes Peak

In this post, we'll explore Profile Guided Optimizations (PGO) introduced in Go 1.20 and how they can be effectively used to improve the performance of your production applications. PGO is a compiler optimization technique that allows you to tune the performance of your Go applications in an environment- and workload-specific way. The profiles themselves are simple metadata files that contain information on what functions are called, how often they're called, what system calls are used, and generally what the computational profile is of your application. This information can be used by the compiler to better inform what sorts of optimizations are useful in your specific environment and workfload.

Introducing Mockery's New packages Feature

vektra/mockery is a Go package that auto-generates mock implementations of interfaces in your project. For those not familiar with what mockery is, please take a look at its documentation page. I took over the project in 2020 and have overseen a number of significant feature updates to the code. The most recent of these is a feature I call packages, and it's one I'm most proud of due to the enormous benefits it grants you.