依赖关系冲突会影响程序的语义吗?
Will Dependency Conflicts Affect My Program's Semantics?
摘要:
Java项目通常构建在各种第三方库之上。如果类路径上存在多个版本的库,JVM将只加载一个版本,并隐藏其他版本,我们称之为依赖冲突。如果项目引用的库API具有相同的方法签名,但在库的加载版本和隐藏版本之间的语义不一致,这将引起语义冲突(SC)问题。对于开发人员来说,SC问题在实践中很难诊断,因为理解它们通常需要领域知识。虽然适应现有的测试生成技术的依赖性冲突问题,谜语,检测SC问题是可行的,其有效性大大降低。这主要是因为Riddle随机生成测试输入,而SC问题通常需要暴露测试中的特定参数。为了解决这一问题,我们进行了实证研究的75个真正的SC问题,以了解这些特定的参数在测试用例,可以捕捉SC问题的特点。受我们的实证研究结果的启发,我们提出了一种自动化测试技术传感器,它综合测试用例,使用测试项目中的成分,触发具有相同签名的API在冲突库版本中的不一致行为。评价结果表明,\textsc{Sensor}是有效和有用的:在开源项目上$Precision$为0.803,$Recall$为0.760,在工业项目上$Precision$为0.821;在29个项目中检测到150个语义冲突问题,其中81.8%被确认为真正的bug。
英文摘要:
Java projects are often built on top of various third-party libraries. If multiple versions of a library exist on the classpath, JVM will only load one version and shadow the others, which we refer to as dependency conflicts. This would give rise to semantic conflict (SC) issues, if the library APIs referenced by a project have identical method signatures but inconsistent semantics across the loaded and shadowed versions of libraries. SC issues are difficult for developers to diagnose in practice, since understanding them typically requires domain knowledge. Although adapting the existing test generation technique for dependency conflict issues, Riddle, to detect SC issues is feasible, its effectiveness is greatly compromised. This is mainly because Riddle randomly generates test inputs, while the SC issues typically require specific arguments in the tests to be exposed. To address that, we conducted an empirical study of 75 real SC issues to understand the characteristics of such specific arguments in the test cases that can capture the SC issues. Inspired by our empirical findings, we propose an automated testing technique Sensor, which synthesizes test cases using ingredients from the project under test to trigger inconsistent behaviors of the APIs with the same signatures in conflicting library versions. Our evaluation results show that \textsc{Sensor} is effective and useful: it achieved a $Precision$ of 0.803 and a $Recall$ of 0.760 on open-source projects and a $Precision$ of 0.821 on industrial projects; it detected 150 semantic conflict issues in 29 projects, 81.8\% of which had been confirmed as real bugs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。