Context. Test automation enables continuous testing, a cornerstone of agile methods, and DevOps. Assertions play a fundamental role in test automation, and recently assertion libraries competing 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 Testers to select the best. Objective. 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. Method. We conducted two controlled experiments with Bachelor students in Computer Science and Master students in Computer Engineering. AssertJ is compared with Hamcrest, in a test development scenario with the Java language where 672 assertions were developed by 48 students overall. Results. 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. Conclusions. 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.

Two experiments for evaluating the impact of Hamcrest and AssertJ on assertion development

Leotta, Maurizio;Cerioli, Maura;Olianas, Dario;Ricca, Filippo
2020-01-01

Abstract

Context. Test automation enables continuous testing, a cornerstone of agile methods, and DevOps. Assertions play a fundamental role in test automation, and recently assertion libraries competing 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 Testers to select the best. Objective. 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. Method. We conducted two controlled experiments with Bachelor students in Computer Science and Master students in Computer Engineering. AssertJ is compared with Hamcrest, in a test development scenario with the Java language where 672 assertions were developed by 48 students overall. Results. 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. Conclusions. 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.
File in questo prodotto:
File Dimensione Formato  
SQJ___Hamcrest_vs_AssertJ.pdf

accesso chiuso

Descrizione: Articolo su rivista
Tipologia: Documento in Post-print
Dimensione 946.02 kB
Formato Adobe PDF
946.02 kB Adobe PDF   Visualizza/Apri   Richiedi una copia

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11567/1015131
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 7
  • ???jsp.display-item.citation.isi??? 7
social impact