Contract-Driven Testing of JavaScript Code

JSConTest is a tool that enhances JavaScript with simple, type-like contracts and provides a framework for monitoring and guided random testing of programs against these contracts at the same time. Function contracts in JSConTest serve a dual role as specifications of the input/output behavior and as test case generators. Generation of test data for a contract is generally random, but it can be guided by annotations on the contract to achieve higher coverage. Annotations may indicate dependencies among parameters and the result or they may select lightweight program analyses, the results of which influence the choice of test data. A case study substantiates that JSConTest finds type-related errors with high probability.

[1]  Bertrand Meyer,et al.  ARTOO , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[2]  Carl Eastlund DoubleCheck your theorems , 2009, ACL2 '09.

[3]  A. Jefferson Offutt,et al.  A semantic model of program faults , 1996, ISSTA '96.

[4]  Carlos Pacheco,et al.  Directed random testing , 2009 .

[5]  Matthias Felleisen,et al.  Semantic Casts: Contracts and Structural Subtyping in a Nominal World , 2004, ECOOP.

[6]  Walid Taha,et al.  Gradual Typing for Objects , 2007, ECOOP.

[7]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[8]  Colin Runciman,et al.  Smallcheck and lazy smallcheck: automatic exhaustive testing for small values , 2008, Haskell '08.

[9]  Carlos Urias Munoz,et al.  Automatic Generation of Random Self-Checking Test Cases , 1983, IBM Syst. J..

[10]  Simeon C. Ntafos,et al.  An Evaluation of Random Testing , 1984, IEEE Transactions on Software Engineering.

[11]  Andreas Zeller,et al.  Simplifying and Isolating Failure-Inducing Input , 2002, IEEE Trans. Software Eng..

[12]  Lionel C. Briand,et al.  Is mutation an appropriate tool for testing experiments? , 2005, ICSE.

[13]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[14]  Casey Klein,et al.  Randomized Testing in PLT Redex , 2009 .

[15]  Peter Thiemann,et al.  Type Analysis for JavaScript , 2009, SAS.

[16]  Matthias Felleisen,et al.  DrScheme: A Pedagogic Programming Environment for Scheme , 1997, PLILP.

[17]  John J. Marciniak,et al.  Encyclopedia of Software Engineering , 1994, Encyclopedia of Software Engineering.

[18]  Barton P. Miller,et al.  An empirical study of the robustness of Windows NT applications using random testing , 2000 .

[19]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

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

[21]  Glenford J. Myers,et al.  Art of Software Testing , 1979 .

[22]  Erik Ernst,et al.  ECOOP 2007 - Object-Oriented Programming, 21st European Conference, Berlin, Germany, July 30 - August 3, 2007, Proceedings , 2007, ECOOP.

[23]  Sam Tobin-Hochstadt,et al.  Interlanguage migration: from scripts to programs , 2006, OOPSLA '06.

[24]  Yong Lei,et al.  Tool support for randomized unit testing , 2006, RT '06.

[25]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[26]  Robert Bruce Findler,et al.  Operational semantics for multi-language programs , 2007, POPL '07.

[27]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[28]  Andreas Zeller,et al.  Efficient unit test case minimization , 2007, ASE '07.

[29]  Robert Bruce Findler,et al.  Fine-grained interoperability through mirrors and contracts , 2005, OOPSLA '05.

[30]  Pieter H. Hartel,et al.  Programming Languages: Implementations, Logics, and Programs , 1996, Lecture Notes in Computer Science.

[31]  Jan Vitek,et al.  Thorn: robust, concurrent, extensible scripting on the JVM , 2009, OOPSLA '09.

[32]  Sam Tobin-Hochstadt,et al.  The design and implementation of typed scheme , 2008, POPL '08.

[33]  J. Davenport Editor , 1960 .

[34]  Bertrand Meyer,et al.  Object-Oriented Software Construction, 2nd Edition , 1997 .

[35]  Tsong Yueh Chen,et al.  Adaptive Random Testing: The ART of test case diversity , 2010, J. Syst. Softw..

[36]  Koen Claessen,et al.  QuickCheck: a lightweight tool for random testing of Haskell programs , 2000, ICFP.

[37]  Philip Wadler,et al.  Well-Typed Programs Can't Be Blamed , 2009, ESOP.

[38]  Sarfraz Khurshid,et al.  Efficiently Generating Structurally Complex Inputs with Thousands of Objects , 2007, ECOOP.

[39]  Martin Odersky ECOOP 2004 – Object-Oriented Programming , 2004, Lecture Notes in Computer Science.