DOI: https://doi.org/10.1145/3849701
تاريخ النشر: 2026-09-30
المؤلف: Han Cui وآخرون
الموضوع الرئيسي: تقنيات اختبار البرمجيات وتصحيح الأخطاء
نظرة عامة
يتناول هذا القسم من ورقة البحث التحديات المرتبطة بالسلبيات الكاذبة (FNs) والإيجابيات الكاذبة (FPs) في محللات الشيفرة الثابتة، وهي أدوات أساسية لتحديد عيوب البرامج. يقوم المؤلفون بإجراء دراسة منهجية لـ 350 قضية تاريخية تتعلق بـ FNs و FPs من ثلاثة محللات مستخدمة على نطاق واسع: PMD و SpotBugs و SonarQube. تم تأكيد هذه القضايا وحلها من قبل المطورين، بعد أن تم الإبلاغ عنها سابقًا من قبل القائمين على الصيانة والمستخدمين والباحثين. تستكشف الدراسة الأسباب الجذرية لهذه القضايا وخصائص البرامج التي أدت إلى ظهورها، مما يوفر رؤى جديدة حول استراتيجيات التخفيف من FNs و FPs.
بالإضافة إلى ذلك، يقترح المؤلفون استراتيجية اختبار ميتامورفي مستندة إلى نتائجهم، والتي نجحت في تحديد 14 قضية جديدة تتعلق بـ FNs و FPs، مع تأكيد 11 منها وإصلاح 9 بالفعل. كما كشفت التحقيقات عن مشكلة في مواصفات القواعد وأربع FNs/FPs إضافية ناتجة عن قيود في تنفيذ التحليل الثابت. جعل المؤلفون مجموعاتهم البيانية وأدواتهم متاحة للجمهور، مما يعزز البحث والتطوير في هذا المجال.
مقدمة
تناقش مقدمة ورقة البحث دور محللات الشيفرة الثابتة (SCAs) في تحديد عيوب البرامج خلال دورة تطوير البرمجيات، وتحديدًا بعد تجميع الشيفرة وقبل الاختبار. تستهدف هذه المحللات قضايا متنوعة، بما في ذلك انتهاكات أفضل الممارسات، وعيوب التصميم، وأخطاء البرمجة، والثغرات الأمنية، والتي يمكن أن تكون مكلفة للكشف عنها من خلال المراجعات اليدوية. غالبًا ما تعيق فعالية SCAs السلبيات الكاذبة (FNs) والإيجابيات الكاذبة (FPs)، حيث يتم تفويت العيوب الحقيقية أو يتم توليد تحذيرات زائفة. ركزت الدراسات السابقة بشكل أساسي على تقييم قدرات الكشف لـ SCAs ضد الأخطاء المعروفة، مما يكشف عن أوجه قصور كبيرة في قدرتها على تحديد FNs و FPs.
بالمقابل، تهدف هذه الورقة إلى استكشاف FNs و FPs من منظور جديد من خلال فحص القضايا التاريخية الموثقة في مستودعات القضايا لثلاثة SCAs شعبية: PMD و SpotBugs و SonarQube. من خلال تحليل 350 قضية تاريخية (تتكون من 80 FN و 270 FP)، تسعى الدراسة إلى كشف الأسباب الجذرية لهذه القضايا وخصائص البرامج المدخلة التي تسهم في ظهورها. تم تنظيم البحث حول ثلاثة أسئلة رئيسية: تحديد الأسباب الجذرية الشائعة لـ FNs و FPs، وفهم الخصائص المدخلة التي تؤدي إلى هذه القضايا، وتقييم فائدة النتائج في تحديد FNs و FPs جديدة. من المتوقع أن توفر نتائج الدراسة رؤى قيمة للمطورين لتحسين فعالية SCAs والتخفيف من حدوث FNs و FPs.
الطرق
تم تنظيم منهجية هذه الدراسة في عدة أقسام رئيسية. يوفر القسم 2.1 خلفية عن محللات الشيفرة الثابتة، بينما يقدم القسم 2.2 المحللات المحددة المختارة للتقييم: PMD (الإصدار 7.0.0-rc3)، Spotbugs (الإصدار 4.7.4)، و SonarQube (الإصدار 10.0.0.68432). في القسم 2.3، يتم توضيح عملية جمع السلبيات الكاذبة (FNs) والإيجابيات الكاذبة (FPs) التاريخية من مستودعات القضايا لهذه المحللات، تليها القسم 2.4، الذي يصف التحليل اليدوي لهذه القضايا.
تضمنت الإعدادات التجريبية اختبار أحدث إصدارات المحللات باستخدام مجموعة شاملة من البرامج المدخلة: 3,754 من PMD، 572 من SonarQube، و 1,227 من Spotbugs. تم استخدام JavaParser لتحليل وتحويل هذه البرامج إلى تنسيق Java 11، بينما سهلت سكربتات Python تنفيذ الاختبارات وتحليل المخرجات. ركزت مقارنة نتائج التحليل على تحديد التباينات في عدد ونوع التحذيرات المبلغ عنها، مما يشير إلى FNs و FPs المحتملة التي تم فحصها يدويًا لاحقًا. تم إجراء الاختبار على جهاز Ubuntu 20.04 LTS 64 بت مع 16 جيجابايت من الذاكرة، مع أوقات تنفيذ إجمالية تبلغ حوالي ساعتين لـ PMD، وساعة ونصف لـ SonarQube، وساعة واحدة لـ Spotbugs.
النتائج
في هذا القسم، يقدم المؤلفون عرضًا تجريبيًا لنتائجهم، مع تسليط الضوء على فعالية استراتيجيتهم الاختبارية في تحديد القضايا داخل محللات الشيفرة الثابتة. تكشف النتائج، الملخصة في الجدول 4، أن نهجهم كشف عن 12 سلبيات كاذبة (FNs) و 2 إيجابيات كاذبة (FPs) عبر ثلاثة محللات شيفرة ثابتة. من الجدير بالذكر أن 11 من هذه القضايا تم تأكيدها من قبل المطورين، مع حل 9 منها بالفعل، بينما 3 قيد الانتظار للحصول على ملاحظات. تتعلق القضايا المحددة بـ 12 قاعدة متميزة من PMD و SpotBugs، حيث كانت مشغل الطفرة (b) فعالًا بشكل خاص، حيث حدد 6 قضايا، بينما حددت الطفرة (d) 7 قضايا عبر أشكالها الثلاثة. بالمقابل، لم تسفر الطفرة (c) عن أي نتائج جديدة، على الأرجح بسبب التحسينات في تحليل نوع PMD v7.0 وتحليل النطاق.
يقارن المؤلفون استراتيجيتهم الاختبارية الميتامورفية مع نهج الاختبار التفاضلي الذي استخدمه وانغ وآخرون، والذي يعتمد على مقارنة مخرجات القواعد المماثلة بين المحللات المختلفة. نجح أسلوبهم، الذي لا يتطلب محلل مرجعي، في تحديد 10 قضايا لم يتم اكتشافها بواسطة استراتيجية وانغ وآخرون، حيث كانت القواعد المعيبة ذات الصلة تفتقر إلى نظائر مماثلة في المحللات الأخرى. على سبيل المثال، القاعدة “UseIOStream-sWithApacheCommonsFileItem” في PMD ليس لديها قاعدة مماثلة في SonarQube، مما يؤدي إلى احتمال تجاهل القضية ID 6. وهذا يبرز قوة استراتيجية اختبار المؤلفين في كشف نقاط الضعف في وحدات التحليل الثابتة.
المناقشة
في هذا القسم، يقدم المؤلفون دراسة منهجية للسلبيات الكاذبة (FNs) والإيجابيات الكاذبة (FPs) في محللات الشيفرة الثابتة، مع التركيز على القضايا التاريخية لتحديد الأسباب الجذرية وخصائص المدخلات. تم بناء مجموعة بيانات تتكون من 350 قضية مؤكدة ومحلولة من ثلاثة محللات شيفرة ثابتة شهيرة بلغة Java – PMD و SpotBugs و SonarQube. تكشف الدراسة عن عدة نتائج مهمة، بما في ذلك تحديد سبعة أسباب جذرية رئيسية لـ FNs و FPs، مثل مواصفات القواعد المعيبة، وتنفيذ القواعد غير المتسق، والميزات اللغوية غير المعالجة، والحالات المفقودة التي يجب أن تكون في القائمة البيضاء. من الجدير بالذكر أن الحالات المفقودة كانت الأكثر انتشارًا كسبب جذر، حيث أثرت على 35.7% من القضايا التي تم تحليلها.
يؤكد المؤلفون على أهمية فهم هذه الأسباب الجذرية للتخفيف من FNs و FPs بشكل فعال. كما يبرزون الحاجة إلى أن يواكب مطورو المحللات الثابتة الميزات الجديدة للغة Java والمكتبات، مما يضمن تحديث تنفيذ القواعد وفقًا لذلك. تدعم نتائج الدراسة العروض التجريبية، وتم جعل جميع مجموعات البيانات والأدوات متاحة للجمهور لتسهيل المزيد من البحث في هذا المجال. استخدمت التحليلات طرقًا صارمة، بما في ذلك تقييمات اتفاقية المقيمين باستخدام كابا كوهين، لضمان موثوقية تصنيف القضايا. بشكل عام، تسهم هذه الدراسة في تقديم رؤى قيمة حول التحديات التي تواجهها محللات الشيفرة الثابتة وتقدم تداعيات عملية لتحسين دقتها.
القيود
يسلط قسم القيود الضوء على عدة أخطاء حرجة وقيود في وحدات التحليل الثابت المستخدمة من قبل محللات الشيفرة مثل PMD و SpotBugs و SonarQube. تشمل القضايا الرئيسية المحددة أخطاء تحليل النطاق، وقيود تحليل النوع، وعدم دقة تحليل تدفق البيانات، وعيوب التنفيذ الرمزي. على سبيل المثال، يمكن أن يؤدي تحليل النطاق إلى إيجابيات كاذبة (FPs) عندما يتم تعيين المتغيرات في نطاقات مختلفة بشكل غير صحيح، كما يتضح من قاعدة PMD لتنسيق رسائل السجل. بالمثل، يمكن أن تؤدي أخطاء تحليل النوع إلى تحذيرات مضللة حول مقارنات الكائنات، بينما قد يسيء تحليل تدفق البيانات تفسير تعريفات واستخدامات المتغيرات، مما يؤدي إلى تنبيهات خاطئة حول شذوذ تدفق البيانات. يمكن أن تؤدي أخطاء التنفيذ الرمزي أيضًا إلى تصنيف خاطئ للتعبيرات البوليانية، مما يتسبب في المزيد من FPs.
للتحقيق في هذه الضعف، قام المؤلفون بفحص يدوي لأعلى خمس قواعد معيبة من كل محلل بناءً على القضايا التاريخية التي تم إصلاحها. استخدموا طفرات الشيفرة لاختبار المحللات بشكل مكثف، مع التركيز على خصائص المدخلات التي تؤدي عادةً إلى السلبيات الكاذبة (FNs) و FPs. كشفت النتائج عن قيود كبيرة في قدرات المحللات، خاصة في التعامل مع تدفقات استدعاء الطرق وتحليل تدفق البيانات، والتي تم تأكيدها من قبل المطورين. بشكل عام، تؤكد الدراسة على الحاجة إلى تحسين الدقة في تقنيات التحليل الثابت للتخفيف من حدوث FNs و FPs.
DOI: https://doi.org/10.1145/3849701
Publication Date: 2026-09-30
Author(s): Han Cui et al.
Primary Topic: Software Testing and Debugging Techniques
Overview
This section of the research paper discusses the challenges associated with false negatives (FNs) and false positives (FPs) in static code analyzers, which are essential tools for identifying program flaws. The authors conduct a systematic study of 350 historical issues related to FNs and FPs from three widely used analyzers: PMD, SpotBugs, and SonarQube. These issues, previously reported by maintainers, users, and researchers, have been confirmed and resolved by the developers. The study investigates the root causes of these issues and the characteristics of the programs that triggered them, yielding new insights into strategies for mitigating FNs and FPs.
Additionally, the authors propose a metamorphic testing strategy informed by their findings, which successfully identified 14 new issues related to FNs and FPs, with 11 confirmed and 9 already fixed. The investigation also uncovered a rule specification issue and four additional FNs/FPs stemming from limitations in the static analysis implementation. The authors have made their datasets and tools publicly accessible, promoting further research and development in this area.
Introduction
The introduction of the research paper discusses the role of static code analyzers (SCAs) in identifying program flaws during the software development lifecycle, specifically after code compilation and prior to testing. These analyzers target various issues, including best practice violations, design flaws, programming errors, and security vulnerabilities, which can be costly to detect through manual reviews. The effectiveness of SCAs is often hindered by false negatives (FNs) and false positives (FPs), where true flaws are missed or spurious warnings are generated. Previous studies have primarily focused on evaluating the detection capabilities of SCAs against known faults, revealing significant shortcomings in their ability to identify FNs and FPs.
In contrast, this paper aims to explore FNs and FPs from a novel perspective by examining historical issues documented in the issue repositories of three popular SCAs: PMD, SpotBugs, and SonarQube. By analyzing 350 historical issues (comprising 80 FNs and 270 FPs), the study seeks to uncover the root causes of these issues and the characteristics of input programs that contribute to them. The research is structured around three key questions: identifying common root causes of FNs and FPs, understanding the input characteristics that lead to these issues, and assessing the usefulness of the findings in identifying new FNs and FPs. The study’s findings are expected to provide valuable insights for developers to improve the effectiveness of SCAs and mitigate the occurrence of FNs and FPs.
Methods
The methodology of this study is structured into several key sections. Section 2.1 provides background on static code analyzers, while Section 2.2 introduces the specific analyzers selected for evaluation: PMD (version 7.0.0-rc3), Spotbugs (version 4.7.4), and SonarQube (version 10.0.0.68432). In Section 2.3, the process of collecting historical false negatives (FNs) and false positives (FPs) from the issue repositories of these analyzers is outlined, followed by Section 2.4, which describes the manual analysis of these issues.
The experimental setup involved testing the latest versions of the analyzers using a comprehensive set of input programs: 3,754 from PMD, 572 from SonarQube, and 1,227 from Spotbugs. JavaParser was utilized to parse and transform these programs into Java 11 format, while Python scripts facilitated the execution of tests and analysis of outputs. The comparison of analysis results focused on identifying discrepancies in the number and type of reported warnings, which indicated potential FNs and FPs that were subsequently inspected manually. The testing was conducted on a 64-bit Ubuntu 20.04 LTS machine with 16GB RAM, with total execution times of approximately 2 hours for PMD, 1.5 hours for SonarQube, and 1 hour for Spotbugs.
Results
In this section, the authors present a proof-of-concept demonstration of their findings, highlighting the effectiveness of their testing strategy in identifying issues within static code analyzers. The results, summarized in Table 4, reveal that their approach uncovered 12 false negatives (FNs) and 2 false positives (FPs) across three static code analyzers. Notably, 11 of these issues have been confirmed by developers, with 9 already resolved, while 3 are pending feedback. The identified issues pertain to 12 distinct rules from PMD and SpotBugs, with the mutation operator (b) being particularly effective, identifying 6 issues, while mutation (d) identified 7 issues across its three forms. Conversely, mutation (c) did not yield any new findings, likely due to improvements in PMD v7.0’s type resolution and scope analysis.
The authors contrast their metamorphic testing strategy with the differential testing approach employed by Wang et al., which relies on comparing outputs of similar rules between different analyzers. Their method, which does not require a reference analyzer, successfully identified 10 issues that were not detected by Wang et al.’s strategy, as the relevant buggy rules lacked analogous counterparts in other analyzers. For instance, the rule “UseIOStream-sWithApacheCommonsFileItem” in PMD has no similar rule in SonarQube, leading to the potential oversight of issue ID 6. This underscores the robustness of the authors’ testing strategy in revealing weaknesses in static analysis modules.
Discussion
In this section, the authors present a systematic study of false negatives (FNs) and false positives (FPs) in static code analyzers, focusing on historical issues to identify root causes and input characteristics. A dataset comprising 350 confirmed and fixed issues from three popular Java static code analyzers—PMD, SpotBugs, and SonarQube—was constructed. The study reveals several significant findings, including the identification of seven major root causes for FNs and FPs, such as flawed rule specifications, inconsistent rule implementations, unhandled language features, and missing cases that should be whitelisted. Notably, missing cases were found to be the most prevalent root cause, affecting 35.7% of the issues analyzed.
The authors emphasize the importance of understanding these root causes to mitigate FNs and FPs effectively. They also highlight the need for static analyzer developers to keep pace with new Java language features and libraries, ensuring that rule implementations are updated accordingly. The study’s findings are supported by proof-of-concept demonstrations, and all datasets and tools have been made publicly available to facilitate further research in this domain. The analysis employed rigorous methods, including inter-rater agreement assessments using Cohen’s Kappa, to ensure the reliability of the categorization of issues. Overall, this research contributes valuable insights into the challenges faced by static code analyzers and offers practical implications for improving their accuracy.
Limitations
The section on limitations highlights several critical errors and limitations in static analysis modules used by code analyzers such as PMD, SpotBugs, and SonarQube. Key issues identified include scope analysis errors, type resolution limitations, dataflow analysis inaccuracies, and symbolic execution flaws. For instance, scope analysis can lead to false positives (FPs) when variables in different scopes are incorrectly mapped, as demonstrated by PMD’s rule for log message formatting. Similarly, type resolution errors can result in misleading warnings about object comparisons, while dataflow analysis may misinterpret variable definitions and usages, leading to erroneous alerts about data flow anomalies. Symbolic execution errors can also misclassify boolean expressions, causing further FPs.
To investigate these weaknesses, the authors manually examined the top five buggy rules from each analyzer based on historical fixed issues. They employed code mutations to stress-test the analyzers, focusing on input characteristics that commonly trigger false negatives (FNs) and FPs. The findings revealed significant limitations in the analyzers’ capabilities, particularly in handling method call flows and data flow analysis, which were confirmed by developers. Overall, the study underscores the need for improved precision in static analysis techniques to mitigate the occurrence of FNs and FPs.
