VoiceGem

How to dictate a Go test function and a table-driven case

A Go test signature needs a PascalCase name beginning with Test and a pointer receiver. VoiceGem turns “func pascal case test get user open paren t star testing dot pascal case t close paren open brace” into a working signature, with the pointer space for gofmt to close.

A fifteen-word Go test signature costs about 17 seconds to type and about 5.5 seconds to say. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)

What lands in your editor
func TestGetUserReturnsCached(t * testing.T) {

This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.

Step by step

  1. 1

    Say “func pascal case test” then the behaviour

    Speak the whole name as one run. Go discovers tests by the Test prefix, and a pascal casing command capitalises every word including that one.

  2. 2

    Speak the testing parameter

    Say “t star testing dot pascal case t”. The asterisk arrives spaced because its VoiceGem entry is set for multiplication, and gofmt closes the gap on save.

  3. 3

    Dictate the table cases

    Say each struct literal as a brace, a field name, a colon and a value. Table-driven tests are the most repetitive construct in Go and the most worth speaking.

  4. 4

    The manual alternative

    Use your editor's Go test generator, which writes the whole table skeleton from the function under test. Generators beat dictation for structure and lose for case names.

Table-driven tests are the most repetitive construct Go asks you to write

Go's testing convention produces long slices of struct literals, each with a quoted case name, an input and an expected value. The structure repeats exactly and only the values change, which is the shape where typing feels most like transcription and speaking feels most like thinking.

The quoted case names are the part VoiceGem handles best. Each is an English phrase, and words outside the lookup table pass through untouched — so a table of twelve descriptive case names costs twelve spoken sentences and no punctuation phrases beyond the braces and commas.

Where doing it by hand breaks down

Go's tooling generates test skeletons from the function under test, which is faster than dictating the structure. Use the generator for the shape.

Case names and failure messages are where dictation adds something. A printf-style failure message is a quoted sentence with format verbs in it, and dictating it in VoiceGem means the message says what actually went wrong rather than being shortened to fit the typing effort.

Doing this somewhere else? our speech-to-code converter, what changes for dictating Go doc comments, dictating Go functions specifically, or what changes for naming things in Go by voice.

Common questions

The asterisk entry is spaced for multiplication. Gofmt closes the gap on save, so the artifact does not survive a normal Go workflow.

No. Words absent from VoiceGem's table pass through untouched, so an English case name inside quotes arrives exactly as spoken.

Say “percent d” or “percent s”. The letter is not a table phrase, so it passes through and lands against the percent sign.

Dictate three table cases and see how little punctuation you said.

Open the tool