Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ksen007/janala2
a concolic testing engine for Java
https://github.com/ksen007/janala2
Last synced: 9 days ago
JSON representation
a concolic testing engine for Java
- Host: GitHub
- URL: https://github.com/ksen007/janala2
- Owner: ksen007
- License: bsd-2-clause
- Created: 2012-06-19T15:15:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T02:51:10.000Z (over 6 years ago)
- Last Synced: 2024-08-01T18:24:51.101Z (3 months ago)
- Language: Java
- Size: 11.3 MB
- Stars: 99
- Watchers: 14
- Forks: 34
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - CATG - Concolic unit testing engine. Automatically generates unit tests using formal methods. (Projects / Formal Verification)
- awesome-symbolic-execution - CATG - Concolic execution tool that uses [ASM](http://asm.ow2.org/) for instrumentation. Uses CVC4. (Tools / Java)
README
CATG
========CATG is a concolic unit testing engine for Java programs. The implementation uses ASM for instrumentation.
ASM instrumentation instruments (see janala.instrument.*) class files at runtime and dumps (see janala.logger.*)
to a file a log of all instructions executed by the program and all values loaded from local stacks and heaps.
A concolic execution engine (see janala.interpreters.*) then takes the log and performs both symbolic and
concrete interpretation of the logged instructions.You must have java, gradle, cvc4 (http://cvc4.cs.nyu.edu/downloads/), and python 2.7 in your PATH. Two extra jar files are needed to run the tool. Create a `lib` directory in the root directory and download the following jar files
* asm-all-5.0.4.jar: http://mvnrepository.com/artifact/org.ow2.asm/asm-all/5.0.4 (Direct link: http://central.maven.org/maven2/org/ow2/asm/asm-all/5.0.4/asm-all-5.0.4.jar)
* automaton-1.11-8.jar: http://mvnrepository.com/artifact/dk.brics.automaton/automaton/1.11-8 (Direct link: http://central.maven.org/maven2/dk/brics/automaton/automaton/1.11-8/automaton-1.11-8.jar)
* emma.jar: https://mvnrepository.com/artifact/emma/emma/2.1.5320 (Direct link: http://central.maven.org/maven2/emma/emma/2.1.5320/emma-2.1.5320.jar)place them in the `lib` directory. Then invoke
gradle build
andgradle integrationTest
To run the the full integration tests, use./setup.sh # This builds CATG and copy it to lib/
python testall.pyTo run tests and see coverage report, use
gradle build
gradle jacocoTestReportThis runs the tests using online concolic execution. To run tests with offline concolic execution, use
python --offline testall.py
If you want to generate tests on a Java class file having a main method, you need to use the concolic.py script. For example, the following command generates test inputs for the class tests.Testme (the java source of this class can be found in [src/integration/java/tests/Testme.java](src/integration/java/tests/Testme.java).
python concolic.py --coverage 100 tests.Testme
### Usage
python janala/concolic.py -h
usage: concolic.py [-h] [--offline] [-v] [-c] [-D D]
maxIterations className [arguments [arguments ...]]positional arguments:
maxIterations Maximum number of times the program under test can be
executed.
className Java class to be tested.
arguments Arguments passed to the program under test.optional arguments:
-h, --help show this help message and exit
--offline Perform concolic testing offline. An intermediate trace file
is generated during the execution of the program. offilne
mode results in 2X slowdown that non-offline mode
-v, --verbose Print commands that are executed.
-c, --coverage Compute detailed coverage by rerunning tests.
-D D JVM options