VoiceGem

How to dictate an XCTest case, and the word that breaks it

XCTest method names are long camelCase sentences that dictate well: “func camel case test fetch profile returns cached value open paren close paren open brace” returns a complete test. Assertion helper names do not, because “equal” is an alias for the equals sign in VoiceGem's symbol table.

A twelve-word XCTest declaration takes roughly 14 seconds to type and roughly 4.4 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 testFetchProfileReturnsTheCachedValue() {

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

Step by step

  1. 1

    Say “func camel case test” then the behaviour

    Speak the whole name as one run. XCTest discovers methods whose names begin with test, and a casing run consumes every plain word that follows.

  2. 2

    Close the declaration

    Say “open paren close paren open brace”. The bracket pair binds tightly and the brace keeps its spacing, which matches Swift's own formatting.

  3. 3

    Type the assertion helper names

    Write XCTAssertEqual by hand. The word “equal” is a symbol alias in VoiceGem's table, so dictating that name produces an equals sign in the middle of it.

  4. 4

    Dictate the assertion arguments

    Speak the values inside the brackets after typing the helper name. The arguments are identifiers and commas, which dictate cleanly.

The word “equal” is a symbol alias, which breaks XCTest helper names

Three phrases reach the equals sign in VoiceGem's table: “equals”, “equal” and “assign”. The second one is the problem here, because XCTAssertEqual contains it — saying that name returns XCTAssert =( rather than the helper.

Collisions like this are the predictable cost of a fixed table, and the fix is to know about them rather than to hope. XCTAssertEqual, XCTAssertNotEqual and any identifier containing the word equal all need typing; the surrounding test name and arguments dictate normally.

Where the manual path breaks

Xcode completes XCTest helper names after three characters, so typing them is fast and dictation has nothing to add there.

Test method names are the opposite case. XCTest's convention produces very long camelCase names describing a whole behaviour, and every word boundary is a shift press. Dictating the name in VoiceGem is one casing command and the sentence you would have written in the comment anyway.

Doing this somewhere else? the spoken-symbol reference, dictating Swift documentation comments, dictating Swift functions specifically, or what changes for dictating Go tests.

Common questions

The word “equal” is one of three phrases that reach the equals sign in VoiceGem's table. Type helper names containing it and dictate the arguments.

Anything containing the words equal, dot, comma, colon, plus, minus, star, times, slash, pipe, bang, hash, tab or scope. The published table lists every phrase.

Yes, very well. One camel casing command consumes the whole sentence, so a twelve-word method name costs twelve spoken words.

Check which everyday words are table phrases before you dictate an identifier.

Open the tool