Modern software design practice implies widespread use in the development of ready-made components, usually designed as external libraries. The undoubted advantages of reusing third-party code can be offset by integration errors that appear in the developed software. The reason for the appearance of such errors is mainly due to misunderstanding or incomplete understanding by the programmer of the details of external libraries such as an internal structure and the subtleties of functioning. The documentation provided with the libraries is often very sparse and describes only the main intended scenarios for the interaction of the program and the library. In this paper, we propose the approach based on the use of formal library specifications, which allows detecting integration errors using static analysis methods. To do this, the external library is described using the LibSL specification language, the resulting description is translated into the internal data structures of the KEX analyzer. The execution of the incorrect scenarios of library usage, such as the incorrect sequence of method calls or the violation of the API function contract, is marked in the program model with special built-in functions of the KEX analyzer. Later, when analyzing the program, KEX becomes able to detect integration errors, since incorrect library usage scenarios are diagnosed as calling marked functions. The proposed approach is implemented as SPIDER (SPecification-based Integration Defect Revealer), which is an extension of the Kex analyzer and has proven its efficiency by detecting integration errors of different classes on several special-made projects, as well as on several projects taken from open repositories.
翻译:现代软件设计实践意味着在开发现成组件时广泛使用,通常设计成外部图书馆。重新使用第三方代码的无可置疑的优点可以通过开发软件中出现的整合错误来抵消。出现这类错误的原因主要是程序设计者对外部图书馆细节的误解或不完全理解,例如内部结构和功能的微妙性。图书馆提供的文件往往非常稀少,只描述了程序与图书馆互动的主要预期情景。本文中,我们建议了基于使用正式图书馆规格的方法,该规格允许使用静态分析方法来探测整合错误。为此,外部图书馆使用LibSL规格语言进行描述,由此产生的描述被翻译成KEX分析仪的内部数据结构。执行图书馆使用错误的假想,例如方法顺序不正确或违反API功能合同。在程序模型中标注了基于 KEX 分析仪的特殊内在功能。随后,在分析程序时,KEX 能够检测整合错误,因为不正确的图书馆使用率假设语言被描述为KEX分析程序的不同类别,因此,通过测试项目被诊断为标准化的升级方法,并被诊断为不同类别。