skip to main content
10.1145/3167132.3167340acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

AutoPUT: an automated technique for retrofitting closed unit tests into parameterized unit tests

Published: 09 April 2018 Publication History

Abstract

Parameterized unit testing is a promising technique for developers to use to facilitate the understanding of test codes. However, as a practical issue, developers might not have sufficient resources to implement parameterized unit tests (PUTs) corresponding to a vast number of closed unit tests (CUTs) in long-term software projects. Although a technique for retrofitting CUTs into PUTs was proposed, it imposes a laborious task on developers to promote parameters in CUTs. In this study, we propose a fully automated CUT-PUT retrofitting technique (called AutoPUT), which detects similar CUTs as PUT candidates by comparing their code structures. It then identifies common procedures and unique parameters to generate PUTs without degradation in terms of code coverage as compared with original CUTs. From the results of our case-study experiments on open-sourced software projects, we found that AutoPUT fully automatically generated 204 PUTs in 8.5 hours. We concluded that AutoPUT can help developers maintain test suites for building reliable software.

References

[1]
Kent Beck. 2003. Test-Driven Development: By Example. Addison-Wesley.
[2]
Ermira Daka, José Campos, Gordon Fraser, Jonathan Dorn, and Westley Weimer. 2015. Modeling Readability to Improve Unit Tests. In Proc. Joint Mtg. Euro. Softw. Eng. Conf. and Symp. Foundations Softw. Eng. (ESEC/FSE'15). 107--118.
[3]
Ermira Daka, José Miguel Rojas, and Gordon Fraser. 2017. Generating Unit Tests with Descriptive Names or: Would You Name Your Children Thing1 and Thing2?. In Proc. Int'l Symp. Softw. Testing and Analysis ISSTA'17. 57--67.
[4]
Gordon Fraser and Andreas Zeller. 2011. Generating Parameterized Unit Tests. In Proc. Int'l Symp. Softw. Testing and Analysis ISSTA'11. 364--374.
[5]
IEEE Computer Society, Pierre Bourque, and Richard E. Fairley. 2014. Guide to the Software Engineering Body of Knowledge (SWEBOK(R)): Version 3.0. IEEE Computer Society Press.
[6]
Na Meng, Lisa Hua, Miryung Kim, and Kathryn S. McKinley. 2015. Does Automated Refactoring Obviate Systematic Editing?. In Proc. Int'l Conf. Softw. Eng. (ICSE'15). 392--402.
[7]
Leandro Sales Pinto, Saurabh Sinha, and Alessandro Orso. 2012. Understanding Myths and Realities of Test-suite Evolution. In Proc. Int'l Symp. Foundations Softw. Eng. (FSE'12). 1--11.
[8]
Chanchal Kumar Roy and James R. Cordy. 2007. A Survey on Software Clone Detection Research. School of Computing TR 2007-541, Queen's University 115 (2007).
[9]
Matthew J. Rummel, Gregory M. Kapfhammer, and Andrew Thall. 2005. Towards the Prioritization of Regression Test Suites with Data Flow Information. In Proc. of the 33rd ACM/SIGAPP Symp. On Applied Computing (SAC'05). 1499--1504.
[10]
David Saff, Marat Boshernitsan, and Michael D. Ernst. 2008. Theories in Practice: Easy-to-Write Specifications that Catch Bugs. Technical Report MIT-CSAIL-TR-2008-002. MIT C.S. and A.I. Lab.
[11]
Hitesh Sajnani, Vaibhav Saini, Jeffrey Svajlenko, Chanchal K. Roy, and Cristina V. Lopes. 2016. SourcererCC: Scaling Code Clone Detection to Big-code. In Proc. Int'l Conf. Softw. Eng. (ICSE'16). 1157--1168.
[12]
Suresh Thummalapenta, Madhuri R. Marri, Tao Xie, Nikolai Tillmann, and Jonathan de Halleux. 2011. Retrofitting Unit Tests for Parameterized Unit Testing. In Proc. Int'l Conf. Fundamental Approaches to Softw. Eng. FASE'11. 294--309.
[13]
Nikolai Tillmann and Jonathan De Halleux. 2008. Pex: White Box Test Generation for .NET. In Proc. of the 2nd Int'l Conf. on Tests and Proofs (TAP'08). 134--153.
[14]
Nikolai Tillmann and Wolfram Schulte. 2005. Parameterized Unit Tests. In Proc. Joint Mtg. Euro. Softw. Eng. Conf. and Symp. Foundations Softw. Eng. (ESEC/FSE'05). 253--262.
[15]
Nikolaos Tsantalis, Davood Mazinanian, and Shahriar Rostami. 2017. Clone Refactoring with Lambda Expressions. In Proc. Int'l Conf. Softw. Eng. (ICSE'17). 60--70.
[16]
Phillip Merlin Uesbeck, Andreas Stefik, Stefan Hanenberg, Jan Pedersen, and Patrick Daleiden. 2016. An Empirical Study on the Impact of C++ Lambdas and Programmer Experience. In Proc. Int'l Conf. Softw. Eng. (ICSE'16). 760--771.

Cited By

View all
  • (2024)PROZE: Generating Parameterized Unit Tests Informed by Runtime Data2024 IEEE International Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM63643.2024.00025(166-176)Online publication date: 7-Oct-2024
  • (2021)Research on Code Plagiarism Detection Based on Code Clone Detection Technologies2021 2nd International Conference on Big Data and Informatization Education (ICBDIE)10.1109/ICBDIE52740.2021.00068(274-277)Online publication date: Apr-2021
  • (2021)Compressing Automatically Generated Unit Test Suites Through Test ParameterizationFundamentals of Software Engineering10.1007/978-3-030-89247-0_15(215-221)Online publication date: 17-Oct-2021

Index Terms

  1. AutoPUT: an automated technique for retrofitting closed unit tests into parameterized unit tests

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    SAC '18: Proceedings of the 33rd Annual ACM Symposium on Applied Computing
    April 2018
    2327 pages
    ISBN:9781450351911
    DOI:10.1145/3167132
    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]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 09 April 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Junit
    2. parameterized unit testing
    3. test-suite maintenance

    Qualifiers

    • Research-article

    Conference

    SAC 2018
    Sponsor:
    SAC 2018: Symposium on Applied Computing
    April 9 - 13, 2018
    Pau, France

    Acceptance Rates

    Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

    Upcoming Conference

    SAC '25
    The 40th ACM/SIGAPP Symposium on Applied Computing
    March 31 - April 4, 2025
    Catania , Italy

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)19
    • Downloads (Last 6 weeks)6
    Reflects downloads up to 28 Feb 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)PROZE: Generating Parameterized Unit Tests Informed by Runtime Data2024 IEEE International Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM63643.2024.00025(166-176)Online publication date: 7-Oct-2024
    • (2021)Research on Code Plagiarism Detection Based on Code Clone Detection Technologies2021 2nd International Conference on Big Data and Informatization Education (ICBDIE)10.1109/ICBDIE52740.2021.00068(274-277)Online publication date: Apr-2021
    • (2021)Compressing Automatically Generated Unit Test Suites Through Test ParameterizationFundamentals of Software Engineering10.1007/978-3-030-89247-0_15(215-221)Online publication date: 17-Oct-2021

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media