Skip to main content
QUICK REVIEW

[論文レビュー] Tailored Mutants Fit Bugs Better

Miltiadis Allamanis, Earl T. Barr|arXiv (Cornell University)|Nov 8, 2016
Software Testing and Debugging Techniques参考文献 31被引用数 6
ひとこと要約

本論文では、ターゲットプロジェクトのコードベースおよびバージョン履歴から識別子やリテラルを再利用することで、ミューテーションを生成する特化型ミューテーションオペレータを導入している。これにより、実際のバグとの結合度が従来のオペレータよりも14%向上した。一方で、生成されるミューテントの爆発的増加というスケーラビリティの問題に対処するため、場所選択にはサブモジュラー最適化を、ミューテントのフィルタリングには自然さに基づくスコアリングを用いている。

ABSTRACT

Mutation analysis measures test suite adequacy, the degree to which a test suite detects seeded faults: one test suite is better than another if it detects more mutants. Mutation analysis effectiveness rests on the assumption that mutants are coupled with real faults i.e. mutant detection is strongly correlated with real fault detection. The work that validated this also showed that a large portion of defects remain out of reach. We introduce tailored mutation operators to reach and capture these defects. Tailored mutation operators are built from and apply to an existing codebase and its history. They can, for instance, identify and replay errors specific to the project for which they are tailored. As our point of departure, we define tailored mutation operators for identifiers, which mutation analysis has largely ignored, because there are too many ways to mutate them. Evaluated on the Defects4J dataset, our new mutation operators creates mutants coupled to 14% more faults, compared to traditional mutation operators. These new mutation operators, however, quadruple the number of mutants. To combat this problem, we propose a new approach to mutant selection focusing on the location at which to apply mutation operators and the unnaturalness of the mutated code. The results demonstrate that the location selection heuristics produce mutants more closely coupled to real faults for a given budget of mutation operator applications. In summary, this paper defines and explores tailored mutation operators, advancing the state of the art in mutation testing in two ways: 1) it suggests mutation operators that mutate identifiers and literals, extending mutation analysis to a new class of faults and 2) it demonstrates that selecting the location where a mutation operator is applied decreases the number of generated mutants without affecting the coupling of mutants and real faults.

研究の動機と目的

  • 従来のミューテーションオペレータが27%の実バグと結合できないという限界を解決すること。
  • 従来のオペレータを用いた場合に発生するミューテーションテストのスケーラビリティ問題を克服すること。
  • コードベースおよびその履歴に特化したミューテーションオペレータを設計することで、実バグを検出する可能性を高め、効果性を向上させること。
  • 場所選択と不自然さの観点に注目した新しいミューテント選択戦略を開発し、生成されるミューテント数を削減しながら、実バグとの結合度を損なわないようにすること。
  • 特化型ミューテーションオペレータが、ミューテント検出と実バグ検出の相関を顕著に向上させられることを示し、ミューテーションテスト分野の最先端を進める。

提案手法

  • プロジェクトのコードベースおよびバージョン履歴から抽出した意味的に妥当な代替物(識別子やリテラル)を用いて、識別子およびリテラルを置き換える特化型ミューテーションオペレータを設計し、型安全性およびスコープの正しさを保証する。
  • 制御フローグラフ上で最も距離をとった場所を選択するためにサブモジュラー最適化を適用し、ミューテントのカバレッジを多様化し、重複を低減することを目的とする。
  • n-gram言語モデルを用いて自然さスコアを算出し、ミューテントを自然さの観点からランク付けする。その際、典型的なコードパターンから逸脱するほど高い優先度を与える。これは、不具合のあるコードは自然さに欠ける傾向があるという洞察に基づく。
  • 場所選択と自然さランク付けを統合し、実行するミューテント数を削減しながらも、故障検出の有効性を維持または向上させる。
  • Defects4Jベンチマークスイートを用いて、特化型オペレータと従来のオペレータを比較し、ミューテント数、故障結合度、選択効率の観点から評価する。
  • ハイブリッドなミューテント選択戦略を採用:まずサブモジュラー最適化により多様なプログラム場所を選択し、次にその場所内でのミューテントを自然さスコアに基づいてフィルタリングする。

実験結果

リサーチクエスチョン

  • RQ1プロジェクトのコードベースおよびバージョン履歴から識別子やリテラルを再利用する特化型ミューテーションオペレータは、従来のミューテーションオペレータと比較して、実バグとの結合度を向上させることができるか?
  • RQ2特化型ミューテーションオペレータは、実バグ検出の有効性をどの程度向上させるか?具体的には、追加で検出できるバグ数を指標とする。
  • RQ3特化型オペレータが従来のオペレータよりも顕著に多くのミューテントを生成する場合、ミューテーションテストのスケーラビリティ問題をどのように軽減できるか?
  • RQ4サブモジュラー最適化を用いた場所選択は、ランダム選択や均等選択と比較して、より効果的なミューテント選択戦略をもたらすか?
  • RQ5自然さに基づくミューテントスコアリングは、実バグと結合しやすいミューテントに焦点を当てることで、ミューテント選択の効率を向上させることができるか?

主な発見

  • 特化型ミューテーションオペレータは、Defects4Jベンチマーク上で、従来のミューテーションオペレータと比較して、ミューテントと結合するバグ数を14%向上させた。
  • 新しいミューテーションオペレータは、最先端の従来オペレータと比較して、平均で4倍のミューテントを生成し、スケーラビリティ問題を悪化させた。
  • 場所選択にサブモジュラー最適化を適用することで、ミューテントの重複が低減され、故障検出効率が向上した。予算が限られた条件下でも、実バグとより強く結合するミューテントが生成された。
  • 自然さスコアに基づくミューテントのフィルタリング(n-gram言語モデルにおけるエントロピーが低いミューテントを優先)は、故障検出能力を損なわせることなく、関連性の低いミューテントを効果的に除外できた。
  • サブモジュラー場所選択と自然さベースのフィルタリングの組み合わせにより、ランダム選択よりも少ないミューテント数で高い故障検出率が達成され、より高い効率性が示された。
  • 結果は、特化型ミューテーションオペレータが、従来のオペレータがしばしば見過ごす識別子やリテラルの誤用に関連する未発見のバグを効果的に標的にできると確認した。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。