Overview
QuickCheck is identified in the evidence as “a lightweight tool for random testing of Haskell programs,” in a publication by Koen Claessen and John Hughes in ACM SIGPLAN Notices 46(4), 2011.
Role in QCVEngine-based testing
In the provided RISC-V CPU randomized-testing paper, QCVEngine uses QuickCheck as part of its counterexample-reduction workflow. The paper states that Direct Instruction Injection allows the authors to primarily rely on QuickCheck’s built-in shrinking strategies, while augmenting them with smart shrinking functions that both eliminate instructions and transform instruction sequences to simplify them.
When QCVEngine finds a counterexample, QuickCheck’s built-in list-shrinking function removes sequences from the list and reruns the test, with the goal of eliminating instructions that are not relevant to the erroneous behavior. The described system then adds additional shrinking logic, such as propagating an instruction’s output register to future input operands, so that a later shrinking pass can further reduce the counterexample.
Notable supported behavior
- QuickCheck provides built-in shrinking strategies used in the QCVEngine workflow.
- Its built-in list shrinking attempts to reduce failing instruction sequences by removing sequence elements and testing again.
- The QCVEngine/TestRIG work augments QuickCheck shrinking with domain-specific “smart shrinking” transformations.