paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Java reflection API: revealing the dark side of the mirror

Java 反射 API:揭示镜子的暗面
FSE Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2019匹配度 2/10 · 论文研究 Java Reflection API 的 Javadoc 欠定规范与 JVM 实现不一致检测,属于软件测试与规范分析方向,与用户核心研究方向(PL与AI交叉、浮点程序分析、贝叶斯程序分析)没有直接交集,且未涉及LLM/Agent或静态分析。引用 13 inbox
Felipe Pontes, Rohit Gheyi, Sabrina Souto, Alessandro Garcia, Márcio Ribeiro
crossref: 2026-09-12

AI 速览

一句话:通过自动生成并跨 JVM 执行测试,检测 Java Reflection API 的 Javadoc 欠定规范与实现不一致。

本文研究 Java 反射 API 的 Javadoc 规范与 JVM 实现的一致性。自然语言规范使欠定规范与实现不一致难以系统发现,现有测试生成器也难以检测。作者分析两个主流 JVM 测试套件,并调查 130 名开发者;提出自动生成测试用例、跨 JVM 执行,再人工确认候选的技术。在 439 个程序上评估,该技术在 7 个类的 32 个公共方法中发现候选:12 个欠定规范候选,3 个被接受(25%);向 Eclipse OpenJ9 报告 24 个不一致候选,21 个被接受并修复(87.5%);向 Oracle JVM 报告 7 个,5 个被接受、4 个被修复。

问题
Java Reflection API 的 Javadoc 用自然语言规定行为,但其欠定规范以及 JVM 实现与 Javadoc 的不一致是否可被系统发现尚缺认识,现有自动测试生成器也无法检测。
方法
作者分析两个主流 JVM 的测试套件,并调查 130 名 API 使用者;提出自动生成测试用例并在不同 JVM 上执行,再人工确认欠定规范与不一致候选的检测技术。
评估
在 439 个输入程序上评估,技术在 7 个类的 32 个公共方法中发现候选;12 个欠定规范候选被接受 3 个,Eclipse OpenJ9 的 24 个不一致候选被接受并修复 21 个,Oracle JVM 的 7 个候选被接受 5 个、修复 4 个。
原文摘要(Abstract)

Developers of widely used Java Virtual Machines (JVMs) implement and test the Java Reflection API based on a Javadoc, which is specified using a natural language. However, there is limited knowledge on whether Java Reflection API developers are able to systematically reveal i) underdetermined specifications; and ii) non-conformances between their implementation and the Javadoc. Moreover, current automatic test suite generators cannot be used to detect them. To better understand the problem, we analyze test suites of two widely used JVMs, and we conduct a survey with 130 developers who use the Java Reflection API to see whether the Javadoc impacts on their understanding. We also propose a technique to detect underdetermined specifications and non-conformances between the Javadoc and the implementations of the Java Reflection API. It automatically creates test cases, and executes them using different JVMs. Then, we manually execute some steps to identify underdetermined specifications and to confirm whether a non-conformance candidate is indeed a bug. We evaluate our technique in 439 input programs. Our technique identifies underdetermined specification and non-conformance candidates in 32 Java Reflection API public methods of 7 classes. We report underdetermined specification candidates in 12 Java Reflection API methods. Java Reflection API specifiers accept 3 underdetermined specification candidates (25%). We also report 24 non-conformance candidates to Eclipse OpenJ9 JVM, and 7 to Oracle JVM. Eclipse OpenJ9 JVM developers accept and fix 21 candidates (87.5%), and Oracle JVM developers accept 5 and fix 4 non-conformance candidates.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5074,
  title = {Java reflection API: revealing the dark side of the mirror},
  author = {Felipe Pontes and Rohit Gheyi and Sabrina Souto and Alessandro Garcia and Márcio Ribeiro},
  booktitle = {FSE},
  year = {2019},
  doi = {10.1145/3338906.3338946}
}