27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CATESR: Change-aware Test Suite Reduction<br />

Based on Partial Coverage of Test Requirements<br />

Lijiu Zhang † , Xiang Chen ‡ , Qing Gu †∗ , Haigang Zhao † , Xiaoyan Shi † , Daoxu Chen †<br />

† State Key Laboratory for Novel Software Technology<br />

Nanjing University, Nanjing, China<br />

Email: jssyzlj@gmail.com<br />

‡ School of Computer Science and Technology<br />

Nantong University, Nantong, China<br />

Email: xchencs@ntu.edu.cn<br />

Abstract—Test suite reduction is an effective technique to<br />

save the cost of regression test. This technique is performed by<br />

identifying and eliminating redundant test cases from regression<br />

test suite. However, fault detection ability of original test suite<br />

may also be seriously weakened due to excessive reduction in<br />

test suite. In this paper, we propose a new change-aware test<br />

suite reduction approach CATESR, based on the conjecture that<br />

test cases which are more likely to cover the changes after code<br />

modification can gain a higher probability to reveal potential<br />

faults in the modified code. To assess the effectiveness of our<br />

approach, we implement CASTER and conduct a set of empirical<br />

studies on eight real C programs. The results show that our<br />

approach can not only greatly decrease the size of reduced test<br />

suite but also keep, sometimes even improve, the fault detection<br />

ability compared to HGS approach.<br />

Index Terms—Regression Testing, Test Suite Reduction, Test<br />

Requirement Classification, Change-aware<br />

I. INTRODUCTION<br />

During software development and maintenance, developers<br />

often modify codes and then trigger software evolution.<br />

Code modification may be caused by new user requirements,<br />

faults detected, code refactoring, or performance improvement.<br />

Regression testing is an important method to guarantee the<br />

quality of software during its evolution. Statistical data shows<br />

that the cost of regression testing accounts for over 1/3 of<br />

total development cost [15]. Main research issues in regression<br />

testing include test suite reduction, test case selection, test case<br />

prioritization, and test suite augmentation [8].<br />

In this paper, we mainly concentrate on test suite reduction<br />

issue. Some of previous research mainly focus on proposing<br />

novel approaches to reduce test suites according to a single test<br />

coverage criterion [2] [3] [7] [16] [21]. However, Rothermel et<br />

al. observed that test suite reduction can significantly decrease<br />

the size of test suites but at the cost of seriously losing<br />

original fault detection ability (FDA) [19]. To solve this issue,<br />

researchers have proposed some approaches based on multiple<br />

test coverage criteria. For example, Jeffrey and Gupta proposed<br />

a selective redundancy concept [13]. Black et al. performed<br />

test suite reduction using bi-criteria binary ILP model [1].<br />

⋆ Correspondence author. Email: guq@nju.edu.cn<br />

Then Hsu and Orso extended this work [1] and developed<br />

a general tool MINTS [11].<br />

Differing from previous research, we propose a changeaware<br />

test suite reduction approach. According to the previous<br />

approaches analysis, we find these approaches seldom analyzed<br />

the relationship between code changes and test requirements.<br />

In our research, we want to focus on test cases that<br />

are more likely to cover the changes after code modification<br />

in hope of detecting potential faults. Based on this conjecture,<br />

we propose CATESR approach to perform test suite reduction<br />

base on partial coverage of test requirements. In particular,<br />

given a test suite TS and a set of test requirements R, we<br />

firstly label R into three categories after code change analysis.<br />

Secondly, we classify TS into three sub test suites based on the<br />

requirement label result. Finally, we design a strategy named<br />

Partial-CATESR, which only performs test suite reduction<br />

over the sub test suite with the highest ability to cover the<br />

code changes. However, this strategy maybe lose partial test<br />

requirement coverage in most cases. Therefore, to verify the<br />

effectiveness of Partial-CATESR, we also design a strategy<br />

named Full-CATESR, which performs test suite reduction over<br />

all three sub test suites respectively and combine these test<br />

suites into a single test suite.<br />

In our empirical study, we choose 7 real C programs in<br />

Siemens suite and 1 large-scale C program named space<br />

as our experiment subjects. In experiment setup, we choose<br />

HGS approach as our test suite reduction approach and make<br />

comparisons among HGS, HGS-based Partial-CATESR, and<br />

HGS-based Full-CATESR. After data analysis, we find: (1)<br />

Partial-CATESR can not only greatly decrease the size of<br />

reduced test suite, but also keep, sometimes even improve,<br />

the FDA of reduced test suite compared to HGS approach.<br />

(2) The fault detection ability of reduced test suite are not<br />

weakened due to the partial coverage of test requirements.<br />

The main contributions of this paper include:<br />

• we propose a change-aware test suite reduction approach<br />

CATESR based on partial coverage of test requirements.<br />

• we conduct an empirical study to verify the effectiveness<br />

of our approach.<br />

217

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!