ethereum/act

Test: Negative QuickCheck Tests

d-xo opened this issue · 0 comments

d-xo commented

The current quickcheck tests only produce behaviours that should typecheck. It would be cool to have a generator that produces behaviours that should fail to typecheck.

One possible approach would be to introduce some known bad mutations into the behaviours produced from the current generator. Some ideas:

  1. Multiple writes to the same storage location
  2. Duplicated behaviour names
  3. Duplicated names for storage entries in the constructor definition
  4. Duplicated names for calldata args

Many bad specs are impossible to generate at the level of the Refined AST (e.g. we cannot produce an expression adding a bool to an int), so perhaps in the future we may wish to investigate a generator that produces act as a string directly which would give us a lot more freedom in producing incorrect acts.