arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.11934cs.SE
收藏

代码文档化与分析以保障软件开发安全

Code Documentation and Analysis to Secure Software Development

Paul Attie, Anas Obeidat, Nathaniel Oh, Ian Yelle

AI总结:

CoDAT 工具利用大型语言模型和正则表达式算法,在 IDE 中自动检测代码与注释的不一致,支持逐步精化开发,并通过去中心化后端保障代码一致性。

摘要:

我们提出了代码文档化与分析工具(CoDAT)。CoDAT 是一款旨在维护代码文档各层级之间一致性的工具,例如,如果代码草图中的一行被修改,记录相应代码的注释也会被修改。也就是说,注释被链接并更新,以保持内部一致性以及与代码的一致性。通过标记“过时”的注释,CoDAT 提醒开发者保持文档的更新。我们使用大型语言模型来检查代码片段与描述其的注释之间的语义一致性。因此,我们不仅标记过时的注释,还标记语义不一致之处。这有助于程序员编写正确实现代码草图的代码,从而为逐步精化方法提供机器支持,该方法从代码草图开始,通过一次或多次精化迭代逐步深入到代码。CoDAT 在 Intellij IDEA 集成开发环境中实现,我们使用 Code Insight 守护进程包以及自定义正则表达式算法来标记其对应代码块已更改的标记注释。CoDAT 的后端在结构上是去中心化的,以支持用于代码一致性和架构编译跟踪的分布式账本框架。

英文摘要:

We present the Code Documentation and Analysis Tool (CoDAT). CoDAT is a tool designed to maintain consistency between the various levels of code documentation, e.g. if a line in a code sketch is changed, the comment that documents the corresponding code is also changed. That is, comments are linked and updated so as to remain internally consistent and also consistent with the code. By flagging "out of date" comments, CoDAT alerts the developer to maintain up-to-date documentation. We use a large language model to check the semantic consistency between a fragment of code and the comments that describe it. Thus we also flag semantic inconsistency as well as out of date comments. This helps programers write code that correctly implements a code sketch, and so provides machine support for a step-wise refinement approach, starting with a code sketch and proceeding down to code through one or more refinement iterations. CoDAT is implemented in the Intellij IDEA IDE where we use the Code Insight daemon package alongside a custom regular expression algorithm to mark tagged comments whose corresponding code blocks have changed. CoDAT's backend is structurally decentralized to allow a distributed ledger framework for code consistency and architectural compilation tracking.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑