asergrp

Projects‎ > ‎

PUTStudy

             

An Empirical Study of Retrofitting Legacy Unit Tests for Parameterized Unit Testing


[Summary]         [People]         [Empirical Results]

PROJECT SUMMARY

Owing to the significance of unit testing in the software development life cycle, unit testing has been widely adopted by the software industry to ensure high-quality software. Recent advances in software testing introduced Parameterized Unit Tests (PUTs), which are a generalized form of Conventional Unit Tests (CUT). With PUTs, test data can be generated automatically using the Dynamic-Symbolic-Execution (DSE) approach. PUTs are powerful and provide an effective means of guided test generation when used with a DSE-based tool such as Pex from Microsoft Research. To leverage the benefits of PUTs in testing existing legacy applications in the software industry, we propose the first systematic procedure of test generalization (transforming existing CUTs to PUTs). We also conduct an empirical study, on three real-world applications, that shows benefits of test generalization. We show that test generalization reduces 407 CUTs to 224 PUTs (45%), thereby reducing the effort of maintaining test code. Along with achieving higher code coverage (a maximum increase of 52% for one class under test and 10% for one application used in our study), test generalization helped detect 16 new defects that are not detected by existing CUTs. A few of these defects are quite complex and are hard to be detected using CUTs. Given these benefits of test generalization, we expect that developers in software industry can use our systematic procedure to transform their CUTs to PUTs to exploit the benefits of PUTs, and thereby increase the quality of their developed software.

The paper submitted to ICSE Software Engineering in Practice 2010 can be found as an attachment below.

PEOPLE

Faculty
Tao Xie

Student
Madhuri R. MarriSuresh Thummalapenta

Collaborators
Nikolai Tillmann, Jonathan de Halleux (Microsoft Research)

EMPIRICAL RESULTS

Subject 1: NUnit Framework V2.4.8
Tests for Namespace Generalized: nunit.util.dll

Subject 2:
 
Data Structures and Algorithms v0.6
Tests for Namespace Generalized: All existing tests in the release package

Subject 3: QuickGraph v1.0
Tests for Namespace Generalized: All existing tests in the release package

Summary of results:

Coverage: Test generalization resulted in an average increase in branch coverage of the three subjects by 10% for NUnit, and 1% for both DSA and QuickGraph as shown in the table below

Defects: Test generalization resulted in identifying 13 defects in DSA and 3 defects in NUnit. These defects were reported on the respective host websites and the corresponding defects IDs can be found in the attached detailed results. 

Test Code: Test generalization resulted in reduced test code as shows in the Figures below. 

Figure1: Number of existing tests (CUTs) and the number of generalized tests (PUTs)


Figure2: Lines of code in CUTs and the lines of code in PUTs


Discussion related to the results can be found in the attached paper and detailed results can be found in the attached xls file. 

SPONSORS

 


Please contact  for any additional information.

Attachments (2)

  • ICSE10Prac_PutStudy.pdf - on Oct 12, 2009 9:09 AM by Madhuri Marri (version 1)
    199k View Download
  • Results_ICSEPrac_PUTStudy.xls - on Oct 12, 2009 9:25 AM by Madhuri Marri (version 1)
    82k Download