Integration Tests
Integration Test for Use Case 1 - Voice Recognition
- Developer runs their game to test it, and starts by clicking "Whisper Init" and activating mic.
- Developer selects online or offline mode.
- Developer initializes model.
- System downloads model module.
- Developer clicks Start Listening.
- System begins listening and records the utterance.
- API transcribes the audio.
- The transcription is sent back to the game and displayed to the developer.
- Developer clicks Stop Listening.
- System stops listening.
Details
- Runs
SpeechConverterOffline / initializes Whisper module and loads modelunit test. - Runs
SpeechConverterOffline / initialize and calls StartListening()unit test. - Runs
SpeechConverterOffline / StopListening() stops the audio input handlerunit test. - Runs
SpeechConverterOffline / throws error when startListening() is called without initializingunit test. - Runs
SpeechConverterOffline / throws error when stopListening() is called without initializingunit test. - Runs
SpeechConverterOffline / throws error on getTranscribedText() is called without initializingunit test. - Runs
AudioInputHandler / should create an instance with the callbackunit test. - Runs
AudioInputHandler / should say that we are listening with trueunit test. - Runs
AudioInputHandler / should call onAudioChunk when audio data arrivesunit test. - Runs
AudioInputHandler / should stop listening and clean up resourcesunit test.
Passes if all tests pass.
Integration Test for Use Case 2 - Extract Commands
- The system captures AAC board voice input.
- SpeechConverter transcribes the audio into text (e.g., "jump").
- The transcription is tokenized by Command Converter.
- Tokenized transcription is filtered to remove filler words and non-command words.
- Remaining tokens are mapped to commands (e.g., "jump" →
Jump). - Commands are sent to the game.
- Game displays and logs the commands.
Details
- Runs
SpeechConverterOffline / Processes valid transcribed textunit test. - Runs
SpeechConverterOffline / ProcessText called with null valueunit test. - Runs
SpeechConverterOffline / ProcessText called with [BLANK_AUDIO]unit test. - Runs
SpeechConverterOffline / ProcessText called with spaces onlyunit test. - Runs
SpeechConverterOffline / Logs transcribed textunit test. - Runs
SpeechConverterOffline / Does not log blank audiounit test. - Runs
CommandMapping / adds a command and returns success resultunit test. - Runs
ConfidenceMatcher / findMatch / returns exact match when command exists and is activeunit test. - Runs
ConfidenceMatcher / findMatch / finds phonetic match when exact match failsunit test.
Passes if all tests pass.
Integration Test for Use Case 3 - Speaker Separation
- System captures mixed audio with multiple speakers.
- The speaker-separation model splits the audio stream into streams for each speaker.
- Model runs on the isolated player streams and transcribes the utterance.
- Transcription is normalized and mapped to a game command (e.g., "pause" →
PauseGame). - API sends
PauseGameto the game; UI confirms action. - Log command and speaker attribution.
Exceptions
- Separation uncertain / low confidence
Details
- Runs
AudioInputHandler / should return a sample rate of 48000unit test. - Runs
AudioInputHandler / should call onAudioChunk when audio data arrivesunit test. - Runs
SpeechConverterOffline / combines chunks of data and returns a single Float32Arrayunit test. - Runs
SpeechConverterOffline / downsample() converts higher sample to a lower sampleunit test. - Runs
SpeechConverterOffline / Calls setAudio successfullyunit test. - Runs
CommandHistory / getAll / should return all commandsunit test.
Passes if all tests pass.
Integration Test for Use Case 4 - Background Noise Filtering
- System captures the noisy audio.
- Noise suppression/denoising module processes the audio to reduce background interference.
- ASR transcribes the cleaned audio.
- Transcription is matched to a command (e.g., "left" →
MoveLeft). - If confidence is high, API sends
MoveLeftto the game and UI shows visual confirmation. - Command and environment metadata (noise level) are logged.
Details
- Runs
SpeechConverterOffline / returns true for silence (RMS below 0.01)unit test. - Runs
SpeechConverterOffline / returns false for non-silence (RMS >= 0.01)unit test. - Runs
SpeechConverterOffline / returns true for an all-zero waveformunit test. - Runs
SpeechConverterOffline / returns false at the threshold (RMS exactly 0.01)unit test. - Runs
ConfidenceMatcher / findMatch / returns null when no commands meet thresholdunit test. - Runs
ConfidenceMatcher / threshold management / sets and gets global thresholdunit test. - Runs
ConfidenceMatcher / threshold management / throws error for invalid thresholdunit test.
Passes if all tests pass.
Integration Test for Use Case 5 - Interpret Synonyms of Commands
- System captures the utterance and model transcribes it (e.g., "hop").
- The command-mapping module looks up the token in the synonym table.
- "hop" is mapped to canonical command
Jump. - API issues
Jumpto the game. - Provide visual confirmation, log synonym used, and log mapping confidence.
Exceptions
- Developer disabled synonym mapping, and non-command words are filtered out.
Details
- Runs
SynonymResolver / should fetch synonyms from APIunit test. - Runs
SynonymResolver / should normalize words to lowercaseunit test. - Runs
SynonymResolver / should cache synonyms after first fetchunit test. - Runs
SynonymResolver / should exclude the original word from synonymsunit test. - Runs
SynonymResolver / should check if two words are synonymsunit test. - Runs
SynonymResolver / should return false when words are not synonymsunit test. - Runs
SynonymResolver / should return true when comparing same wordunit test. - Runs
CommandMapping / Synonym Response / returns synonyms that were mappedunit test. - Runs
CommandMapping / getAllSynonymMappings / returns map of commands to synonymsunit test. - Runs
CommandMapping / Manual Synonym Operations / adds a single synonym manuallyunit test. - Runs
CommandMapping / Manual Synonym Operations / adds multiple synonyms manuallyunit test. - Runs
CommandMapping / Manual Synonym Operations / gets synonyms for a specific commandunit test.
Passes if all tests pass.
Integration Test for Use Case 6 - Register Game Commands
- AAC game developer uses the API toolkit to add commands like
start,red,blue,green. - They tell the API what each command means and map those commands to game actions.
- Developer speaks (e.g., "red"). The API transcribes and tokenizes the audio.
- The game executes and logs the command.
Details
- Runs
CommandMapping / Basic Command Operations / adds a command and returns success resultunit test. - Runs
CommandMapping / Basic Command Operations / rejects duplicate commandsunit test. - Runs
CommandMapping / Basic Command Operations / rejects empty command nameunit test. - Runs
CommandMapping / Basic Command Operations / removes a commandunit test. - Runs
CommandMapping / Basic Command Operations / lists all commandsunit test. - Runs
CommandMapping / Basic Command Operations / clears all commandsunit test. - Runs
CommandMapping / Synonym Response / returns empty array when fetchSynonyms is falseunit test. - Runs
CommandMapping / Synonym Response / returns empty array when API returns no synonymsunit test. - Runs
CommandMapping / Synonym Response / handles API errors gracefullyunit test. - Runs
CommandHistory / toggle / should add if toggle is trueunit test.
Passes if all tests pass.
Integration Test for Use Case 7 - Toggle Input History
- AAC player's caretaker uses the API window and goes to settings.
- The system has toggleable settings for input history.
- The caretaker toggles off the input history.
- AAC player receives reduced visual stimuli and can comfortably enjoy playing the AAC game.
Alternate Flows / Exceptions
- Developer has registered a new command and uses the command history to troubleshoot the new command.
- Developer has confidence that it was registered correctly and working once able to see it in the command history.
Details
- Runs
CommandHistory / toggle / should add if toggle is trueunit test. - Runs
CommandHistory / toggle / should not add if toggle is falseunit test. - Runs
CommandHistory / getAll / should return all commandsunit test. - Runs
CommandHistory / getSlice / should return slice from start to endunit test. - Runs
CommandHistory / getSlice / should return slice from start to end of array when end not providedunit test. - Runs
CommandHistory / getSlice / should return entire array when start is 0 and no endunit test. - Runs
CommandHistory / getSlice / should return empty array when start >= endunit test. - Runs
CommandHistory / getSlice / should return empty array when start equals endunit test. - Runs
CommandHistory / clear / should clear empty history without errorunit test. - Runs
CommandHistory / clear / should clear all commandsunit test.
Passes if all tests pass.
Integration Test for Use Case 8 - Confidence Level of Interpreted Game Input
- Developer speaks game commands into the microphone (e.g., "attack").
- The game command is interpreted and inputted to the game.
- Developer receives a confidence level from the API that determines how confident the API was in choosing that command based on synonyms to a known command.
- This allows the developer to have control over which commands are recognized as valid game inputs, ensuring that only reliable commands can affect the gameplay.
Details
- Runs
ConfidenceMatcher / constructor and config / uses default config when none providedunit test. - Runs
ConfidenceMatcher / constructor and config / accepts partial config overrideunit test. - Runs
ConfidenceMatcher / findMatch / returns exact match when command exists and is activeunit test. - Runs
ConfidenceMatcher / findMatch / returns null when phonetic matching disabled and no exact matchunit test. - Runs
ConfidenceMatcher / findMatch / finds phonetic match when exact match failsunit test. - Runs
ConfidenceMatcher / findMatch / returns null when no commands meet thresholdunit test. - Runs
ConfidenceMatcher / threshold management / sets and gets global thresholdunit test. - Runs
ConfidenceMatcher / threshold management / throws error for invalid thresholdunit test. - Runs
ConfidenceMatcher / phonetic matching toggle / can enable and disable phonetic matchingunit test. - Runs
SynonymResolver / should handle API errors gracefullyunit test. - Runs
SynonymResolver / should handle network errors gracefullyunit test. - Runs
SynonymResolver / should handle empty API responseunit test.
Passes if all tests pass.
On This Page
- Integration Test for Use Case 1 - Voice Recognition
- Integration Test for Use Case 2 - Extract Commands
- Integration Test for Use Case 3 - Speaker Separation
- Integration Test for Use Case 4 - Background Noise Filtering
- Integration Test for Use Case 5 - Interpret Synonyms of Commands
- Integration Test for Use Case 6 - Register Game Commands
- Integration Test for Use Case 7 - Toggle Input History
- Integration Test for Use Case 8 - Confidence Level of Interpreted Game Input