Coverage Guided, Property Based Testing

Subscribers:
344,000
Published on ● Video Link: https://www.youtube.com/watch?v=RR6c_fiMfJQ



Category:
Guide
Duration: 47:48
418 views
12


Property-based random testing, exemplified by frameworks such as Haskell's QuickCheck, works by testing an executable predicate (a property) on a stream of randomly generated inputs. Property testing works very well in many cases, but not always. Some properties are conditioned on the input satisfying demanding semantic invariants that are not consequences of its syntactic structure-e.g., that an input list must be sorted or have no duplicates. Most randomly generated inputs fail to satisfy properties with such sparse preconditions, and so are simply discarded. As a result, much of the target system may go untested.

We address this issue with a novel technique called coverage guided, property based testing (CGPT). Our approach is inspired by the related area of coverage guided fuzzing, exemplified by tools like AFL. Rather than just generating a fresh random input at each iteration, CGPT can also produce new inputs by mutating previous ones using type-aware, generic mutation operators. The target program is instrumented to track which control flow branches are executed during a run and inputs whose runs expand control-flow coverage are retained for future mutations. This means that, when sparse conditions in the target are satisfied and new coverage is observed, the input that triggered them will be retained and used as a springboard to go further.

We have implemented CGPT as an extension to the QuickChick property testing tool for Coq programs; we call our implementation FuzzChick. We evaluate FuzzChick on two Coq developments for abstract machines that aim to enforce flavors of noninterference, which has a (very) sparse precondition. We systematically inject bugs in the machines' checking rules and use FuzzChick to look for counterexamples to the claim that they satisfy a standard noninterference property. We find that vanilla QuickChick almost always fails to find any bugs after a long period of time, as does an earlier proposal for combining property testing and fuzzing. In contrast, FuzzChick often finds them within seconds to minutes. Moreover, FuzzChick is almost fully automatic; although highly tuned, hand-written generators can find the bugs faster than FuzzChick, they require substantial amounts of insight and manual effort.

Joint work with Leonidas Lampropoulos and Benjamin Pierce.

Talk slides: https://www.microsoft.com/en-us/research/uploads/prod/2019/09/5d8bf89309ae6-5d8bf89309ae7Coverage-Guided-Property-Based-Testing.pdf.pdf

Learn more about this talk and many others at Microsoft Research: https://www.microsoft.com/en-us/research/video/coverage-guided-property-based-testing/




Other Videos By Microsoft Research


2019-09-30How Not to Prove Your Election Outcome
2019-09-30The Worst Form Including All Those Others: Canada’s Experiments with Online Voting
2019-09-30DIFF: A Relational Interface for Large-Scale Data Explanation
2019-09-30A Calculus for Brain Computation
2019-09-26Decoding Multisensory Attention from Electroencephalography for Use in a Brain-Computer Interface
2019-09-26A Short Introduction to DIMACS & DIMACS and MSR-NYC
2019-09-26Boosting Innovation and Discovery of Ideas
2019-09-26Resource-Efficient Redundancy for Large-Scale Data Processing and Storage Systems
2019-09-26Optimizing Declarative Graph Queries at Large Scale
2019-09-25SILK: Preventing Latency Spikes in Log-Structured Merge Key-Value Stores
2019-09-25Coverage Guided, Property Based Testing
2019-09-25Efficient Robot Skill Learning: Grounded Simulation Learning and Imitation Learning from Observation
2019-09-25Towards Secure and Interpretable AI: Scalable Methods, Interactive Visualizations, & Practical Tools
2019-09-25Sequential Estimation of Quantiles with Applications to A/B-testing and Best-arm Identification
2019-09-25Reproducible Codes and Cryptographic Applications
2019-09-25Inside AR and VR, a technical tour of the reality spectrum with Dr. Eyal Ofek [Podcast]
2019-09-24Verifying Web Page Layouts
2019-09-23Battling Unfair Demons in Peer Review
2019-09-19Engaging with Students and Parents in Bellevue School District in Multilingual Settings
2019-09-19Internship Program - MSR Montreal
2019-09-19Recent Advances in Unsupervised Image-to-Image Translation



Tags:
Property-based random testing
Haskell's QuickCheck
Property testing
coverage guided property based testing
CGPT
random testing
fuzzing
FuzzChick
Microsoft Research
MSR
programming languages