Skip to main content
QUICK REVIEW

[論文レビュー] Suggestions on Test Suite Improvements with Automatic Infection and Propagation Analysis

Oscar Luis Vera-Pérez, Benjamin Danglot|arXiv (Cornell University)|Sep 10, 2019
Software Testing and Debugging Techniques参考文献 26被引用数 6
ひとこと要約

この論文では、テスト実行中の状態変化の感染と伝播を分析することで、Javaプログラムにおける未検出の極端なコード変換を自動診断するツールReneriを提案する。根拠は、テスト入力の不足、感染伝播の欠如、または弱いオラクルであり、開発者に実行可能な自然言語の提案を生成する。未検出の変換の63%は観察可能性の問題に起因し、開発者フィードバックにより提案の関連性が確認された。

ABSTRACT

An extreme transformation removes the body of a method that is reached by one test case at least. If the test suite passes on the original program and still passes after the extreme transformation, the transformation is said to be undetected, and the test suite needs to be improved. In this work we propose a technique to automatically determine which of the following three reasons prevent the detection of the extreme transformation is : the test inputs are not sufficient to infect the state of the program; the infection does not propagate to the test cases; the test cases have a weak oracle that does not observe the infection. We have developed Reneri, a tool that observes the program under test and the test suite in order to determine runtime differences between test runs on the original and the transformed method. The observations gathered during the analysis are processed by Reneri to suggest possible improvements to the developers. We evaluate Reneri on 15 projects and a total of 312 undetected extreme transformations. The tool is able to generate a suggestion for each each undetected transformation. For 63% of the cases, the existing test cases can infect the program state, meaning that undetected transformations are mostly due to observability and weak oracle issues. Interviews with developers confirm the relevance of the suggested improvements and experiments with state of the art automatic test generation tools indicate that no tool can improve the existing test suites to fix all undetected transformations.

研究の動機と目的

  • メソッド本体が削除されるような極端なコード変換がテストスイートで検出されない理由を特定する課題に対処すること。
  • テスト実行中のプログラム状態の動的分析を用いて、未検出の変換の根拠を自動診断すること。
  • 開発者にとって読みやすい実行可能な提案を生成し、テスト入力、アサーション、またはテストケースの改善をガイドすること。
  • 開発者インタビューと最先端のテスト生成ツールとの比較を通じて、Reneriの提案の有効性を評価すること。
  • 再現可能性および将来のテストスイート改善研究を支援するため、オープンソースのツールと実証データを提供すること。

提案手法

  • 被テストプログラムとそのテストスイートをInstrumentationし、元のコードと極端に変換されたコードの実行におけるランタイム状態の差を収集する。
  • 到達可能性-感染-伝播(RIP)モデルに基づく動的分析を適用し、未検出の変換を3つの根拠に分類する:感染なし(no-infection)、伝播なし(no-propagation)、弱いオラクル(weak-oracle)。
  • テスト実行間でのプログラム状態の観察を比較し、未検出の変更を示す差異を検出する。
  • 自然言語による提案を合成し、開発者に新しいテスト入力を追加する、アサーションを挿入する、または新しいテストケースを作成するなどの指示を提供する。
  • 15のオープンソースJavaプロジェクトを用いて、312件の未検出の極端な変換を対象に分析を評価する。
  • 完全自動のテストスイート修復の可能性を評価するため、EvosuiteおよびDSpotに基づく2つの自動戦略を評価する。

実験結果

リサーチクエスチョン

  • RQ1テストスイートが極端なコード変換を検出できない主な根拠は何ですか?
  • RQ2Reneriが自動生成する提案は、未検出の変換を修正するための開発者を効果的に支援できますか?
  • RQ3最先端のテスト生成ツールは、Reneriが診断した未検出の極端な変換を同様に検出できますか?
  • RQ4実世界のプロジェクトにおいて、3つの根拠(感染なし、伝播なし、弱いオラクル)はどのように分布していますか?
  • RQ5自動テスト生成戦略は、以前に未検出であった極端な変換を検出できるように、どの程度テストスイートを改善できますか?

主な発見

  • 312件の未検出の極端な変換のうち、37%はテスト入力の不足(感染なし)、37%は感染伝播の失敗(伝播なし)、27%は感染の観察不能(弱いオラクル)に起因した。
  • 未検出の変換の63%は観察可能性の問題に起因しており、テストスイートの改善はアサーション強化と入力の多様性の向上を優先すべきであることを示唆している。
  • 開発者インタビューの結果、Reneriの提案は多くの場合役立つことが確認され、多くのケースで変換を検出する正確な解決策を提供していた。
  • DSpotに基づくテスト改善戦略は、Evosuiteに基づく生成戦略を上回り、未検出の変換の割合を適応度関数として用いることで、77%の未検出変換を検出できた。
  • 既存のテスト生成ツールでは、すべての未検出変換を修正できなかったため、診断に基づいた的確なテストスイート改善の必要性が浮き彫りになった。
  • Reneriはオープンソースであり、オープンデータを提供しており、再現可能性および将来的なテストスイート強化研究を支援する。

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

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

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

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