Generating semantically valid test inputs using constrained input grammars

Abstract Context Generating test cases based on software input interface is a black-box testing technique that can be made more effective by using structured input models such as input grammars. Automatically generating grammar-based test inputs may lead to structurally valid but semantically invalid inputs that may be rejected in early semantic error checking phases of a system under test. Objective This paper aims to introduce a method for specifying a grammar-based input model with the model’s semantic constraints to be used in the generation of positive test inputs. It is also important that the method can generate effective test suites based on appropriate grammar-based coverage criteria. Method Formal specification of both input structure and input semantics provides the opportunity to use model instantiation techniques to create model instances that satisfy all specified constraints. The input interface of a subject system can be specified using a high-level specification scheme such as attribute grammars, and a transformation function from this scheme to an instantiable formal modeling language can generate the desired model instances. Results We propose a declarative grammar-based input specification method that is based on a variation of attribute grammars and allows the user to specify input constraints in addition to input structure. The model can be instantiated automatically to generate structurally and semantically valid test inputs. The proposed method has the capability to specify test requirements and coverage criteria and use them to generate valid test suites that satisfy test coverage criteria requirements. Conclusion The work presented in this paper provides a black-box test generation method for grammar-based software inputs that can automatically generate criteria-covering test suites.

[1]  Sarfraz Khurshid,et al.  Generalized Symbolic Execution for Model Checking and Testing , 2003, TACAS.

[2]  Sarfraz Khurshid,et al.  Software assurance by bounded exhaustive testing , 2004, IEEE Transactions on Software Engineering.

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

[4]  P. Purdom A sentence generator for testing parsers , 1972 .

[5]  Ralf Lämmel,et al.  Two-dimensional Approximation Coverage , 2000, Informatica.

[6]  A. Jefferson Offutt,et al.  Introduction to Software Testing , 2008 .

[7]  Zongyan Qiu,et al.  Automatic Grammar-Based Test Generation , 2013, ICTSS.

[8]  Daniel Jackson,et al.  Software Abstractions - Logic, Language, and Analysis , 2006 .

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

[10]  Niklas Sörensson,et al.  An Extensible SAT-solver , 2003, SAT.

[11]  Sarfraz Khurshid,et al.  Korat: automated testing based on Java predicates , 2002, ISSTA '02.

[12]  Dragan Gasevic,et al.  Grammar-based test generation for software product line feature models , 2012, CASCON.

[13]  Sarfraz Khurshid,et al.  Testing Software Product Lines Using Incremental Test Generation , 2008, 2008 19th International Symposium on Software Reliability Engineering (ISSRE).

[14]  Sergey V. Zelenov,et al.  Automated Generation of Positive and Negative Tests for Parsers , 2005, FATES.

[15]  Tevfik Bultan,et al.  Client and server verification for web services using interface grammars , 2008, TAV-WEB '08.

[16]  Michael D. Ernst,et al.  HAMPI: a solver for string constraints , 2009, ISSTA.

[17]  Sarfraz Khurshid,et al.  Test input generation with java PathFinder , 2004, ISSTA '04.

[18]  Mark Hennessy,et al.  Analysing the effectiveness of rule-coverage as a reduction criterion for test suites of grammar-based software , 2008, Empirical Software Engineering.

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

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

[21]  Sarfraz Khurshid,et al.  TestEra: Specification-Based Testing of Java Programs Using SAT , 2004, Automated Software Engineering.

[22]  Klaus Havelund,et al.  Model checking programs , 2000, Proceedings ASE 2000. Fifteenth IEEE International Conference on Automated Software Engineering.

[23]  David L. Dill,et al.  A Decision Procedure for Bit-Vectors and Arrays , 2007, CAV.

[24]  Qingyi Hua An approach to user interface specification with attribute grammars , 2008, Journal of Computer Science and Technology.

[25]  David Coppit,et al.  yagg: an easy-to-use generator for structured test inputs , 2005, ASE.

[26]  Mikhail Posypkin,et al.  Survey of Compiler Testing Methods , 2005, Programming and Computer Software.

[27]  Emina Torlak,et al.  Kodkod: A Relational Model Finder , 2007, TACAS.

[28]  Mikhail Posypkin,et al.  Automated Generation of Strictly Conforming Tests Based on Formal Specification of Dynamic Semantics of the Programming Language , 2004, Programming and Computer Software.

[29]  Sarfraz Khurshid,et al.  Annotations for Alloy: Automated Incremental Analysis Using Domain Specific Solvers , 2012, ICFEM.

[30]  Mark Hennessy,et al.  A test-driven development strategy for the construction of grammar-based software. , 2006 .

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

[32]  Derek Rayside,et al.  Extending Alloy with Partial Instances , 2012, ABZ.

[33]  Chao Liu,et al.  Test criteria for context-free grammars , 2004, Proceedings of the 28th Annual International Computer Software and Applications Conference, 2004. COMPSAC 2004..

[34]  Ralf Lämmel,et al.  Controllable Combinatorial Coverage in Grammar-Based Testing , 2006, TestCom.

[35]  Viljem Zumer,et al.  Grammar-Based Systems: Definition and Examples , 2004, Informatica.