当前位置: X-MOL 学术Software Qual. J. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Two experiments for evaluating the impact of Hamcrest and AssertJ on assertion development
Software Quality Journal ( IF 1.9 ) Pub Date : 2020-06-03 , DOI: 10.1007/s11219-020-09507-0
Maurizio Leotta , Maura Cerioli , Dario Olianas , Filippo Ricca

Test automation enables continuous testing, a cornerstone of agile methods, and DevOps. Assertions play a fundamental role in test automation, and recently competing assertion libraries for unit testing frameworks, such as, for example, JUnit or TestNG, emerged. Thus, it is imperative to gauge assertion libraries in terms of developer/tester productivity, allowing SQA managers and software testers to select the best. The goal of this work is comparing two assertion libraries having a different approach (matchers vs. fluent assertions) w.r.t. two dependent variables: correctness of developed assertions and time to develop them. We conducted two controlled experiments with Bachelor students in Computer Science and Master students in Computer Engineering. AssertJ (fluent assertions approach) is compared with Hamcrest (matchers), in a test development scenario with the Java language where 672 assertions were developed by 48 students overall. The results show that (a) adopting AssertJ improves the tester’s productivity significantly during the development of assertions only for Bachelor students, and (b) time of developing assertions is similar using AssertJ or Hamcrest in both the categories of participants. Testers and SQA managers selecting assertion libraries for their organizations should consider as first choice AssertJ in case of inexperienced developers/testers since our study shows that it increases the productivity of Bachelor students more than Hamcrest.

中文翻译:

用于评估 Hamcrest 和 AssertJ 对断言开发影响的两个实验

测试自动化支持持续测试,这是敏捷方法和 DevOps 的基石。断言在测试自动化中扮演着重要的角色,最近出现了用于单元测试框架的竞争断言库,例如 JUnit 或 TestNG。因此,必须根据开发人员/测试人员的生产力来衡量断言库,以便 SQA 经理和软件测试人员选择最好的。这项工作的目标是比较两个具有不同方法(匹配器与流畅断言)的断言库,以及两个因变量:开发断言的正确性和开发它们的时间。我们对计算机科学专业的本科生和计算机工程专业的硕士生进行了两个对照实验。AssertJ(流畅的断言方法)与 Hamcrest(匹配器)进行比较,在使用 Java 语言的测试开发场景中,总共 48 名学生开发了 672 个断言。结果表明,(a) 采用 AssertJ 显着提高了测试人员在开发断言期间的生产力,仅适用于本科生,(b) 开发断言的时间在两种类别的参与者中使用 AssertJ 或 Hamcrest 是相似的。为他们的组织选择断言库的测试人员和 SQA 经理应该将 AssertJ 视为缺乏经验的开发人员/测试人员的首选,因为我们的研究表明,它比 Hamcrest 更能提高学士学生的生产力。结果表明,(a) 采用 AssertJ 显着提高了测试人员在开发断言期间的生产力,仅适用于本科生,(b) 开发断言的时间在两种类别的参与者中使用 AssertJ 或 Hamcrest 是相似的。为他们的组织选择断言库的测试人员和 SQA 经理应该将 AssertJ 视为缺乏经验的开发人员/测试人员的首选,因为我们的研究表明,它比 Hamcrest 更能提高学士学生的生产力。结果表明,(a) 采用 AssertJ 显着提高了测试人员在开发断言期间的生产力,仅适用于本科生,(b) 开发断言的时间在两种类别的参与者中使用 AssertJ 或 Hamcrest 是相似的。为他们的组织选择断言库的测试人员和 SQA 经理应该将 AssertJ 视为缺乏经验的开发人员/测试人员的首选,因为我们的研究表明,它比 Hamcrest 更能提高学士学生的生产力。
更新日期:2020-06-03
down
wechat
bug