This repo contains a variety of minimal examples showcasing the testing of DApps written in plutus using the quickcheck contractmodel library. This contains examples using a variety of techniques and emulators. The emulators include the plutus-apps emulator, cooked emulator and the cardano-node-emulator. Techniques include model-based property testing, threat modelling such as double satisfaction as well as negative testing. Each example is contained in a separate branch and written with a minimal configuration so that it can be taken and adapted for other developers.
The notable branches are listed below by emulator:
The main branch includes the cardano-node-emulator
version of the escrow contract as it is the most up-to-date example.
cardano-node-emulator
- escrow-node-emulator
- vesting-node-emulator
cooked emuator
- escrow-cooked
- minimal-lotto-experimental
- auction-cooked
plutus-apps emulator
- Escrow
- EscrowNoCoverage
- Vesting
- governance
- run
nix develop
cabal build escrow
To enter testing repl after step 2 run in the root directory:
cabal repl escrow-test
To run tests after step 2 run in the root directory:
cabal run escrow-test
If you want to run a specific test such as Double Satisfaction in the repl do:
import Test.QuickCheck
import Spec.Escrow
quickCheck prop_Escrow_DoubleSatisfaction