论文标题

依赖冲突会影响我程序的语义吗?

Will Dependency Conflicts Affect My Program's Semantics?

论文作者

Wang, Ying, Wu, Rongxin, Wang, Chao, Wen, Ming, Liu, Yepang, Cheung, Shing-Chi, Yu, Hai, Xu, Chang, Zhu, Zhiliang

论文摘要

Java项目通常建立在各个第三方库的顶部。如果类Path上存在多个库的版本,JVM只会加载一个版本,并遮蔽另一个版本,我们将其称为依赖关系冲突。如果项目引用的库API具有相同的方法签名,但在库中的库和阴影版本上,这将引起语义冲突(SC)问题。 SC问题对于开发人员在实践中很难诊断,因为理解它们通常需要领域知识。尽管将现有的测试生成技术适应依赖性冲突问题,但Riddle可行地检测SC问题,但其有效性受到了极大的损害。这主要是因为Riddle随机生成测试输入,而SC问题通常需要测试中的特定参数。为了解决这个问题,我们对75个实际SC问题进行了实证研究,以了解可以捕获SC问题的测试案例中此类特定论点的特征。受我们的经验发现的启发,我们提出了一种自动测试技术传感器,该传感器使用正在测试的项目中的成分合成测试用例,以触发API的不一致行为,并在相互矛盾的库版本中具有相同的签名。我们的评估结果表明,\ textsc {传感器}有效且有用:它在开源项目上实现了0.803的$ Precision $为0.803,$召回$为0.760,工业项目的$ PRECISION $ 0.821;它在29个项目中检测到150个语义冲突问题,其中81.8%被确认为真正的错误。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源