Lecture: Testing and verification
Question
Describe one type of bugs that cannot be prevented by KLEE
and one type of bugs that cannot be prevented by STACK.
overview
- how to test your xv6 kernel
- what’s considered correct (specification)?
- complex input sources & state transitions
- randomly generate sytem calls and interrupts?
- challenge: generate “useful” tests
- types of tools
- static tools: analyze source code without running (a smart compiler)
- dynamic tools: run the code (and can try to break it)
- the line is blurred
- false positives vs. false negatives
- examples
- try the following code example
- static analysis: run the analyzer in Xcode
- compile using gcc/clang’s
-fsanitize=address
- try the following code example
- clang -fsanitize=fuzzer -g -o test test.c
- cbmc --function test_me --trace test.c
- run this in KLEE yourself
other approaches