Detecting Architectural Violations Using Responsibility and Dependency Constraints of Components

Detecting Architectural Violations Using Responsibility and Dependency Constraints of Components
复制标题

DOI:
10.1587/transinf.2017kbp0023
复制
发表时间:
2018-07
期刊:
IEICE Trans. Inf. Syst.
影响因子:
--
通讯作者:
Shinpei Hayashi;Fumiki Minami;M. Saeki
Shinpei Hayashi;Fumiki Minami;M. Saeki
中科院分区:
其他
文献类型:
--
作者:
Shinpei Hayashi;Fumiki Minami;M. Saeki

文献摘要

相似文献

摘要利用软件体系结构模式对于降低维护成本非常重要。然而,根据架构模式定义的约束来维护代码是一项耗时的工作。如本文所述,我们提出了一种技术来检测不符合架构的代码片段作为细粒度架构违规。对于该技术,从源代码中提取的代码片段之间的依赖图和根据体系结构的推理规则是输入。一组候选组件被附加到图的每个节点并被逐步更新,代码片段可以被链接到该组候选组件。推理规则表达了组件的责任和依赖约束。它们从周围代码片段的当前估计状态中移除每个节点的不满足约束的候选组件。如果代码片段的推断角色不包括该代码片段当前所属的组件,则将其检测为违规。我们已经为Web应用程序架构模式的模型-视图-控制器实现了我们的技术。通过将该技术应用于使用Play Framework实现的Web应用程序,获得了准确的检测结果。我们还调查了每个推理规则对违规检测的贡献程度。
SUMMARY Utilizing software architecture patterns is important for reducing maintenance costs. However, maintaining code according to the constraints defined by the architecture patterns is time-consuming work. As described herein, we propose a technique to detect code fragments that are incompliant to the architecture as fine-grained architectural violations. For this technique, the dependence graph among code fragments extracted from the source code and the inference rules according to the architecture are the inputs. A set of candidate components to which a code fragment can be a ffi liated is attached to each node of the graph and is updated step-by-step. The inference rules express the components’ responsibilities and dependency constraints. They remove candidate components of each node that do not satisfy the constraints from the current estimated state of the surrounding code fragment. If the inferred role of a code fragment does not include the component that the code fragment currently belongs to, then it is detected as a violation. We have implemented our technique for the Model-View-Controller for Web Application architecture pattern. By applying the technique to web applications implemented using Play Framework, we obtained accurate detection results. We also investigated how much does each inference rule contribute to the detection of violations.