Strategies for avoiding text fixture smells during software evolution

An important challenge in creating automated tests is how to design test fixtures, i.e., the setup code that initializes the system under test before actual automated testing can start. Test designers have to choose between different approaches for the setup, trading off maintenance overhead with slow test execution. Over time, test code quality can erode and test smells can develop, such as the occurrence of overly general fixtures, obscure inline code and dead fields. In this paper, we investigate how fixture-related test smells evolve over time by analyzing several thousand revisions of five open source systems. Our findings indicate that setup management strategies strongly influence the types of test fixture smells that emerge in code, and that several types of fixture smells often emerge at the same time. Based on this information, we recommend important guidelines for setup strategies, and suggest how tool support can be improved to help in both avoiding the emergence of such smells as well as how to refactor code when test smells do appear.

[1]  Arie van Deursen,et al.  Refactoring test code , 2001 .

[2]  Radu Marinescu,et al.  Detecting design flaws via metrics in object-oriented systems , 2001, Proceedings 39th International Conference and Exhibition on Technology of Object-Oriented Languages and Systems. TOOLS 39.

[3]  Kent L. Beck,et al.  Test-driven Development - by example , 2002, The Addison-Wesley signature series.

[4]  Brian Henderson-Sellers,et al.  Object-Oriented Metrics , 1995, TOOLS.

[5]  Stéphane Ducasse,et al.  Object-Oriented Metrics in Practice , 2005 .

[6]  Alessandro Orso,et al.  Understanding myths and realities of test-suite evolution , 2012, SIGSOFT FSE.

[7]  B. Van Rompaey,et al.  On The Detection of Test Smells: A Metrics-Based Approach for General Fixture and Eager Test , 2007, IEEE Transactions on Software Engineering.

[8]  C.J.H. Mann,et al.  Object-Oriented Metrics in Practice: Using Software Metrics to Characterize, Evaluate, and Improve the Design of Object-Oriented Systems , 2007 .

[9]  Charles Ashbacher Growing Object-Oriented Software, Guided by Tests , 2010, J. Object Technol..

[10]  Martin Kropp,et al.  Automated acceptance test refactoring , 2011, WRT '11.

[11]  Gerard Meszaros,et al.  xUnit Test Patterns: Refactoring Test Code , 2007 .

[12]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[13]  Arie van Deursen,et al.  Automated Detection of Test Fixture Strategies and Smells , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[14]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[15]  Robert C. Martin Clean Code - a Handbook of Agile Software Craftsmanship , 2008 .

[16]  Bart Van Rompaey,et al.  TestQ: Exploring Structural and Maintenance Characteristics of Unit Test Suites , 2008 .

[17]  Serge Demeyer,et al.  Characterizing the Relative Significance of a Test Smell , 2006, 2006 22nd IEEE International Conference on Software Maintenance.

[18]  Helmut Neukirchen,et al.  Utilising Code Smells to Detect Quality Problems in TTCN-3 Test Suites , 2007, TestCom/FATES.

[19]  Sallie M. Henry,et al.  Object-oriented metrics that predict maintainability , 1993, J. Syst. Softw..

[20]  Kent Beck,et al.  Contributing to Eclipse - principles, patterns, and plug-ins , 2003, The Eclipse series.

[21]  Andy Zaidman,et al.  Evaluating the Lifespan of Code Smells using Software Repository Mining , 2012, 2012 16th European Conference on Software Maintenance and Reengineering.

[22]  Oscar Nierstrasz,et al.  Towards a Taxonomy of SUnit Tests , 2005, ESUG.

[23]  Will G. Hopkins,et al.  A new view of statistics , 2002 .

[24]  Arie van Deursen,et al.  Studying the co-evolution of production and test code in open source and industrial developer test processes through repository mining , 2008, Empirical Software Engineering.

[25]  Meir M. Lehman,et al.  On understanding laws, evolution, and conservation in the large-program life cycle , 1984, J. Syst. Softw..