一个被检查的承诺就是一个被遵守的承诺:检查测试
A promise checked is a promise kept: Inspection Testing
摘要:
有时,开发人员需要确保编译器以特定的方式处理他们的代码,这种方式只有通过检查中间或最终编译工件才能看到。这在精心制作的组合库中尤其常见,其中某些使用模式预计会触发复杂的编译器优化序列-流融合就是一个众所周知的例子。这种库的开发人员必须手动检查构建工件并检查预期的属性。因为这太繁琐了,所以如果库代码、其依赖项或编译器的更改破坏了该属性,它可能会被忽视。自动化的缺乏导致这些库的发布版本违背了它们的文档承诺。这表明,有一个新的测试范式,检查测试,其中程序员声明性地描述了编译工件的非功能属性和编译器检查这些属性是一个未认识到的需求。我们定义了检查测试抽象,实现它在Haskell的上下文中,并表明它提高了这些库的质量。
英文摘要:
Occasionally, developers need to ensure that the compiler treats their code in a specific way that is only visible by inspecting intermediate or final compilation artifacts. This is particularly common with carefully crafted compositional libraries, where certain usage patterns are expected to trigger an intricate sequence of compiler optimizations -- stream fusion is a well-known example. The developer of such a library has to manually inspect build artifacts and check for the expected properties. Because this is too tedious to do often, it will likely go unnoticed if the property is broken by a change to the library code, its dependencies or the compiler. The lack of automation has led to released versions of such libraries breaking their documented promises. This indicates that there is an unrecognized need for a new testing paradigm, inspection testing, where the programmer declaratively describes non-functional properties of an compilation artifact and the compiler checks these properties. We define inspection testing abstractly, implement it in the context of Haskell and show that it increases the quality of such libraries.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。