A similar tool exists for Java, although it doesn't rely on symbolic execution (but IIRC it is able to use it for integer constraints) but evolutionary test data generation [1]. There's a plugin for Eclipse too.
I tried it. Doesn't usually work all that well though, and basically only works on built in .Net types. If you pass in your own object containing only .Net types, it's not smart enough to fill those in with potential test data. Interesting idea, but I found it completely worthless
I can not test it at the moment but you may have to do the object creation inside a wrapper method.
public static void TestWrapper(String foo, Int32 bar, Boolean buzz, Decimal foobar)
{
var thing = new Thing(foo, bar);
thing.Buzz = buzz;
Test(thing, blah);
}
public static Test(Thing thing, Decimal foobar)
{
thing.DoStuff();
if (thing.State == 42)
{
thing.DoOtherStuff(foobar);
}
}
In my experience Pex yields really great results when you use it to analyze methods that are close to mathematically functions with not to many side effects and especially state mutation. Tracking changing state over time and finding sequences of operations to prepare an object to a certain state and then checking the behavior of the object in this state is much harder than analyzing a (almost) pure function.
The QuickCheck manual states that they are randomly generating test cases [1]. This tool is build on top of Pex [2] which analyzes the byte code and uses the Z3 theorem prover [3] to systematically find inputs covering all code paths. This is really a impressive and powerful tool. You can have some fun with it at the Pex for fun site [4]. There is some secret code and you have to reimplement that code based on the test results generated by Pex comparing your implementation to the secret implementation.
It's better than QuickCheck. It performs whitebox testing - that is, it has knowledge of the code and actively uses this to generate inputs that explore all possible branches.
[+] [-] testbro|13 years ago|reply
[1] : http://www.evosuite.org
[+] [-] Aurel1us|13 years ago|reply
[+] [-] judah|13 years ago|reply
[+] [-] monksy|13 years ago|reply
[+] [-] earlz|13 years ago|reply
[+] [-] danbruc|13 years ago|reply
[+] [-] romaniv|13 years ago|reply
[+] [-] nickbarnwell|13 years ago|reply
Am I misunderstanding, or is this akin to QuickCheck for C#?
[+] [-] danbruc|13 years ago|reply
[1] http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html [2] http://research.microsoft.com/en-us/projects/pex/ [3] http://research.microsoft.com/en-us/projects/z3m/ [4] http://www.pexforfun.com/
[+] [-] porges|13 years ago|reply
[+] [-] suyash|13 years ago|reply
[+] [-] Yuioup|13 years ago|reply