跳到主要导航 跳到搜索 跳到主要内容

OCL2NL: Automatic generation of natural language descriptions from OCL contracts

  • Yilong Yang
  • , Qizhen Li
  • , Tianshu Bao
  • , Qin Li
  • , Weiru Wang*
  • *此作品的通讯作者
  • Beihang University
  • Liupanshui Normal University
  • Beijing University of Technology

科研成果: 期刊稿件文章同行评审

摘要

Formal contracts play a crucial role in precisely specifying system requirements and facilitating the verification of system implementation through automated test case generation or formal verification techniques, particularly in the development of safety-critical systems. The Object Constraint Language (OCL) is a lightweight formal language widely utilized for expressing constraints in UML-based models. However, due to the semantic gap between OCL expressions and their interpretations, comprehending OCL contracts can be challenging. In this paper, we propose a novel approach called OCL2NL, which enables the automatic generation of natural language descriptions from OCL contracts. OCL2NL encompasses a comprehensive set of translation rules and algorithms that map OCL contracts to semantic and signature descriptions of system operations.To validate our approach, we conducted four case studies. The results demonstrate a high success rate, with 97.06% of the OCL expressions and 87.68% of the signatures generating accurate descriptions. Moreover, domain experts evaluate that 50 out of 52 descriptions of OCL expressions and 11 out of 12 signature descriptions effectively capture essential information about the corresponding OCL contracts. The natural language descriptions significantly enhance the understanding of OCL contracts when compared to the contracts alone. Overall, the results are promising, indicating potential for extension in the software industry.

源语言英语
文章编号103513
期刊Science of Computer Programming
254
DOI
出版状态已出版 - 10月 2026

学术指纹

探究 'OCL2NL: Automatic generation of natural language descriptions from OCL contracts' 的科研主题。它们共同构成独一无二的学术指纹。

引用此