[LLVMdev] [klee-dev] GSoC Proposal: automatic function level testing

Urmas Repinski urrimus at hotmail.com
Sat May 4 02:42:10 PDT 2013


Hello, Anton.

> KLEE can generate tests only for main function level without any modifications of original code.

This is not actually correct, KLEE will generate inputs for any variable marked as symbolic (by klee_make_symbolic function) no difference whenever this variable in main() function or in any other function, most important that variable is activated for any combination of inputs, otherwise klee will not able to build any paths for this variable.
Same for arguments of the program (argv) and any symbolic files (by the way i were not able to activate symbolic files generation by klee, but maybe you will success....)

> First: parsing test code would collect input/output variables and global data.

Yes, will generate any possible paths and generate inputs for the paths.


> Second: variating by KLEE of input and global data used by function will provide basic testcase.

Not actually, you should not variate anything, simply necessary to set variables, that will be treated as inputs, symbolic.

> Third: generated testcases could be exported to test framewort (e.g. Google Test Framework).

For that is possible to write separate program, that will transfer klee generated data to suitable for Framework format.
I suggest to write a C++ program for example, that will get klee output, located in klee-last folder, as input and generate suitable data (investigate ktest-tool --write-ints klee-last/test000001.ktestcommand).

I suggest for the beginning to look through tutorials from KLEE page:
http://klee.llvm.org/Tutorial-1.html
http://klee.llvm.org/Tutorial-2.html

They provide many useful data.

Hope this helps,
Urmas Repinski.

Date: Fri, 3 May 2013 21:32:43 +0400
From: anton.vasilyev.87 at gmail.com
To: LLVMdev at cs.uiuc.edu
CC: klee-dev at imperial.ac.uk
Subject: [klee-dev] [LLVMdev] GSoC Proposal: automatic function level testing

Hello, probably it is too late to be involved in GSoC, by I want discuss following idea:


KLEE can generate tests only for main function level without any modifications of original code.
It passes args specified by command line.
I want implement automatic testcase generation for any imported function from tested code without its modification.First: parsing test code would collect input/output variables and global data.
Second: variating by KLEE of input and global data used by function will provide basic testcase.Third: generated testcases could be exported to test framewort (e.g. Google Test Framework).

This technic will be usefull for regress testing libraries stability and for check design by contract implementation.

I'm doing it as part of my MPhil work at MSU.
Looking forward for any advice.

-- 
Best Regards,
Anton Vasilyev



_______________________________________________
klee-dev mailing list
klee-dev at imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130504/de0d2207/attachment.html>


More information about the llvm-dev mailing list