记录API Input/Output示例
Documenting API Input/Output Examples
摘要:
在学习使用应用程序编程接口(API)时,程序员需要了解API函数的输入和输出(I/O)。当前的文档工具自动记录I/O的静态信息,例如参数类型和名称。这些工具缺少的是动态信息,比如I/O示例--产生某些输出的输入的实际有效值。在本文中,我们展示了一个原型工具集,我们建立了生成I/O的例子。我们的工具在执行API函数时记录I/O值,例如在运行测试套件时。然后,该工具将I/O值作为I/O示例放入API文档中。我们的工具有三个程序:1)funcWatch,它在API开发人员运行测试套件时收集I/O值; 2)ioSelect,它从一组I/O值中选择一个I/O示例; 3)ioPresent,它将I/O示例嵌入到文档中。在初步评估中,我们使用我们的工具为三个C库生成了400个I/O示例:ffmpeg、libssh和protobuf-c。
英文摘要:
When learning to use an Application Programming Interface (API), programmers need to understand the inputs and outputs (I/O) of the API functions. Current documentation tools automatically document the static information of I/O, such as parameter types and names. What is missing from these tools is dynamic information, such as I/O examples---actual valid values of inputs that produce certain outputs. In this paper, we demonstrate a prototype toolset we built to generate I/O examples. Our tool logs I/O values when API functions are executed, for example in running test suites. Then, the tool puts I/O values into API documents as I/O examples. Our tool has three programs: 1) funcWatch, which collects I/O values when API developers run test suites, 2) ioSelect, which selects one I/O example from a set of I/O values, and 3) ioPresent, which embeds the I/O examples into documents. In a preliminary evaluation, we used our tool to generate four hundred I/O examples for three C libraries: ffmpeg, libssh, and protobuf-c.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。