skip to main content
research-article

Guided test generation for database applications via synthesized database interactions

Authors Info & Claims
Published:04 April 2014Publication History
Skip Abstract Section

Abstract

Testing database applications typically requires the generation of tests consisting of both program inputs and database states. Recently, a testing technique called Dynamic Symbolic Execution (DSE) has been proposed to reduce manual effort in test generation for software applications. However, applying DSE to generate tests for database applications faces various technical challenges. For example, the database application under test needs to physically connect to the associated database, which may not be available for various reasons. The program inputs whose values are used to form the executed queries are not treated symbolically, posing difficulties for generating valid database states or appropriate database states for achieving high coverage of query-result-manipulation code. To address these challenges, in this article, we propose an approach called SynDB that synthesizes new database interactions to replace the original ones from the database application under test. In this way, we bridge various constraints within a database application: query-construction constraints, query constraints, database schema constraints, and query-result-manipulation constraints. We then apply a state-of-the-art DSE engine called Pex for .NET from Microsoft Research to generate both program inputs and database states. The evaluation results show that tests generated by our approach can achieve higher code coverage than existing test generation approaches for database applications.

References

  1. Rafi Ahmed, Allison W. Lee, Andrew Witkowski, Dinesh Das, Hong Su, Mohamed Zaït, and Thierry Cruanes. 2006. Cost-based query transformation in Oracle. In Proceedings of the International Conference on Very Large Data Bases (VLDB). 1026--1036. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Carsten Binnig, Donald Kossmann, and Eric Lo. 2007a. Reverse query processing. In Proceedings of the IEEE International Conference on Data Engineering (ICDE). 506--515.Google ScholarGoogle ScholarCross RefCross Ref
  3. Carsten Binnig, Donald Kossmann, Eric Lo, and M. Tamer Özsu. 2007b. QAGen: Generating query-aware test databases. In Proceedings of the ACM SIGMOD Conference. 341--352. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. María José Suárez Cabal and Javier Tuya. 2004. Using an SQL coverage measurement for testing database applications. In Proceedings of the ACM SIGSOFT Sympsium on the Foundations of Software Engineering (SIGSOFT-FSE). 253--262. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. David Chays, Yuetang Deng, Phyllis G. Frankl, Saikat Dan, Filippos I. Vokolos, and Elaine J. Weyuker. 2004. An AGENDA for testing relational database applications. Softw. Test. Verif. Reliab. 14, 1, 17--44. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. David Chays, John Shahid, and Phyllis G. Frankl. 2008. Query-based test generation for database applications. In Proceedings of the International Workshop on Testing Database Systems (DBTest). 6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Sarah R. Clark, Jake Cobb, Gregory M. Kapfhammer, James A. Jones, and Mary Jean Harrold. 2011. Localizing SQL faults in database applications. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 213--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. L. A. Clarke. 1976. A system to generate test data and symbolically execute programs. IEEE Trans. Softw. Eng. 2, 3, 215--222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Michael A. Cusumano and Richard W. Selby. 1997. How Microsoft builds software. Commun. ACM 40, 6 (1997), 53--61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. U. Dayal. 1987. Of nests and trees: A unified approach to processing queries that contain nested subqueries, aggregates, and quantifiers. In Proceedings of the International Conference on Very Large Data Bases (VLDB). 197--208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Claudio de la Riva, María José Suárez Cabal, and Javier Tuya. 2010. Constraint-based test database generation for SQL queries. In Proceedings of the International Workshop on Automation of Software Test (AST). 67--74. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Yuetang Deng and David Chays. 2005. Testing database transactions with AGENDA. In Proceedings of the International Conference on Software Engineering (ICSE). 78--87. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Michael Emmi, Rupak Majumdar, and Koushik Sen. 2007. Dynamic test input generation for database applications. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA). 151--162. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Patrice Godefroid, Nils Klarlund, and Koushik Sen. 2005. DART: Directed automated random testing. In Proceedings of the Programming Language Design and Implementation (PLDI). 213--223. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. L. Goodstein. 2007. Boolean Algebra. Dover Publications.Google ScholarGoogle Scholar
  16. Mark Grechanik, Christoph Csallner, Chen Fu, and Qing Xie. 2010. Is data privacy always good for software testing? In Proceedings of the IEEE International Symposium on Software Reliability Engineering (ISSRE). 368--377. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Bhanu Pratap Gupta, Devang Vira, and S. Sudarshan. 2010. X-data: Generating test data for killing SQL mutants. In Proceedings of the IEEE International Conference on Data Engineering (ICDE). 876--879.Google ScholarGoogle Scholar
  18. William G. J. Halfond and Alessandro Orso. 2006. Command-form coverage for testing database applications. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 69--80. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Shadi Abdul Khalek, Bassem Elkarablieh, Yai O. Laleye, and Sarfraz Khurshid. 2008. Query-aware test generation using a relational constraint solver. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 238--247. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Won Kim. 1982. On Optimizing an SQL-like nested query. ACM Trans. Datab. Syst. 7, 3 (1982), 443--469. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. C. King. 1976. Symbolic execution and program testing. Commun. ACM, 19, 7, 385--394. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Chengkai Li and Christoph Csallner. 2010. Dynamic symbolic database application testing. In Proceedings of the International Workshop on Testing Database Systems (DBTest). 1--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Microsoft. 2007. Pex: Dynamic analysis and test generation for .NET. Microsoft Research Foundation of Software Engineering Group.Google ScholarGoogle Scholar
  24. Microsoft. 2012a. DataTable. Microsoft MSDN. http://msdn.microsoft.com/en-us/library/system.data. datatable.aspx. (Last accessed May 2012).Google ScholarGoogle Scholar
  25. Microsoft. 2012b. .NET framework data provider for SQL server. Microsoft MSDN. (May 2012).Google ScholarGoogle Scholar
  26. Kai Pan, Xintao Wu, and Tao Xie. 2011a. Database state generation via dynamic symbolic execution for coverage criteria. In Proceedings of the International Workshop on Testing Database Systems (DBTest). 1--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Kai Pan, Xintao Wu, and Tao Xie. 2011b. Generating program inputs for database application testing. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 73--82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Koushik Sen, Darko Marinov, and Gul Agha. 2005. CUTE: A concolic unit testing engine for C. In Proceedings of the Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE). 263--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Kunal Taneja, Mark Grechanik, Rayid Ghani, and Tao Xie. 2011. Testing software in age of data privacy: A balancing act. In Proceedings of the Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE). 201--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Kunal Taneja, Yi Zhang, and Tao Xie. 2010. MODA: Automated test generation for database applications via mock objects. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 289--292. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. G. Tassey. 2002. The economic impacts of inadequate infrastructure for software testing. Tech. Repport. NIST Planning. 02-3, National Institute of Standards and Technology.Google ScholarGoogle Scholar
  32. Nikolai Tillmann and Jonathan de Halleux. 2008. Pex-White Box test generation for .NET. In Proceedings of the International Conference on Tests and Proofs (TAP). 134--153. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Nikolai Tillmann and Wolfram Schulte. 2006. Mock-object generation with behavior. In Proceedings of the IEEE/ACM International Conference on Automated Software Engineering (ASE). 365--368. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Javier Tuya, María José Suárez Cabal, and Claudio de la Riva. 2010. Full predicate coverage for testing SQL database queries. Softw. Test. Verif. Reliab. 20, 3, 237--288. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Margus Veanes, Pavel Grigorenko, Peli de Halleux, and Nikolai Tillmann. 2009. Symbolic query exploration. In Proceedings of the International Conference on Formal Engineering Methods (ICFEM). 49--68. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. David Willmor and Suzanne M. Embury. 2006. An intensional approach to the specification of test cases for database applications. In Proceedings of the International Conference on Software Engineering (ICSE). 102--111. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Xintao Wu, Chintan Sanghvi, Yongge Wang, and Yuliang Zheng. 2005. Privacy aware data generation for testing database applications. In Proceedings of the International Database Engineering and Applications Symposium (IDEAS). 317--326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Xintao Wu, Yongge Wang, Songtao Guo, and Yuliang Zheng. 2007. Privacy preserving database generation for database application testing. Fundam. Inform. 78, 4, 595--612. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Tao Xie, Nikolai Tillmann, Peli de Halleux, and Wolfram Schulte. 2009. Fitness-guided path exploration in dynamic symbolic execution. In Proceedings of the IEEE/IFIP International Conference on Dependable Systems and Networks (DSN). 359--368.Google ScholarGoogle ScholarCross RefCross Ref
  40. Linghao Zhang, Xiaoxing Ma, Jian Lu, Nikolai Tillmann, Jonathan de Halleux, and Tao Xie. 2012. Environment modeling for automated testing of cloud applications. IEEE Softw. Special Issue on Software Engineering for Cloud Computing 29, 2, 30--35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Chixiang Zhou and Phyllis G. Frankl. 2009. Mutation testing for Java database applications. In Proceedings of the IEEE International Conference on Software Testing, Verification and Validation (ICST). 396--405. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Chixiang Zhou and Phyllis G. Frankl. 2011. Inferential checking for mutants modifying database states. In Proceedings of the IEEE International Conference on Software Testing, Verification and Validation (ICST). 259--268. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Guided test generation for database applications via synthesized database interactions

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM Transactions on Software Engineering and Methodology
            ACM Transactions on Software Engineering and Methodology  Volume 23, Issue 2
            March 2014
            319 pages
            ISSN:1049-331X
            EISSN:1557-7392
            DOI:10.1145/2600788
            Issue’s Table of Contents

            Copyright © 2014 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 4 April 2014
            • Accepted: 1 June 2013
            • Revised: 1 January 2013
            • Received: 1 May 2012
            Published in tosem Volume 23, Issue 2

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article
            • Research
            • Refereed

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader