Questions: Fuzzing and Formal Methods

5 questions to test your understanding

Score: 0 / 5
Question 1 Short Answer

Coverage-guided fuzzing measures code coverage (e.g., number of branches executed) and generates new inputs to increase coverage. Why is coverage guidance more effective than random testing?

Think about your answer, then reveal below.
Question 2 Short Answer

Grammar-based fuzzing generates inputs using formal specifications (e.g., context-free grammars). How does this differ from random input generation?

Think about your answer, then reveal below.
Question 3 Short Answer

Metamorphic testing is a formal methods technique for fuzzing. If you have a program function sqrt(x) that computes square roots, a metamorphic relation might be: sqrt(4*x^2) = 2*sqrt(x^2) = 2*abs(x). How does this enable bug detection?

Think about your answer, then reveal below.
Question 4 Multiple Choice

Hybrid fuzzing combines fuzzing with symbolic execution. When should you use fuzzing vs. symbolic execution vs. the hybrid?

AUse fuzzing for all programs; symbolic execution is never needed
BUse symbolic execution for all programs; fuzzing is a legacy technique
CFuzzing is fast but may miss rare paths; symbolic execution is slow but exhaustive. Hybrid approaches use fuzzing for rapid exploration and symbolic execution to verify promising paths or verify the hardest constraints. Choose based on program complexity and time budget
DThey are equivalent; the choice doesn't matter
Question 5 Short Answer

Spec-based fuzzing uses formal specifications to generate inputs and check properties. What formal specification languages are commonly used for fuzzing?

Think about your answer, then reveal below.