【24h】

Unit tests as API usage examples

机译:单元测试作为API使用示例

获取原文

摘要

This study aims to find out if API unit tests can provide good usage examples, and if so, what prevents developers from finding and using those examples. The results of an experiment we performed with two groups of developers showed that unit tests can be very helpful, especially when the task is complicated and involves multiple classes and methods. Well-written tests proved to be a good source of examples, but finding the relevant examples using the standard tools might be very difficult. We propose to supplement the standard API documentation with relevant examples taken from the unit tests. To further improve the learnability of the API, presentation of the documentation and examples has to be tailored in a way that separates or hides advanced usage scenarios from the commonly used ones.
机译:本研究旨在确定API单元测试是否可以提供良好的使用示例,如果可以,那么是什么导致开发人员无法找到和使用这些示例。我们与两组开发人员进行的实验结果表明,单元测试非常有帮助,尤其是当任务很复杂并且涉及多个类和方法时。编写良好的测试被证明是很好的例子,但是使用标准工具来找到相关的例子可能非常困难。我们建议使用从单元测试中获取的相关示例来补充标准API文档。为了进一步提高API的可学习性,必须以一种将高级用法方案与常用方案区分开或隐藏的方式来定制文档和示例的表示。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号