Evaluating scalacheck

23 views
Skip to first unread message

Bastl

unread,
Feb 10, 2012, 11:14:25 AM2/10/12
to scalacheck
Hi all

I'd like to evaluate scalacheck to test parts of a big java legacy
app. Perhaps this could be a way to introduce scala into our
landscape ... Here's my (obfuscated) context:

We process incoming files in various formats, parse them to generic
objects and validate these objects against business rules.

The interface to these rules looks like this:

void validate(Generic object, Context context);
boolean enabled(Generic object, Context context);

The result is written to the context (as a sideeffect) like this:
context.getResult.getErrorList.add(new Error). The rules are further
enabled at runtime based on conditions on the object and context and
assembled per format by spring configurations: For each format we have
a number of such rules.

What would be the "scalacheck" way to test these rules / sets of
rules ? They are the closest thing to pure functions we have in the
app :-)

I have quite some experience with FP (haskell), but never really used
QuickCheck, only skimmed the paper and did some very first steps. So
please give me some ideas how to proceed:

- howto test java from scala ?
- howto define respective properties/predicates ?
- howto define generators for the custom generic objects ?

Thanks, Bastl
Reply all
Reply to author
Forward
0 new messages