Skip to main content
QUICK REVIEW

[論文レビュー] CoCoFuzzing: Testing Neural Code Models with Coverage-Guided Fuzzing

Moshi Wei, Yuchao Huang|arXiv (Cornell University)|Jun 17, 2021
Adversarial Robustness in Machine Learning参考文献 41被引用数 7
ひとこと要約

CoCoFuzzing は、ニューラルコードモデルの耐性をテストするための、意味を保ったコード変異を生成する新しいカバレッジガイドド・ファジングフレームワークである。10種類のカスタム変異オペレータとニューロンカバレッジ駆動のテスト生成を採用することで、モデルの耐性を向上させ、NeuralCodeSum では最大 84.81% の性能低下を達成した。また、その出力を用いた adversarial retraining により、モデルの精度が最大 35.15% 向上した。

ABSTRACT

Deep learning-based code processing models have shown good performance for tasks such as predicting method names, summarizing programs, and comment generation. However, despite the tremendous progress, deep learning models are often prone to adversarial attacks, which can significantly threaten the robustness and generalizability of these models by leading them to misclassification with unexpected inputs. To address the above issue, many deep learning testing approaches have been proposed, however, these approaches mainly focus on testing deep learning applications in the domains of image, audio, and text analysis, etc., which cannot be directly applied to neural models for code due to the unique properties of programs. In this paper, we propose a coverage-based fuzzing framework, CoCoFuzzing, for testing deep learning-based code processing models. In particular, we first propose ten mutation operators to automatically generate valid and semantically preserving source code examples as tests; then we propose a neuron coverage-based approach to guide the generation of tests. We investigate the performance of CoCoFuzzing on three state-of-the-art neural code models, i.e., NeuralCodeSum, CODE2SEQ, and CODE2VEC. Our experiment results demonstrate that CoCoFuzzing can generate valid and semantically preserving source code examples for testing the robustness and generalizability of these models and improve the neuron coverage. Moreover, these tests can be used to improve the performance of the target neural code models through adversarial retraining.

研究の動機と目的

  • 深層学習ベースのニューラルコードモデルに対する有効なテストフレームワークの欠如、特に adversarial 入力に対して脆弱であるという問題に取り組む。
  • モデルの耐性を徹底的にテストできる、意味を保ったコード変異を体系的に生成するアプローチを開発する。
  • ニューロンカバレッジを指標として用いてテスト生成をガイドし、多様なプログラム変換の体系的探索を可能にする。
  • 生成されたテストの有効性を、モデルの弱みの暴露と adversarial retraining を通じた性能向上の両面で評価する。

提案手法

  • 変数名の変更、不要コードの挿入、引数の追加など、現実の意味を保ったコード変換を表す10種類の変異オペレータを設計・実装する。
  • ニューロンカバレッジ(NC)を指標として採用し、モデルの内部挙動を多様かつ包括的に探索する。
  • カバレッジガイドドファジングを統合し、ニューロンカバレッジの向上効果が大きいオペレータを選択・適用する。
  • 生成されたテストケースを用いてモデルの耐性を評価し、adversarial retraining を実施して汎化性能を向上させる。
  • テストケースの影響を、モデルの性能低下と再訓練による向上の両面で測定する。

実験結果

リサーチクエスチョン

  • RQ1カバレッジガイドドファジングフレームワークは、ニューラルコードモデルのための有効で意味を保ったコードテストを効果的に生成できるか?
  • RQ2ニューロンカバレッジは、多様で耐性のあるテストケースの生成を効果的にガイドできるか?
  • RQ3生成されたテストケースは、最先端のニューラルコードモデルの性能をどの程度低下させるか?
  • RQ4生成されたテストケースを用いた adversarial retraining は、これらのモデルの耐性と精度を向上させることができるか?

主な発見

  • CoCoFuzzing は、NeuralCodeSum、CODE2SEQ、CODE2VEC に対して、それぞれ 84.81%、22.06%、27.58% の性能低下を引き起こす意味的に有効で意味を保ったコード例を効果的に生成した。
  • 生成されたテストケースはモデルの耐性を向上させ、adversarial retraining を通じて NeuralCodeSum で最大 35.15%、CODE2SEQ で 8.83%、CODE2VEC で 34.14% の性能向上を達成した。
  • ニューロンカバレッジ指標は、ファージャーが多様なプログラム変換を探索し、モデルの内部ニューロンをより高カバレッジに到達させるのに効果的に機能した。
  • CoCoFuzzing は、画像、音声、NLP 領域の既存手法に比べて制限を抱える問題を解決する、ニューラルコードモデルに特化した最初のカバレッジベースのファジングフレームワークである。
  • 10種類のカスタム変異オペレータにより、従来の2つのオペレータ(例:名前の変更と不要コード挿入)に依存する手法よりも、意味を保ったコード変異の幅広い探索が可能になった。

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

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

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

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