تقييم توليد اختبارات الانحدار المعتمدة على نماذج اللغة الكبيرة Evaluating LLM-Based Regression Test Generation

شارك:
المجلة: Proceedings of the ACM on software engineering.، المجلد: 3، العدد: 0
DOI: https://doi.org/10.1145/3808129
تاريخ النشر: 2026-06-30
المؤلف: Zhenyun Du وآخرون
الموضوع الرئيسي: تقنيات اختبار البرمجيات وتصحيح الأخطاء

نظرة عامة

في هذا البحث، يستكشف المؤلفون تطبيق نماذج اللغة الكبيرة (LLMs) لتوليد اختبارات الانحدار في الوقت المناسب في هندسة البرمجيات، مستهدفين بشكل خاص البرامج التي تعالج مدخلات منظمة وقابلة للقراءة البشرية. تتضمن الطريقة المقترحة استخدام LLM لتوليد حالات اختبار الانحدار بناءً على رسائل الالتزام المقدمة من المطورين، وتغييرات الشيفرة، وصيغ المدخلات (مثل XML) كلما تم الالتزام بإصلاح خطأ جديد أو تعديل الشيفرة. تستخدم الدراسة نموذجًا أوليًا يسمى Cleverest، الذي يعمل بطريقة موجهة بالتغذية الراجعة، بدون تدريب مسبق، مما يظهر كفاءة ملحوظة من خلال تحديد العديد من الأخطاء في أقل من دقيقتين كما يفعل الفازر المتقدم WAFLGo في 24 ساعة، على الرغم من أن WAFLGo لديه مجموعة بذور موجودة مسبقًا.

تزيد دمج Cleverest مع تقنيات الفازينغ، المسمى ClevFuzz، من تعزيز اكتشاف الأخطاء، مضاعفة عدد القضايا المحددة عند استخدام حالات الاختبار التي تم إنشاؤها بواسطة Cleverest كمجموعة بذور في الفازينغ الموجه بالغطاء. كما تسلط الدراسة الضوء على أهمية تعبير رسائل الالتزام على فعالية توليد الاختبارات. من خلال تعديل رسائل الالتزام لزيادة تفاصيلها، يلاحظ المؤلفون تحسنًا كبيرًا في اكتشاف الأخطاء، مما يشير إلى أن رسائل الالتزام الأكثر معلوماتية تؤدي إلى توافق أفضل مع التغييرات المقصودة في الشيفرة. تؤكد هذه الدراسة على إمكانيات LLMs في أتمتة اختبار الانحدار وأهمية التواصل الواضح في تطوير البرمجيات.

مقدمة

في مقدمة هذه الورقة البحثية، يبرز المؤلفون إمكانيات نماذج اللغة الكبيرة (LLMs) في أتمتة عمليات هندسة البرمجيات، لا سيما في توليد اختبارات الانحدار لالتزامات الشيفرة داخل خطوط أنابيب التكامل المستمر/التطوير المستمر (CI/CD). يقدمون أداة جديدة تسمى Cleverest، التي تستخدم LLMs لتوليد حالات اختبار الانحدار بناءً على رسائل الالتزام المقدمة من المطورين وتغييرات الشيفرة. الأهداف الرئيسية لهذه الطريقة هي تحديد الأخطاء التي تم تقديمها حديثًا أو لم يتم إصلاحها بشكل كافٍ من خلال الالتزامات الأخيرة. يؤطر المؤلفون توليد اختبارات الانحدار كمسألة ترجمة آلية، منتجين اختبارات بصيغ مدخلات معروفة مثل XML أو JavaScript.

تم تقييم فعالية Cleverest من خلال تجارب تشمل 72 التزامًا عبر ثمانية برامج شهيرة. بشكل ملحوظ، أظهرت Cleverest أداءً مشابهًا للفازر المتقدم WAFLGo، محققة معدلات اكتشاف أخطاء مماثلة في أقل من دقيقتين مقارنةً بوقت تشغيل WAFLGo الذي يبلغ 24 ساعة. أشارت النتائج إلى أن أداء Cleverest يتأثر بصيغة المدخلات وحجم LLM المستخدم، مع نتائج أفضل لصيغ قابلة للقراءة البشرية. بالإضافة إلى ذلك، يؤثر تعبير رسائل الالتزام بشكل كبير على فعالية الاختبارات المولدة؛ حيث أدت الرسائل الأكثر وصفًا إلى معدل اكتشاف أعلى للأخطاء. يقترح المؤلفون أيضًا نهجًا هجينًا، ClevFuzz، الذي يجمع بين الاختبارات التي تم إنشاؤها بواسطة Cleverest والفازينغ الرمادي، مما يؤدي إلى أكثر من ضعف عدد الأخطاء المكتشفة مقارنةً باستخدام WAFLGo بمفرده. بشكل عام، تسهم هذه الورقة في فهم LLMs في اختبار الانحدار، مما يبرز أهمية وضوح رسائل الالتزام وإمكانية دمج LLMs مع منهجيات الاختبار التقليدية.

طرق

في هذه الدراسة، يبحث المؤلفون في فعالية نموذج لغة كبير (LLM) كأداة لتوليد اختبارات الانحدار ضمن خط أنابيب التكامل المستمر/النشر المستمر (CI/CD)، بشكل خاص للبرامج التي تستخدم مدخلات منظمة وقابلة للقراءة البشرية مثل JavaScript وXML. على عكس اختبار الانحدار التقليدي، الذي يعتمد على المواصفات الحالية وحالات الاختبار، تتناول هذه الدراسة السيناريوهات التي تكون فيها هذه الموارد غائبة. الهدف الرئيسي هو تقييم قدرة LLM على توليد حالات اختبار تستهدف بفعالية الشيفرة المعدلة، وتحديد التغييرات السلوكية، وكشف الأخطاء التي يمكن اكتشافها باستخدام أدوات التنظيف.

لتحقيق ذلك، طور المؤلفون مولد اختبارات انحدار يعتمد على LLM يسمى Cleverest، والذي يتضمن مُركب موجه ومحلل تنفيذ. تتماشى مقاييس التقييم المستخدمة مع الممارسات القياسية في الفازينغ الانحداري، مع التركيز على اكتشاف الأعطال التي تم تقديمها حديثًا كمؤشرات على الانحدار. تهدف هذه الطريقة المبتكرة إلى تعزيز موثوقية تحديثات البرمجيات من خلال الاستفادة من قدرات LLM في توليد الاختبارات الآلية.

نقاش

في قسم النقاش من الورقة البحثية، يستكشف المؤلفون أداء Cleverest، وهو مولد اختبارات الانحدار، من خلال عدة أسئلة بحثية (RQs). يقيم RQ1 فعالية Cleverest في اكتشاف الأخطاء وإعادة إنتاجها ضمن سياق خط أنابيب CI/CD، كاشفًا أنه حدد بنجاح الأخطاء في 7 من 17 التزامًا يسبب الأخطاء (BICs) وأعاد إنتاج الأخطاء في 10 من 17 التزامًا لإصلاح الأخطاء (BFCs) عبر برامج مختلفة. أظهر الأداة قدرة عالية على الوصول إلى الشيفرة المعدلة، خاصة في البرامج ذات الصيغ الأكثر قابلية للقراءة البشرية، على الرغم من أنها واجهت صعوبات مع الهياكل المدخلة المعقدة، مثل تلك المطلوبة من محلل PDF Poppler.

يستقصي RQ2 تأثير تكوينات المعلمات الفائقة المختلفة على أداء Cleverest. تشير دراسة الإزالة إلى أن استخدام رسائل الالتزام أو الفروق وحدها يؤدي إلى نتائج مماثلة، ولكن الفعالية يمكن أن تختلف بناءً على خصوصية رسائل الالتزام. كما تفحص الدراسة تأثير حجم النموذج وإعدادات درجة الحرارة على جودة المخرجات، مشيرة إلى أنه بينما تنتج النماذج الأكبر عمومًا نتائج أفضل، فإن التكوين الأمثل يعتمد على المهمة المطروحة. بشكل عام، يتم وضع Cleverest كأداة واعدة لاختبار الانحدار، خاصة في البيئات التي تكون فيها السرعة في التنفيذ ضرورية، ويمكن أن تكون حالات الاختبار التي تم إنشاؤها نقاط انطلاق قيمة للاختبار اليدوي، حتى عندما لا تؤدي مباشرة إلى تحفيز الأخطاء.

Journal: Proceedings of the ACM on software engineering., Volume: 3, Issue: 0
DOI: https://doi.org/10.1145/3808129
Publication Date: 2026-06-30
Author(s): Zhenyun Du et al.
Primary Topic: Software Testing and Debugging Techniques

Overview

In this research, the authors explore the application of Large Language Models (LLMs) for just-in-time regression test generation in software engineering, specifically targeting programs that process structured, human-readable inputs. The proposed method involves utilizing an LLM to generate regression test cases based on developer-provided commit messages, code changes, and input formats (e.g., XML) whenever a new bug fix or code modification is committed. The study employs a prototype named Cleverest, which operates in a feedback-directed, zero-shot manner, demonstrating remarkable efficiency by identifying as many bugs in under 2 minutes as the state-of-the-art directed greybox fuzzer WAFLGo does in 24 hours, despite WAFLGo having a pre-existing seed corpus.

The integration of Cleverest with fuzzing techniques, termed ClevFuzz, further enhances bug detection, doubling the number of identified issues when Cleverest-generated test cases are used as a seed corpus in coverage-guided greybox fuzzing. The research also highlights the significance of the expressiveness of commit messages on the effectiveness of test generation. By modifying commit messages to increase their detail, the authors observe a substantial improvement in bug detection, indicating that more informative commit messages lead to better alignment with the intended code changes. This study underscores the potential of LLMs in automating regression testing and the importance of clear communication in software development.

Introduction

In the introduction of this research paper, the authors highlight the potential of Large Language Models (LLMs) in automating software engineering processes, particularly in regression test generation for code commits within continuous integration/continuous development (CI/CD) pipelines. They introduce a novel tool named Cleverest, which utilizes LLMs to generate regression test cases based on developer-provided commit messages and code changes. The primary goals of this approach are to identify bugs that are either newly introduced or inadequately fixed by recent commits. The authors frame the regression test generation as a machine translation task, producing tests in well-known input formats such as XML or JavaScript.

The effectiveness of Cleverest was evaluated through experiments involving 72 commits across eight popular programs. Remarkably, Cleverest demonstrated performance comparable to the state-of-the-art directed greybox fuzzer WAFLGo, achieving similar bug detection rates in under two minutes compared to WAFLGo’s 24-hour runtime. The results indicated that Cleverest’s performance is influenced by the input format and the size of the LLM used, with better outcomes for human-readable formats. Additionally, the expressiveness of commit messages significantly impacts the effectiveness of the generated tests; more descriptive messages led to a higher detection rate of bugs. The authors also propose a hybrid approach, ClevFuzz, which combines Cleverest-generated tests with greybox fuzzing, resulting in over twice the number of bugs found compared to using WAFLGo alone. Overall, this paper contributes to the understanding of LLMs in regression testing, emphasizing the importance of commit message clarity and the potential for integrating LLMs with traditional testing methodologies.

Methods

In this study, the authors investigate the effectiveness of a large language model (LLM) as a regression test generation tool within the continuous integration/continuous deployment (CI/CD) pipeline, specifically for programs that utilize structured, human-readable inputs such as JavaScript and XML. Unlike traditional regression testing, which relies on existing specifications and test cases, this research addresses scenarios where such resources are absent. The primary aim is to assess the LLM’s ability to generate test cases that effectively target modified code, identify behavioral changes, and expose bugs that can be detected using sanitizers.

To achieve this, the authors developed a feedback-directed LLM-based regression test generator named Cleverest, which incorporates a prompt synthesizer and an execution analyzer. The evaluation metrics employed align with standard practices in regression fuzzing, focusing on the detection of newly introduced crashes as indicators of regression. This innovative approach aims to enhance the reliability of software updates by leveraging LLM capabilities in automated test generation.

Discussion

In the discussion section of the research paper, the authors explore the performance of Cleverest, a regression test generator, through several research questions (RQs). RQ1 assesses Cleverest’s effectiveness in bug-finding and bug-reproduction within a CI/CD pipeline context, revealing that it successfully identified bugs in 7 out of 17 bug-introducing commits (BICs) and reproduced bugs in 10 out of 17 bug-fixing commits (BFCs) across various programs. The tool demonstrated high reachability for the changed code, particularly in programs with more human-readable formats, although it struggled with complex input structures, such as those required by the Poppler PDF parser.

RQ2 investigates the impact of different hyperparameter configurations on Cleverest’s performance. The ablation study indicates that using either commit messages or diffs alone yields similar results, but the effectiveness can vary based on the specificity of the commit messages. The study also examines the influence of model size and temperature settings on output quality, suggesting that while larger models generally produce better results, the optimal configuration depends on the task at hand. Overall, Cleverest is positioned as a promising tool for regression testing, particularly in environments where quick execution is essential, and its generated test cases can serve as valuable starting points for manual testing, even when they do not directly trigger bugs.