Will Springer - Security Developer

Inclusive Language in Unit Testing

When unit testing, it is common to leverage “test doubles”, which are pieces of code intended to replace references to production code in your tests. This can ease the burden of setting up your test and better isolate the system-under test from surrounding components.

One type of test double has historically been referred to as a “dummy”, which is a test double that is included to ensure compliance with the API, but is not leveraged for anything. This term should no longer have a place in our code, given its derogatory and ableist nature.

As I understand it, the term “test double” was intended to draw parallel’s to stunt doubles in the film industry. I would propose then that we borrow another term from the film industry: “stand-in”. A stand-in is a person positioned where the actor will be, in order for the scene to be lit and the camera to be placed prior to the actor arriving on set.

A few issues with this term could be confusion with “standard input” (stdin) and the hyphenated nature makes it a bit challenging to work with in a snake-case or camel-case file. Another term that could be a good fit could be “placeholder”. Whatever option we choose is fine by me. The goal here is to make sure we make our code, our companies, and our communities inviting for people of all abilities.