MUTCR: Test Case Recommendation via Multi-Level Signature Matching

Weisong Sun,Weidong Qian,Bin Luo,Zhenyu Chen
DOI: https://doi.org/10.1109/AST58925.2023.00022
2023-01-01
Abstract:Off-the-shelf test cases provide developers with testing knowledge for their reference or reuse, which can help them reduce the effort of creating new test cases. Test case recommendation, a major way of achieving test case reuse, has been receiving the attention of researchers. The basic idea behind test case recommendation is that two similar test targets (methods under test) can reuse each other's test cases. However, existing test case recommendation techniques either cannot be used in the cross-project scenario, or have low performance in terms of effectiveness and efficiency. In this paper, we propose a novel test case recommendation technique based on multi-level signature matching. The proposed multi-level signature matching consists of three matching strategies with different strict levels, including level-0 exact matching, level-1 fuzzy matching, and level-2 fuzzy matching. For the query test target given by the developer, level-0 exact matching helps to retrieve exact recommendations (test cases), while level-1 and level-2 fuzzy matching contribute to discovering richer relevant recommendations. We further develop a prototype called MUTCR for test case recommendation. We conduct comprehensive experiments to evaluate the effectiveness and efficiency of MUTCR. The experimental results demonstrate that compared with the state-of-the-art, MUTCR can recommend accurate test cases for more test targets. MUTCR is faster than the best baseline by three times based on the time cost. The user study is also performed to prove that the test cases recommended by MUTCR are useful in practice.
What problem does this paper attempt to address?