Behavioural models are a valuable tool for software verification, testing, monitoring, publishing etc. However, they are rarely provided by the software developers and have to be extracted either from the source or from the compiled code. In the context of Java programs, a number of approaches exist for building behavioural models. Most of these approaches rely on the analysis of the compiled bytecode. Instead, we are looking to extract behavioural models in the form of Finite State Machines (FSMs) from the Java source code to ensure that the obtained FSMs can be easily understood by the software developers and, if necessary, updated or integrated into the original source code, e.g. in the form of annotations. Modern software systems are huge, rely on external libraries and interact with their environment. Hence, extracting useful behavioural models requires abstraction. In this paper, we present an initial approach to this problem by focusing on the extraction of FSMs modelling library APIs. We focus on the analysis of Java code involving the use of collections. To this end, we encode the operational semantics of collection operations using patterns of Boolean predicates. These patterns are instantiated based on the analysis of the source code of API implementation methods to form an encoding of the possible FSM transitions. A SAT solver is then used to determine the enabledness conditions (guards) of these transitions.
翻译:行为模型是软件核查、测试、监测、出版等的宝贵工具。但是,软件开发者很少提供行为模型,而且很少从源码或汇编的代码中提取这些模型。在爪哇方案方面,有一些方法可用于建立行为模型。这些方法大多依靠对已编好的字典的分析。相反,我们从爪哇源代码中寻求以Finite State Syanians(FSMs)的形式提取行为模型,以确保获得的FSMs(FSMs)形式易于为软件开发者所理解,并在必要时更新或纳入原始源代码,例如以说明的形式。现代软件系统非常庞大,依靠外部图书馆并与它们的环境互动。因此,提取有用的行为模型需要抽象化。在本文件中,我们提出一种初步方法,重点是提取FSMSMs建模图书馆的APIS模型。我们侧重于对爪哇代码的分析,涉及收藏的使用。为此,我们用Boolean的上游模式对收集作业的操作结构进行编码。这些模式是即时的,根据对ASMA系统应用的ANSS格式的系统转换成一种可能使用的APRSMA的源代码。我们使用的ADSDR的系统。这些方法是用来确定AIS的API的变换版。