sageserpent-open / americium

Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15 stars 1 forks source link

Properties that don't repeat themselves. #10

Closed sageserpent-open closed 1 year ago

sageserpent-open commented 3 years ago

Scalacheck has verbose properties - one writes the assertion as code, then one writes a description so that when the property fails it is clear what went wrong - this is especially important when properties are combined together and a sub-property fails in a wider context.

Scalatest is more concise, in that the assertion DSL tries to explain the cause of failure by itself based on the specific DSL expression, but even then, one often has to resort to giving clues when the DSL doesn't quite capture what the test author is trying to prove.

What would be nice is some kind of macro magic whereby we have sub-properties reminiscent of Scalacheck's, only these can describe their internal expression structure when they fail. When they are combined together, the overall property can be used to provide a contextual clue about the failing sub-property - we don't just want to see a giant assertion expression failing, rather we want the overall expression to point to the part that is failing and the failing part to describe itself.

sageserpent-open commented 1 year ago

Expecty fits the bill nicely, so let's close this ticket and use that instead!