Retrieving data constraint implementations using fine-grained code patterns

Retrieving data constraint implementations using fine-grained code patterns
复制标题

使用细粒度代码模式检索数据约束实现

DOI:
10.1145/3510003.3510167
复制
发表时间:
2022
期刊:
International Conference on Software Engineering
影响因子:
--
通讯作者:
Marcus, Andrian
Marcus, Andrian
中科院分区:
--
文献类型:
--
作者:
Florez, Juan Manuel;Perry, Jonathan;Wei, Shiyi;Marcus, Andrian

文献摘要

相似文献

业务规则是用于支持组织的软件系统需求的重要部分。这些规则描述了适用于组织的操作、定义和约束。在软件系统中,业务规则通常被转换为对数据所需或允许的值的约束,称为数据约束。业务规则经常发生变化,这反过来又需要对软件中相应的数据约束进行更改。有效和精确地识别数据约束在源代码中实现的位置的能力对于执行这些必要的更改是必不可少的。在本文中,我们介绍了Lasso,第一种自动检索给定数据约束的方法和代码行的技术。Lasso基于可跟踪性链路恢复方法,并利用了最近的研究结果,这些研究确定了数据约束的代码行级实现模式。我们实现了三个版本的Lasso,当它们使用13种常见模式中的任何一种实现时,都可以检索数据约束实现。我们评估了这三个版本的299个数据约束,从15个现实世界的Java系统,并发现他们提高了30%,70%和163%的方法级链接恢复,在前10个结果中的真阳性,相比其基于文本检索的基线。更重要的是,对于299个约束中的68%,Lasso变体正确地识别了在方法内部实现约束的代码行。
Business rules are an important part of the requirements of software systems that are meant to support an organization. These rules describe the operations, definitions, and constraints that apply to the organization. Within the software system, business rules are often translated into constraints on the values that are required or allowed for data, calleddata constraints.Business rules are subject to frequent changes, which in turn require changes to the corresponding data constraints in the software. The ability to efficiently and precisely identify where data constraints are implemented in the source code is essential for performing such necessary changes.In this paper, we introduce Lasso, the first technique that automatically retrieves the method and line of code where a given data constraint is enforced. Lasso is based on traceability link recovery approaches and leverages results from recent research that identified line-of-code level implementation patterns for data constraints. We implement three versions of Lasso that can retrieve data constraint implementations when they are implemented with any one of 13 frequently occurring patterns. We evaluate the three versions on a set of 299 data constraints from 15 real-world Java systems, and find that they improve method-level link recovery by 30%, 70%, and 163%, in terms of true positives within the first 10 results, compared to their text-retrieval-based baseline. More importantly, the Lasso variants correctly identify the line of code implementing the constraint inside the methods for 68% of the 299 constraints.