QuickCheck is a neat Haskell tool for specifying properties that should hold for functions and firing lots of random inputs into those functions to test that the properties hold true. JUnit's answer to such properties is the notion of "theories." Using some annotations and ParameterSuppliers, it should be possible to generate some number of random values for theory parameters. To test this out, I've started a project on GitHub called junit-quickcheck. It's rather embryonic at this point, but I hope to grow it into something lots of people can benefit from.

A quick example:

```
@RunWith(Theories.class)
public class AbsoluteValue {
// fire 100 random ints at the theory
@Theory
public void isAdditiveInverse(@ForAll int i) {
assumeThat(i, lessThan(0));
assertEquals(-i, Math.abs(i));
}
}
```

What about remembering previously successful/failed values? Restricting/broadened sample size? So many possibilities...

## Recent Comments

AntiXian666:Paul, is the EnclosedInners test runner publicl... | more »Brian Oxley:Yay!... | more »Robin Gates:How about... Timelets or Microtime ... | more »