1 Test-Generation Approach
1.1 Symbolic Execution in KLEE
1.2 Our Enhancements over KLEE
2 Architecture
3 Strengths and Weaknesses of the Approach
4 Tool Setup and Configuration
4.1 How to Use KLEEF
README
inside.build.sh
script in the repository root.4.2 Competition Configuration
--strip-unwanted-calls, --delete-dead-loops=false, --mock-all-externals
are used to (de)activate necessary LLVM passes to simplify bitcode for a symbolic execution. A parameter --external-calls=all
allows function calls with symbolic arguments. An option --libc=klee
makes KLEEF support an extended number of external functions.--cex-cache-validity-cores, --use-forked-solver=false, --solver-backend=bitwuzla-tree, --max-solvers-approx-tree-inc=16
are used to cache unsatisfiability cores and call a Bitwuzla solver incrementally.--symbolic-allocation-threshold=8192, --skip-not-lazy-initialized, --use-sym-size-alloc
are used to tune lazy initialization and dynamically allocated arrays.--fp-runtime
adds a floating point support. Parameters starting with --allocate-determ
activate X86 support. An option --x86FP-as-x87FP80
adds emulation of X86 floating points as extended 80 bit floating points.--max-memory
and --max-time
fix memory and time limit.--optimize=true
simplifies code before execution, e.g., it joins some branches to multiple blocks into selection instructions. Options --search=dfs --search=bfs
make KLEEF interleave between DFS and BFS. Options --function-call-reproduce=reach_error, --exit-on-error-type=Assert
make KLEEF run towards reach_error
function and fail only there. An option --dump-states-on-halt=unreached
permits KLEEF to generate tests for unfinished paths.--track-coverage=all
makes KLEEF track coverage by both branches and instructions. Options --optimize=false
and --optimize-aggressive=false
disable optimizations which decrease coverage. Options --use-iterative-deepening-search=max-cycles, --max-cycles-before-stuck=15
activate an iterative-deepening mode of execution on a number of executed loop cycles. A parameter --max-solver-time=10s
fixes a time limit for an SMT solver. An option --only-output-states-covering-new
makes KLEEF only generate tests which increase coverage. Options --search=dfs, --search=random-state
make KLEEF interleave between DFS and taking a random state. A parameter --dump-states-on-halt=all
makes KLEEF generate tests for the symbolic states remaining in the end. Options --cover-on-the-fly, --delay-cover-on-the-fly, --mem-trigger-cof
start on the fly test generation after approaching memory cap.