Skip to main content
QUICK REVIEW

[論文レビュー] Comparative Study of Machine Learning Test Case Prioritization for Continuous Integration Testing

Dusica Marijan|arXiv (Cornell University)|Apr 22, 2022
Software Testing and Debugging Techniques被引用数 4
ひとこと要約

本研究では、実際の産業界データセットを用いて、継続的インテグレーション(CI)におけるテストケース優先順位付けのための機械学習モデル—LambdaRank、SVM、GBDT、ANN—を評価している。モデルの性能は、テスト履歴長(最適:40–60%)と時間予算に大きく依存し、短時間制約下ではLambdaRankが故障検出効果が最も高く、ANNは履歴長に最も敏感だが、順位付け時間は最も速いことが判明した。

ABSTRACT

There is a growing body of research indicating the potential of machine learning to tackle complex software testing challenges. One such challenge pertains to continuous integration testing, which is highly time-constrained, and generates a large amount of data coming from iterative code commits and test runs. In such a setting, we can use plentiful test data for training machine learning predictors to identify test cases able to speed up the detection of regression bugs introduced during code integration. However, different machine learning models can have different fault prediction performance depending on the context and the parameters of continuous integration testing, for example variable time budget available for continuous integration cycles, or the size of test execution history used for learning to prioritize failing test cases. Existing studies on test case prioritization rarely study both of these factors, which are essential for the continuous integration practice. In this study we perform a comprehensive comparison of the fault prediction performance of machine learning approaches that have shown the best performance on test case prioritization tasks in the literature. We evaluate the accuracy of the classifiers in predicting fault-detecting tests for different values of the continuous integration time budget and with different length of test history used for training the classifiers. In evaluation, we use real-world industrial datasets from a continuous integration practice. The results show that different machine learning models have different performance for different size of test history used for model training and for different time budget available for test case execution. Our results imply that machine learning approaches for test prioritization in continuous integration testing should be carefully configured to achieve optimal performance.

研究の動機と目的

  • CI環境におけるMLベースのテスト優先順位付けの故障予測効果と時間効率を評価すること。
  • 訓練に使用するテスト実行履歴の長さがMLモデルの性能に与える影響を調査すること。
  • 時間予算の変動がMLベースのテスト優先順位付け手法の効果に与える影響を分析すること。
  • 実世界のCI環境におけるMLモデル(LambdaRank、SVM、GBDT、ANN)とヒューリスティック(ROCKET、Random)を比較すること。
  • 産業界のCIパイプラインにおける最適なパフォーマンスを発揮するようにMLモデルを設定するための実証的ガイダンスを提供すること。

提案手法

  • 本研究では、Cisco、ABB、Googleの実世界産業界データセットを用いてMLモデルの訓練と評価を行った。
  • テスト実行履歴の長さを10%から100%まで変化させた複数の長さで、4つのMLモデル—LambdaRank(順序学習)、SVM、GBDT、ANN—を訓練した。
  • テストケース優先順位付けの評価には、故障検出効果を測るためのAPFD(故障検出時の平均適合度)を用いた。
  • 時間効率は、TDFF(最初の故障を検出するまでの時間)、TDLF(最後の故障を検出するまでの時間)、TRAIN(モデル訓練時間)、PART(優先順位付けアルゴリズム実行時間)で測定した。
  • 時間予算の異なるレベル(B1–B5)を想定し、CIサイクルの制約に応じた比較を実施した。
  • 実世界の妥当性と一般化可能性を確保するため、3つの産業界データセットを用いて実験を行った。
Figure 1: An iteration of CI testing consists of a code commit, build, and test phase, before code deployment. Change impact analysis and regression test prioritization are used to speed up testing. Regression test prioritization can use test history to learn to prioritize test cases and ML to scale
Figure 1: An iteration of CI testing consists of a code commit, build, and test phase, before code deployment. Change impact analysis and regression test prioritization are used to speed up testing. Regression test prioritization can use test history to learn to prioritize test cases and ML to scale

実験結果

リサーチクエスチョン

  • RQ1訓練に使用するテスト実行履歴の長さは、MLベースのテスト優先順位付けモデルの故障予測性能にどのように影響するか?
  • RQ2CIサイクルにおける異なる時間予算下で、さまざまなMLモデルはどのように性能を発揮するか?
  • RQ3CIテストにおいて、故障検出効果と時間効率の両面で最良のバランスを達成するのはどのMLモデルか?
  • RQ4MLベースの手法は、ヒューリスティックベースライン(ROCKETとRandom)と比較して、故障検出能力と実行時間の面でどのように異なるか?

主な発見

  • MLモデルの訓練に最適なテスト履歴長は、利用可能な実行履歴の40%~60%の間であり、この範囲で性能がピークに達する。
  • ANNモデルは古いテスト履歴に対して最も感受性が低く、さまざまな履歴長でも安定した性能を示すが、短い履歴では最も悪い性能を示す。
  • 短時間制約下では、LambdaRank(LRN)が最高の故障検出効果を発揮し、他のすべてのMLモデルを上回るAPFDスコアを達成した。
  • ANNモデルは、短時間制約下でも故障検出性能が最悪であり、順位付け時間の速さとは対照的である。
  • 最初の故障を検出するまでの時間(TDFF)において、LambdaRankとSVMが最も優れた性能を示し、Randomは最悪であった。
  • ANNモデルは最も速い順位付け時間(PART)を達成しており、次いでGBDT、LRNの順であり、Randomは単純さのおかげで最も速かった。
Figure 2: Test history consisting of 15 CI cycles. Cycle 1 is the most recent and has the highest weight, while cycle 15 is the oldest and has the lowest wight. Test cases can change execution result between pass and fail in consecutive executions (CI cycles). Red: fail, Green: pass, Grey: inconclus
Figure 2: Test history consisting of 15 CI cycles. Cycle 1 is the most recent and has the highest weight, while cycle 15 is the oldest and has the lowest wight. Test cases can change execution result between pass and fail in consecutive executions (CI cycles). Red: fail, Green: pass, Grey: inconclus

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

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

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

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