Perfect is the enemy of test oracle

要約

タイトル:完全さはテストオラクルの敵である(Perfect is the enemy of test oracle)

要約:

– テストオラクルの自動化は、ソフトウェアテストの最も難しい側面の1つであり、自動化されたテスト入力生成に比べて相対的に少ない注目を集めています。
– テストオラクルは、正しい動作とバグの動作を区別できる真実を基盤として、テストが失敗(バグを検出)するか、通過するかを決定するために依存しています。
– サポートされていない状態で、テストアサーションまたは他のタイプのオラクルが存在しない場合でも、SEERと呼ばれる学習ベースのアプローチを使用して正確なオラクルを構築できます。
– グラウンド・トゥルースを構築するために、SEERはユニットテストとMUT(テストされるメソッドの実装)を統合されたベクトル空間に埋め込みます。展開したベクトル表現を使ってオラクルを構築できます。
– SEERを5Kを超えるオープンソースJavaプロジェクトの多様なユニットテストに適用して実験を行った結果、生成されたオラクルが(1) failまたはpassのラベルを効果的に予測し、93%の全体的な精度、86%の適合率、94%の再現率、90%のF1値を達成することが示されました。 (2) 一般化可能であり、トレーニングまたは検証セットになかったプロジェクトのユニットテストのラベルを予測し、性能の低下はほとんどありません (3) 6.5ミリ秒でバグの存在を検出することができ、効率的であることが示されました。

要約(オリジナル)

Automation of test oracles is one of the most challenging facets of software testing, but remains comparatively less addressed compared to automated test input generation. Test oracles rely on a ground-truth that can distinguish between the correct and buggy behavior to determine whether a test fails (detects a bug) or passes. What makes the oracle problem challenging and undecidable is the assumption that the ground-truth should know the exact expected, correct, or buggy behavior. However, we argue that one can still build an accurate oracle without knowing the exact correct or buggy behavior, but how these two might differ. This paper presents SEER, a learning-based approach that in the absence of test assertions or other types of oracle, can determine whether a unit test passes or fails on a given method under test (MUT). To build the ground-truth, SEER jointly embeds unit tests and the implementation of MUTs into a unified vector space, in such a way that the neural representation of tests are similar to that of MUTs they pass on them, but dissimilar to MUTs they fail on them. The classifier built on top of this vector representation serves as the oracle to generate ‘fail’ labels, when test inputs detect a bug in MUT or ‘pass’ labels, otherwise. Our extensive experiments on applying SEER to more than 5K unit tests from a diverse set of open-source Java projects show that the produced oracle is (1) effective in predicting the fail or pass labels, achieving an overall accuracy, precision, recall, and F1 measure of 93%, 86%, 94%, and 90%, (2) generalizable, predicting the labels for the unit test of projects that were not in training or validation set with negligible performance drop, and (3) efficient, detecting the existence of bugs in only 6.5 milliseconds on average.

arxiv情報

著者 Ali Reza Ibrahimzada,Yigit Varli,Dilara Tekinoglu,Reyhaneh Jabbarvand
発行日 2023-04-05 23:32:13+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

カテゴリー: cs.AI, cs.LG, cs.SE パーマリンク