5 ms·
I'll prefix my question by saying I'm unfamiliar with QC beyond knowing of its existence and roughly what it does in terms of generating test values: Am I misu
by nickbarnwell 13y ago
I'll prefix my question by saying I'm unfamiliar with QC beyond knowing of its existence and roughly what it does in terms of generating test values:
Am I misunderstanding, or is this akin to QuickCheck for C#?
- danbruc 13y agoThe 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. [1] http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html [2] http://research.microsoft.com/en-us/projects/pex/ http://research.microsoft.com/en-us/projects/pex/ [3] http://research.microsoft.com/en-us/projects/z3m/ http://research.microsoft.com/en-us/projects/z3m/ [4] http://www.pexforfun.com/ http://www.pexforfun.com/
- 0x0 13y agoThe pexforfun thing seemed pretty clever: // What values of v and i can cause an exception? Ask Pex to find out! public static void Puzzle(int[] v, int i) { if (v[i + 2] + 5 == v.Length + i) throw new Exception("hidden bug!"); } and then it automatically finds the breaking input: {-6} -2 Exception hidden bug!
- porges 13y agoIt'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.