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.

II. BACKGROUND<br />

In this section, we firstly introduce the preliminaries of test<br />

suite reduction and then show the motivation of our approach<br />

by a simple example.<br />

A. Test Suite Reduction<br />

In regression testing, a simple strategy is to use all previous<br />

test cases to test the modified software, however this strategy<br />

is not always feasible. Researchers proposed different effective<br />

approaches to solve this problem [8]. This paper mainly focuses<br />

on the issue of test suite reduction, which was originally<br />

formalized as follows by Harrold et al. [7]:<br />

Given: A test suite TS = {tc 1 ,tc 2 , ··· ,tc m }, a requirement<br />

set R = {r 1 ,r 2 , ··· ,r n } generated by a test adequacy<br />

criteria C, and subsets of TS: T 1 ,T 2 , ··· ,T n , for each associated<br />

with a r i such that any test case tc j ∈ T i can be used<br />

to cover requirement r i .<br />

Problem: To find a subset of T with the minimum cardinality<br />

that covers all the requirements covered by T .<br />

This problem has been demonstrated to be NP-Complete<br />

and we summarize these related work in Section V.<br />

B. Motivating Example<br />

To illustrate the limitation of previous approaches and show<br />

the motivation of our approach, we design a simple example<br />

shown in Table I.<br />

TABLE I<br />

AMOTIVATING EXAMPLE<br />

cases. Here only the test case < 3, 4 > can detect this fault. If<br />

we use existing test suite reduction approaches, such as HGS<br />

[7], we can get a reduced test suite {< 3, 4 >,< 4, 3 >}<br />

or {< 4, 3 >,< 13, 13 >}. In this case, it only has 50%<br />

probability to detect this fault. However, if we further analyze<br />

the code change, we can find that we do not need to reexecute<br />

the test case < 4, 3 > since this test case do not<br />

cover change related statements (Lines 5-7). Therefore we can<br />

remove this test case and then perform a test suite reduction<br />

on {< 3, 4 >,< 13, 13 >}. Finally we can choose the test<br />

case < 3, 4 > and this test case can detect the fault in the<br />

modified function. Meanwhile the size of reduced test suite is<br />

decreased from 2to1.<br />

III. CATESR APPROACH<br />

In this section, we firstly introduce the framework of our<br />

CATESR approach and then introduce the implementation<br />

detail.<br />

A. The Framework of CATESR approach<br />

We use Figure 1 to show the framework of CATESR approach.<br />

In particular, CATESR takes two consecutive versions<br />

of source code and coverage information of test cases on i-<br />

th version as its input, and produces a reduced test suite to<br />

(i +1)-th version as its output.<br />

<br />

<br />

Program Segments<br />

Test Cases<br />

bool TestAndSubtract(m, n) < 3, 4 > < 4, 3 > < 13, 13 ><br />

1: if (m

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

Saved successfully!

Ooh no, something went wrong!