...
首页> 外文期刊>Computer architecture news >How to Build Static Checking Systems Using Orders of Magnitude Less Code
【24h】

How to Build Static Checking Systems Using Orders of Magnitude Less Code

机译:如何使用数量级少的代码构建静态检查系统

获取原文
获取原文并翻译 | 示例
           

摘要

Modern static bug finding tools are complex. They typically consist of hundreds of thousands of lines of code, and most of them are wedded to one language (or even one compiler). This complexity makes the systems hard to understand, hard to debug, and hard to retarget to new languages, thereby dramatically limiting their scope. This paper reduces the complexity of the checking system by addressing a fundamental assumption, the assumption that checkers must depend on a full-blown language specification and compiler front end. Instead, our program checkers are based on drastically incomplete language grammars ("micro-grammars") that describe only portions of a language relevant to a checker. As a result, our implementation is tiny-roughly 2500 lines of code, about two orders of magnitude smaller than a typical system. We hope that this dramatic increase in simplicity will allow developers to use more checkers on more systems in more languages. We implement our approach in μchex, a language-agnostic framework for writing static bug checkers. We use it to build micro-grammar based checkers for six languages (C, the C preprocessor, C++, Java, JavaScript, and Dart) and find over 700 errors in real-world projects.
机译:现代的静态错误查找工具非常复杂。它们通常由成千上万的代码行组成,并且大多数都与一种语言(甚至是一种编译器)结合在一起。这种复杂性使系统难以理解,难以调试,并且难以重新定向到新语言,从而极大地限制了它们的范围。本文通过提出一个基本假设来降低检查系统的复杂性,该基本假设是检查程序必须依赖于成熟的语言规范和编译器前端。而是,我们的程序检查器基于完全不完整的语言语法(“微语法”),这些语法仅描述与检查器相关的语言部分。结果,我们的实现几乎是2500行代码,比典型系统小大约两个数量级。我们希望这种简单性的显着提高将使开发人员可以在更多系统上以更多语言使用更多检查器。我们在μchex(一种与语言无关的框架,用于编写静态错误检查程序)中实现我们的方法。我们使用它为六种语言(C,C预处理器,C ++,Java,JavaScript和Dart)构建基于微语法的检查器,并在实际项目中发现700多个错误。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号