Efficient monitoring of parametric context-free patterns

Recent developments in runtime verification and monitoring show that parametric regular and temporal logic specifications can be efficiently monitored against large programs. However, these logics reduce to ordinary finite automata, limiting their expressivity. For example, neither can specify structured properties that refer to the call stack of the program. While context-free grammars (CFGs) are expressive and well-understood, existing techniques for monitoring CFGs generate large runtime overhead in real-life applications. This paper demonstrates that monitoring parametric CFGs is practical (with overhead on the order of 12% or lower in most cases). We present a monitor synthesis algorithm for CFGs based on an LR(1) parsing algorithm, modified to account for good prefix matching. In addition, a logic-independent mechanism is introduced to support matching against the suffixes of execution traces.

[1]  Grigore Rosu,et al.  Towards Monitoring-Oriented Programming: A Paradigm Combining Specification and Implementation , 2003, RV@CAV.

[2]  Grigore Rosu,et al.  Parametric Trace Slicing and Monitoring , 2009, TACAS.

[3]  Gary T. Leavens,et al.  JML: notations and tools supporting detailed design in Java , 2000 .

[4]  Grigore Rosu,et al.  Monitoring Java Programs with Java PathExplorer , 2001, RV@CAV.

[5]  Grigore Rosu,et al.  Efficient Formalism-Independent Monitoring of Parametric Properties , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[6]  Emin Gün Sirer,et al.  Using production grammars in software testing , 1999, DSL '99.

[7]  Marcelo d'Amorim,et al.  Checking and Correcting Behaviors of Java Programs at Runtime with Java-MOP , 2006, RV@CAV.

[8]  Ondrej Lhoták,et al.  Adding trace matching with free variables to AspectJ , 2005, OOPSLA '05.

[9]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[10]  A. G. Duncan,et al.  Using attributed grammars to test designs and implementations , 1981, ICSE '81.

[11]  Oege de Moor,et al.  Making trace monitors feasible , 2007, OOPSLA.

[12]  Marcelo d'Amorim,et al.  A Formal Monitoring-Based Framework for Software Development and Analysis , 2004, ICFEM.

[13]  Mahesh Viswanathan,et al.  Java-MaC: A Run-Time Assurance Approach for Java Programs , 2004, Formal Methods Syst. Des..

[14]  Marcelo d'Amorim,et al.  Event-based runtime verification of java programs , 2005, WODA '05.

[15]  Mark Harman,et al.  Pareto efficient multi-objective test case selection , 2007, ISSTA '07.

[16]  Ondrej Lhoták,et al.  A Staged Static Program Analysis to Improve the Performance of Runtime Monitoring , 2007, ECOOP.

[17]  D UllmanJeffrey,et al.  Introduction to automata theory, languages, and computation, 2nd edition , 2001 .

[18]  Narciso Martí-Oliet,et al.  All About Maude - A High-Performance Logical Framework, How to Specify, Program and Verify Systems in Rewriting Logic , 2007, All About Maude.

[19]  Tevfik Bultan,et al.  Interface Grammars for Modular Software Model Checking , 2007, IEEE Transactions on Software Engineering.

[20]  Howard Barringer,et al.  Rule Systems for Run-time Monitoring: from Eagle to RuleR , 2010, J. Log. Comput..

[21]  David Pager,et al.  A practical general method for constructing LR(k) parsers , 1977, Acta Informatica.

[22]  Grigore Rosu,et al.  Mop: an efficient and generic runtime verification framework , 2007, OOPSLA.

[23]  Marcelo d'Amorim,et al.  Event-based runtime verification of java programs , 2005, ACM SIGSOFT Softw. Eng. Notes.

[24]  Jeffrey D. Ullman,et al.  Introduction to Automata Theory, Languages and Computation , 1979 .

[25]  Bernard Houssais,et al.  Verification of an Algol 68 implementation , 1977, Strathclyde ALGOL 68 Conference.

[26]  Grigore Rosu,et al.  Efficient Monitoring of Parametric Context-Free Patterns , 2008, ASE.

[27]  Swarat Chaudhuri,et al.  Instrumenting C Programs with Nested Word Monitors , 2007, SPIN.

[28]  Peter M. Maurer,et al.  Generating test data with enhanced context-free grammars , 1990, IEEE Software.

[29]  Bart Jacobs,et al.  JML (poster session): notations and tools supporting detailed design in Java , 2000, OOPSLA '00.

[30]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[31]  Paul Walton Purdom,et al.  A sentence generator for testing parsers , 1972 .

[32]  Howard Barringer,et al.  Rule Systems for Run-Time Monitoring: From Eagleto RuleR , 2007, RV.

[33]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[34]  Benjamin Livshits,et al.  Finding application errors and security flaws using PQL: a program query language , 2005, OOPSLA '05.

[35]  Alexander Aiken,et al.  Relational queries over program traces , 2005, OOPSLA '05.

[36]  Fred B. Schneider,et al.  Enforceable security policies , 2000, TSEC.

[37]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[38]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[39]  K. V. Hanford,et al.  Automatic Generation of Test Cases , 1970, IBM Syst. J..