TY - JOUR
T1 - Auto-generated Spies Increase Test Maintainability
AU - Läufer, Konstantin
AU - O'Sullivan, John
AU - Thiruvathukal, George K.
N1 - Konstantin Läufer, John O'Sullivan, and George K. Thiruvathukal, Auto-generated Spies Increase Test Maintainability, arXiv:1808.09630
PY - 2018/8/29
Y1 - 2018/8/29
N2 - We have inspected the test code for the scala.collection.Iterator trait for potential systematic maintainability enhancements. Test spies are stub objects for later verification of interactions with those objects in a testing scenario. According to our preliminary findings, using a mocking framework that supports the automatic generation of test spies, such as Mockito, can lead to a significant improvement of test code in terms of size (in some cases over 70% smaller), readability, and conveying intent by expressing expectations through a declarative domain-specific language. We argue that the resulting test code is not only more maintainable but also a better stylistic match for the Scala community than manually implemented, explicitly stateful test spies.
AB - We have inspected the test code for the scala.collection.Iterator trait for potential systematic maintainability enhancements. Test spies are stub objects for later verification of interactions with those objects in a testing scenario. According to our preliminary findings, using a mocking framework that supports the automatic generation of test spies, such as Mockito, can lead to a significant improvement of test code in terms of size (in some cases over 70% smaller), readability, and conveying intent by expressing expectations through a declarative domain-specific language. We argue that the resulting test code is not only more maintainable but also a better stylistic match for the Scala community than manually implemented, explicitly stateful test spies.
UR - https://ecommons.luc.edu/cs_facpubs/198
UR - https://arxiv.org/abs/1808.09630
U2 - 1808.09630
DO - 1808.09630
M3 - Article
JO - Computer Science: Faculty Publications and Other Works
JF - Computer Science: Faculty Publications and Other Works
ER -