当前位置: X-MOL 学术Empir. Software Eng. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Mining understandable state machine models from embedded code
Empirical Software Engineering ( IF 4.1 ) Pub Date : 2020-09-08 , DOI: 10.1007/s10664-020-09865-0
Wasim Said , Jochen Quante , Rainer Koschke

Program understanding is a time-consuming and tedious activity for software developers. Manually building abstractions from source code requires in-depth analysis of the code. Automatic extraction of such models is possible, but cannot derive meaningful abstractions that are not already contained in the code. The automated extraction even has problems to decide which aspects of the code are important and which are not. Therefore, interactive semi-automatic approaches are the compromise of choice. In this article, we describe how state machines that describe the behaviour of a function can be extracted from code. The approach includes interaction – the user decides which aspects of the identified potentially relevant information is really relevant and which is not. This helps to reduce the resulting state machines to an understandable degree. However, these state machines in their raw form have transition conditions that are very complex and thus not understandable for humans. Therefore, we also introduce a technique to reduce these guards to an understandable form. The technique is a combination of heuristic logic minimization, exploitation of infeasible paths, and using transition priorities. We evaluate the approach on industrial embedded C code, first in a case study with hundreds of extracted state machines, and then in two experiments with professional developers. The results show that the approach is highly effective in making the guards understandable, and that guards reduced by our approach and presented with priorities are easier to understand than guards without priorities. We also show that the overall approach is beneficial for program comprehension. The guard reduction approach itself is quite generic and can also be applied to other problems. We demonstrate that for the simplification of mode switch logic.

中文翻译:

从嵌入式代码中挖掘可理解的状态机模型

对于软件开发人员来说,程序理解是一项耗时且乏味的活动。从源代码手动构建抽象需要对代码进行深入分析。此类模型的自动提取是可能的,但无法导出尚未包含在代码中的有意义的抽象。自动提取甚至无法确定代码的哪些方面重要,哪些方面不重要。因此,交互式半自动方法是一种折衷选择。在本文中,我们将描述如何从代码中提取描述函数行为的状态机。该方法包括交互——用户决定所识别的潜在相关信息的哪些方面是真正相关的,哪些不是。这有助于将结果状态机减少到可以理解的程度。然而,这些原始形式的状态机具有非常复杂的转换条件,因此人类无法理解。因此,我们还引入了一种技术,将这些守卫简化为可理解的形式。该技术是启发式逻辑最小化、不可行路径的利用和使用转换优先级的组合。我们首先在具有数百个提取状态机的案例研究中评估工业嵌入式 C 代码的方法,然后与专业开发人员进行两次实验。结果表明,该方法在使警卫易于理解方面非常有效,并且通过我们的方法减少并呈现优先级的警卫比没有优先级的警卫更容易理解。我们还表明,整体方法有利于程序理解。保护减少方法本身非常通用,也可以应用于其他问题。为了简化模式切换逻辑,我们证明了这一点。
更新日期:2020-09-08
down
wechat
bug