← back to backlog: veritas

Native Property-Based Testing (PBT)

status

work-in-progress

type

task

description

Now it's clear that data-driven (table) testing is easy using map and apply. The next logical evolutionary step for a Lisp-powered framework is Property-Based Testing inspired by QuickCheck.

The Improvement: Add a property macro alongside test and suite.

(property "Reverse of reverse is the original list"
          #:generators (list gen-list)
          #:thunk (lambda (xs)
                    (assert-equal #:expect xs #:got (reverse (reverse xs)))))

Veritas could automatically generate 100 random inputs, execute the assertion, and--if it fails--attempt to "shrink" the failing input to its smallest reproducible form.

veritas-362