How to dictate a JUnit test, and why the annotation needs a line break
A JUnit annotation needs a line break after it or the casing command keeps going. Saying “at sign pascal case test void camel case finds active” returns @TestVoid, because a casing run consumes every plain word until a symbol or another command arrives.
A fourteen-word JUnit test header takes roughly 16 seconds typed against roughly 5.1 seconds spoken. (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.)
@Test
public void findsOnlyActiveUsers() {This tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.
Step by step
- 1
Say the annotation
Speak “at sign pascal case test”. The at sign binds rightward onto the name the casing command builds.
- 2
Say “new line” immediately
Break the line before the method modifiers. A whitespace command ends VoiceGem's casing run, which is what stops the word void being absorbed into the annotation name.
- 3
Declare the method
Say “public void camel case finds only active users”. The modifiers pass through untouched and the casing command builds the method name.
- 4
The manual route
Let IntelliJ generate the test method from the class under test. Generation is faster for the skeleton; dictation is faster for a descriptive method name.
A casing run ends at a symbol, a whitespace command, or another casing command
Java annotations expose this rule more sharply than any other construct, because an annotation is followed by keywords rather than by punctuation. Nothing stops the run, so “at sign pascal case test void” builds the identifier TestVoid and the annotation is wrong in a way that still compiles as a name.
Saying “new line” fixes it and is what you wanted anyway, since annotations conventionally sit on their own line. The rule is worth learning once because it is the same everywhere: the Deterministic Pass ends a casing run on exactly three things and a keyword is not one of them.
Where the manual way breaks
IntelliJ generates test methods, imports and assertion statements faster than anyone speaks. Java tooling is the strongest argument against dictating Java structure.
Descriptive method names are the remaining gap. JUnit's readable-name convention produces four- and five-word camelCase methods, and those are four shift presses each when typed. Dictating the name inside a generated skeleton is where VoiceGem fits into a Java workflow.
Doing this somewhere else? speech-to-code converter, in one place, dictating Javadoc comments, dictating Java methods, step by step, or what changes for naming things in Java by voice.
Common questions
A VoiceGem casing run consumes every plain word until a symbol, a whitespace command or another casing command. Say “new line” after the annotation.
A symbol phrase, a whitespace command, or another casing command. Keywords and ordinary words do not end it.
Yes. Say “at sign pascal case display name open paren double quote” then the sentence. The quoted name passes through untouched.
Say the annotation without the line break and watch it swallow the keyword.
Open the tool