CrossASR++: A Modular Differential Testing Framework for Automatic Speech Recognition

Muhammad Hilmi Asyrofi, Zhou Yang, David Lo · DOI

Abstract

Developers need to perform adequate testing to ensure the quality of Automatic Speech Recognition (ASR) systems. However, manually collecting required test cases is tedious and time-consuming. Our recent work proposes CrossASR, a differential testing method for ASR systems. This method first utilizes Text-to-Speech (TTS) to generate audios from texts automatically and then feed these audios into different ASR systems for cross-referencing to uncover failed test cases. It also leverages a failure estimator to find failing test cases more efficiently. Such a method is inherently self-improvable: the performance can increase by leveraging more advanced TTS and ASR systems. So in this accompanying tool demo paper, we devote more engineering and propose CrossASR++, an easy-to-use ASR testing tool that can be conveniently extended to incorporate different TTS and ASR systems, and failure estimators. We also make CrossASR++ chunk texts from a given corpus dynamically and enable the estimator to work in a more effective and flexible way. We demonstrate that the new features can help CrossASR++ discover more failed test cases. Using the same TTS and ASR systems, CrossASR++ can uncover 26.2% more failed test cases for 4 ASRs than the original tool. Moreover, by simply adding one more ASR for cross-referencing, we can increase the number of failed test cases uncovered for each of the 4 ASR systems by 25.07%, 39.63%, 20.9% and 8.17% respectively. We also extend CrossASR++ with 5 additional failure estimators. Compared to worst estimator, the best one can discover 10.41% more failed test cases within the same amount of time.

Introduction

Testing Automatic Speech Recognition (ASR) systems is notoriously expensive and time-consuming because it typically requires manually curating pairs of audio inputs and their exact text transcripts (oracles). While automated approaches exist—such as the original CrossASR, which uses Text-to-Speech (TTS) to generate audio and compares outputs across different ASRs—they have historically been rigid prototypes.

The original CrossASR tool suffered from static batching, which limited the predictive power of its "failure estimator" (a model that guesses which texts will cause bugs). Furthermore, as new, state-of-the-art ASR and TTS models are constantly released, the original tool was too difficult to update. CrossASR++ addresses these gaps by providing a highly modular, extensible, and optimized framework that can easily integrate modern models to test ASR systems more effectively.

Methodology

CrossASR++ relies on differential testing. The core workflow operates as follows:

  1. Audio Generation: It takes a text corpus and uses a TTS engine to synthesize audio.
  2. Cross-Referencing: The audio is fed into multiple ASR systems, including the System Under Test (SUT).
  3. Evaluation: If the SUT fails to transcribe the audio correctly (it doesn't match the original text), but at least one other ASR succeeds, the framework flags it as a "failed test case." If all ASRs fail, it is marked as "indeterminable" (likely a bad TTS audio generation).

To make this process highly efficient, CrossASR++ introduces several key upgrades:

  • Modular Extensibility: The tool uses object-oriented base classes (ASR, TTS, Estimator). Users can plug in new models (like HuggingFace transformers) by simply inheriting a base class and overriding a single method.
  • Failure Estimator: A machine learning model trains on-the-fly using past test results to predict which texts are most likely to cause SUT failures, prioritizing them to save compute time.
  • Dynamic Chunking & Flexible Visibility: Instead of locking texts into static batches, CrossASR++ dynamically chunks the corpus. It allows the failure estimator to "see" a much larger, configurable pool of texts (visibility) to rank the most promising test cases first.

Experimental Evaluation

The framework was evaluated using 20,000 randomly selected texts from the Europarl Dataset.

Key Results

  • 26.2% Overall Improvement: Using the same 4 ASRs (DeepSpeech, DeepSpeech2, wav2letter++, Wit) and a 5-hour time budget, CrossASR++ found 1,934 failed test cases compared to the original tool's 1,532.
Comparison of failed test cases discovered by CrossASR and CrossASR++ across four ASR systems.
  • Scaling with ASRs: Simply plugging in one additional ASR (Wav2Vec2) for cross-referencing increased the number of uncovered failures for the 4 original systems by 25.07%, 39.63%, 20.95%, and 8.17%, respectively.
  • Optimal Visibility: Increasing the estimator's visibility from 400 to 1,200 texts increased the total failed test cases by 16.34%. As shown in the visibility analysis, pushing visibility too high eventually degrades performance due to computational overhead.
The impact of visibility (number of texts seen by the estimator) on the number of failed test cases discovered.
  • Estimator Impact: Using a modern transformer (facebook-bart-base) as the failure estimator discovered 10.41% more failures than the worst-performing estimator tested.

Discussion and Future Work

The framework inherently improves as the underlying AI ecosystem evolves. Adding advanced ASRs for cross-referencing turns previously "indeterminable" test cases into actionable failed test cases. Furthermore, giving the failure estimator a larger pool of texts to evaluate at once significantly boosts the number of bugs found, though it is bottlenecked if visibility is too low.

While the framework's success is tied to the quality of the TTS systems used, the modular design allows for easy upgrades. Future work encourages the integration of more diverse TTS engines and cutting-edge ASR systems to further push the boundaries of automated ASR testing.

Summary updated

BibTeX
@inproceedings{asyrofi2021crossasr,
  author = {Muhammad Hilmi Asyrofi and Zhou Yang and David Lo},
  title = {{CrossASR++: A Modular Differential Testing Framework for Automatic Speech Recognition}},
  booktitle = {ESEC/SIGSOFT FSE},
  year = {2021},
  doi = {10.1145/3468264.3473124},
}
Figure