当前位置: X-MOL 学术J. Syst. Softw. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Custom-tailored clone detection for IEC 61131-3 programming languages
Journal of Systems and Software ( IF 3.7 ) Pub Date : 2021-08-30 , DOI: 10.1016/j.jss.2021.111070
Kamil Rosiak 1 , Alexander Schlie 1 , Lukas Linsbauer 1 , Birgit Vogel-Heuser 2 , Ina Schaefer 1
Affiliation  

Automated production systems (aPS) are highly customized systems that consist of hardware and software. Such aPS are controlled by a programmable logic controller (PLC), often in accordance with the IEC 61131-3 standard that divides system implementation into so-called program organization units (POUs) as the smallest software unit and is comprised of multiple textual (Structured Text (ST)) and graphical (Function Block Diagram (FBD), Ladder Diagram (LD), and Sequential Function Chart(SFC)) programming languages that can be arbitrarily nested.

A common practice during the development of such systems is reusing implementation artifacts by copying, pasting, and then modifying code. This approach is referred to as code cloning. It is used on a fine-granular level where a POU is cloned within a system variant. It is also applied on the coarse-granular system level, where the entire system is cloned and adapted to create a system variant, for example for another customer. This ad hoc practice for the development of variants is commonly referred to as clone-and-own. It allows the fast development of variants to meet varying customer requirements or altered regulatory guidelines. However, clone-and-own is a non-sustainable approach and does not scale with an increasing number of variants. It has a detrimental effect on the overall quality of a software system, such as the propagation of bugs to other variants, which harms maintenance.

In order to support the effective development and maintenance of such systems, a detailed code clone analysis is required. On the one hand, an analysis of code clones within a variant (i.e., clone detection in the classical sense) supports experts in refactoring respective code into library components. On the other hand, an analysis of commonalities and differences between cloned variants (i.e., variability analysis) supports the maintenance and further reuse and facilitates the migration of variants into a software productline (SPL).

In this paper, we present an approach for the automated detection of code clones within variants (intra variant clone detection) and between variants (inter variant clone detection) of IEC61131-3 control software with arbitrary nesting of both textual and graphical languages. We provide an implementation of the approach in the variability analysis toolkit (VAT) as a freely available prototype for the analysis of IEC 61131-3 programs. For the evaluation, we developed a meta-model-based mutation framework to measure our approach’s precision and recall. Besides, we evaluated our approach using the Pick and Place Unit (PPU) and Extended Pick and Place Unit (xPPU) scenarios. Results show the usefulness of intra and inter clone detection in the domain of automated production systems.



中文翻译:

为 IEC 61131-3 编程语言定制的克隆检测

自动化生产系统 (aPS) 是高度定制的系统,由硬件和软件组成。这种 aPS 由可编程逻辑控制器 (PLC) 控制,通常按照 IEC 61131-3 标准将系统实现划分为所谓的程序组织单元 (POU) 作为最小的软件单元,并由多个文本 (Structured可任意嵌套的文本 (ST)) 和图形(功能块图 (FBD)、梯形图 (LD) 和顺序功能图 (SFC))编程语言。

此类系统开发过程中的常见做法是通过复制、粘贴和修改代码来重用实现工件。这种方法称为代码克隆。它用于细粒度级别,其中 POU 被克隆到系统变体中。它也适用于粗粒度系统级别,其中整个系统被克隆并调整以创建系统变体,例如为另一个客户。这种用于开发变体的临时做法通常称为克隆和拥有。它允许快速开发变体以满足不同的客户要求或改变的监管指南。然而,克隆和拥有是一种不可持续的方法,并且不会随着变体数量的增加而扩展。它对软件系统的整体质量有不利影响,

为了支持此类系统的有效开发和维护,需要进行详细的代码克隆分析。一方面,对变体中的代码克隆的分析(即经典意义上的克隆检测)支持专家将各自的代码重构为库组件。另一方面,克隆变体之间的共性和差异分析(即变异性分析)支持维护和进一步重用,并促进变体迁移到软件产品线(SPL)中。

在本文中,我们提出了一种自动检测 IEC61131-3 控制软件的变种内(变种内克隆检测)和变种间(变种间克隆检测)代码克隆的方法,具有文本和图形语言的任意嵌套。我们在可变性分析工具包 (VAT) 中提供该方法的实现,作为用于分析 IEC 61131-3 程序的免费原型。为了评估,我们开发了一个基于元模型的突变框架来衡量我们方法的精确度和召回率。此外,我们使用拾放单元 (PPU) 和扩展拾放单元 (xPPU) 场景评估了我们的方法。结果显示了内部和内部克隆检测在自动化生产系统领域的有用性。

更新日期:2021-09-15
down
wechat
bug