A test-driven development strategy for the construction of grammar-based software.

Grammar-based software is increasingly becoming a prominent and well defined subset of software engineering through the popularity of analysis tools, metrics evaluators and the increasing prevalence of software tools that rely upon extensible data such as XML. Software-testing plays a crucial role in the lifecycle of any modern software system, hence the correct and adequate testing of grammar-based software is essential. This thesis provides a review of the current research and practice in the field of grammar-based software. The motivation behind software-testing is examined and a summary of existing testing techniques is presented. This leads to a detailed empirical comparison of test-suites for grammar-based software. The effectiveness of test-suite generation via methods such as Purdom’s algorithm is contrasted with test-suite reduction via a novel elaboration of the notion of coverage for a grammar. The effectiveness of this strategy is discussed with regard to two testing analysis criteria: code coverage and fault detection. The second contribution of this thesis is the definition of a framework for developing grammar-based software within a strict test-driven environment. We describe the techniques used to develop a static analysis tool for the ISO C++ grammar and the verification of its correct operation via standardised test-suites. This work was completed in two distinct phases. The first phase involves porting an existing system from C++ to Java by combining eXtreme Porting with an order for porting derived from a novel use of Object Relation Diagrams. The second phase involves a large automated testing process including black-box testing, coverage comparisons and comparisons of reverse-engineered UML sequence diagrams from program traces. The third contribution of this thesis involves the utilisation of the generalised parsing algorithm, GLR, in the implementation of a parser generator. We describe the design and test-driven development of this parser generator, and its practical application as part of an analysis tool for ISO C++. Finally, we provide a study of the performance of a generated GLR parser when parsing ISO C++ programs, and a comparison with an existing system based on a generated backtracking parser.

[1]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[2]  Rainer Koppler A Systematic Approach to Fuzzy Parsing , 1997 .

[3]  Ippolito Spadafora,et al.  An Automatic Generator for Compiler Testing , 1982, IEEE Transactions on Software Engineering.

[4]  Shigeru Chiba,et al.  A metaobject protocol for C++ , 1995, OOPSLA.

[5]  Daniel Hoffman,et al.  Blowtorch: a framework for firewall test automation , 2005, ASE.

[6]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[7]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[8]  Computer Science Technical Report , .

[9]  Mark Hennessy,et al.  gccXfront: exploiting gcc as a front end for program comprehension tools via XML/XSLT , 2003, 11th IEEE International Workshop on Program Comprehension, 2003..

[10]  William G. Griswold,et al.  Getting started with ASPECTJ , 2001, CACM.

[11]  Adrian Johnstone,et al.  Right nulled GLR parsers , 2006, TOPL.

[12]  Kent L. Beck,et al.  Test-driven Development - by example , 2002, The Addison-Wesley signature series.

[13]  Brian A. Malloy,et al.  Applying software engineering techniques to parser design: the development of a C # parser , 2002 .

[14]  Borivoj Melichar,et al.  Even faster generalized LR parsing , 2001, Acta Informatica.

[15]  D. Parigot,et al.  Two-dimensional Approximation Coverage , 2000 .

[16]  Gregor Kiczales,et al.  Aspect-oriented programming , 1996, CSUR.

[17]  Arie van Deursen,et al.  The Asf+Sdf Meta-Environment: a Component-Based Language Development Environment , 2001, LDTA@ETAPS.

[18]  George C. Necula,et al.  Elkhound: A Fast, Practical GLR Parser Generator , 2003, CC.

[19]  Atif M. Memon GUI Testing: Pitfalls and Process , 2002, Computer.

[20]  Robert V. Binder,et al.  Testing Object-Oriented Systems: Models, Patterns, and Tools , 1999 .

[21]  Simeon C. Ntafos,et al.  A Comparison of Some Structural Testing Strategies , 1988, IEEE Trans. Software Eng..

[22]  J. Rekers,et al.  Parser Generation for Interactive Environments , 1992 .

[23]  Lionel C. Briand,et al.  Towards the reverse engineering of UML sequence diagrams , 2003, 10th Working Conference on Reverse Engineering, 2003. WCRE 2003. Proceedings..

[24]  Dave Astels,et al.  Test Driven Development: A Practical Guide , 2003 .

[25]  Lionel C. Briand,et al.  Tracing distributed systems executions using AspectJ , 2005, 21st IEEE International Conference on Software Maintenance (ICSM'05).

[26]  Edward D. Willink,et al.  Meta-compilation for C++ , 2001 .

[27]  Brian A. Malloy,et al.  Decorating tokens to facilitate recognition of ambiguous language constructs , 2003, Softw. Pract. Exp..

[28]  D. J. Robson,et al.  A framework for testing object-oriented programs , 1992 .

[29]  Arie van Deursen,et al.  The ASF+SDF Meta-environment: A Component-Based Language Development Environment , 2001 .

[30]  Christopher W. Pidgeon,et al.  DMS®: Program Transformations for Practical Scalable Software Evolution , 2002, IWPSE '02.

[31]  Gregg Rothermel,et al.  An experimental determination of sufficient mutant operators , 1996, TSEM.

[32]  Joseph Robert Horgan,et al.  Effect of Test Set Minimization on Fault Detection Effectiveness , 1995, 1995 17th International Conference on Software Engineering.

[33]  Susan Elliott Sim,et al.  On using a benchmark to evaluate C++ extractors , 2002, Proceedings 10th International Workshop on Program Comprehension.

[34]  Brian A. Malloy,et al.  Testing C++ Compilers for ISO Language Conformance , 2002 .

[35]  Barbara G. Ryder,et al.  Constructing precise object relation diagrams , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[36]  Brian A. Malloy,et al.  Exploiting UML dynamic object modeling for the visualization of C++ programs , 2005, SoftVis '05.

[37]  Olaf Spinczyk,et al.  AspectC++ – An AOP Extension for C++ , 2005 .

[38]  Mark Hennessy,et al.  Ensuring behavioural equivalence in test-driven porting , 2006, CASCON.

[39]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[40]  Brian A. Malloy,et al.  An Interpretation of Purdom's Algorithm forAutomatic Generation of Test Cases , 2001 .

[41]  Edsger W. Dijkstra,et al.  Notes on structured programming , 1970 .

[42]  Mary Jean Harrold,et al.  Test-Suite Reduction and Prioritization for Modified Condition/Decision Coverage , 2003, IEEE Trans. Software Eng..

[43]  Brian A. Malloy,et al.  Progression Toward Conformance for C++ Language Compilers , 2003 .

[44]  Gul A. Agha,et al.  Concurrent object-oriented programming , 1993, CACM.

[45]  Tibor Gyimóthy,et al.  Columbus - reverse engineering tool and schema for C++ , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[46]  Alistair Cockburn,et al.  Agile Software Development , 2001 .

[47]  Peter J. Clarke,et al.  A parameterized cost model to order classes for class-based testing of C++ applications , 2003, 14th International Symposium on Software Reliability Engineering, 2003. ISSRE 2003..

[48]  Gregg Rothermel,et al.  An empirical study of the effects of minimization on the fault detection capabilities of test suites , 1998, Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272).

[49]  Rajiv Gupta,et al.  A methodology for controlling the size of a test suite , 1990, Proceedings. Conference on Software Maintenance 1990.

[50]  Merijn de Jonge,et al.  HASDF : a generalized LR-parser generator for Haskell , 1999 .

[51]  Mats P. E. Heimdahl,et al.  Test-suite reduction for model based tests: effects on test quality and implications for testing , 2004 .

[52]  Clifford J. Maloney,et al.  Systematic mistake analysis of digital computer programs , 1963, CACM.

[53]  Kuo-Chung Tai,et al.  Test order for inter-class integration testing of object-oriented software , 1997, Proceedings Twenty-First Annual International Computer Software and Applications Conference (COMPSAC'97).

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

[55]  A. Jefferson Offutt,et al.  MuJava: an automated class mutation system , 2005, Softw. Test. Verification Reliab..

[56]  Mark Hennessy,et al.  An analysis of rule coverage as a criterion in generating minimal test suites for grammar-based software , 2005, ASE.

[57]  Susan L. Graham,et al.  Incremental analysis of real programming languages , 1997, PLDI '97.

[58]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[59]  Mats Per Erik Heimdahl,et al.  Test-suite reduction for model based tests: effects on test quality and implications for testing , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[60]  J.F. Power Program annotation in XML : a parser-based approach , 2002 .

[61]  Masaru Tomita,et al.  Efficient parsing for natural language , 1985 .

[62]  Daniel S. Hirschberg,et al.  Algorithms for the Longest Common Subsequence Problem , 1977, JACM.

[63]  Carlo Ghezzi,et al.  Compiler testing using a sentence generator , 1980, Softw. Pract. Exp..

[64]  14th International Symposium on Software Reliability Engineering , 2003, 14th International Symposium on Software Reliability Engineering, 2003. ISSRE 2003..

[65]  A. Rountev,et al.  Object naming analysis for reverse-engineered sequence diagrams , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[66]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[67]  K. Beck,et al.  Extreme Programming Explained , 2002 .

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

[69]  Michel Dagenais,et al.  Parsing C++ despite missing declarations , 1999, Proceedings Seventh International Workshop on Program Comprehension.

[70]  Russell W. Quong,et al.  ANTLR: A predicated‐LL(k) parser generator , 1995, Softw. Pract. Exp..

[71]  Alon Lavie,et al.  Glr*: a robust grammar-focused parser for spontaneously spoken language , 1996 .

[72]  W. Eric Wong,et al.  Effect of test set minimization on fault detection effectiveness , 1998 .

[73]  J.F. Power,et al.  Symbol table construction and name lookup in ISO C++ , 2000, Proceedings 37th International Conference on Technology of Object-Oriented Languages and Systems. TOOLS-Pacific 2000.

[74]  David Chenho Kung,et al.  Design recovery for software testing of object-oriented programs , 1993, [1993] Proceedings Working Conference on Reverse Engineering.

[75]  Ralf Lämmel,et al.  Towards an engineering discipline for GRAMMARWARE Draft as of August 17 , 2003 , 2003 .

[76]  Lionel C. Briand,et al.  Revisiting strategies for ordering class integration testing in the presence of dependency cycles , 2001, Proceedings 12th International Symposium on Software Reliability Engineering.

[77]  Ceriel J. H. Jacobs,et al.  Parsing Techniques - A Practical Guide , 2007, Monographs in Computer Science.

[78]  A. DeMilloR.,et al.  Hints on Test Data Selection , 1978 .

[79]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[80]  Beth Tibbitts,et al.  NextGen eXtreme porting: structured by automation , 2005, SAC '05.

[81]  Brian A. Malloy,et al.  A metrics suite for grammar-based software , 2004, J. Softw. Maintenance Res. Pract..

[82]  Ralf Lämmel,et al.  Grammar Testing , 2001, FASE.

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

[84]  Brian A. Malloy,et al.  Exploiting metrics to facilitate grammar transformation into LALR format , 2001, SAC.

[85]  Brian A. Malloy,et al.  The design and implementation of a parser and front-end for the iso c++ language and validation of the parser , 2003 .