Preparing for a Test Driven Development Session EDUARDO GUERRA, National Institute for Space Research, Brazil MAURÍCIO FINAVARO ANICHE, University of São Paulo, Brazil MARCO AURÉLIO GEROSA, University of São Paulo, Brazil JOSEPH YODER, Refactory Inc., USA Testdriven development (TDD) is a development technique used to design classes in a software system by first creating tests before implementing the actual code. However, even before you start creating tests, there are some preparation tasks that the developer should do. This involves gathering information about the class(es) that will be worked on along with how the test(s) should be created. This paper presents some patterns that represent practices that should be applied before starting a TDD session. Categories and Subject Descriptors: D.1.5 [Programming Techniques]: Objectoriented Programming; D.2.11 [Software Architectures]: Patterns General Terms: Test driven development Additional Key Words and Phrases: TDD, software design, patterns ACM Reference Format: Guerra, E., Aniche, M. and Gerosa, M. , Yoder, J.. 2014. Preparing for a Test Driven Development Session. Proceedings of the Conference on Pattern Languages of Programs (PLoP). September 2014, 11 pages. 1. INTRODUCTION Testdriven development (TDD) is a technique in which the tests are written before the production code (Beck 2002). With TDD, the development occurs in cycles, comprised of the creation of an automated test, an update of the software to make the test pass and possibly a code refactoring to improve the solution. A set of TDD cycles in a continuous time box with the goal to develop a given functionality is called TDD session. TDD can be used for many different goals: as a testing technique, in which developers expect an improvement in the external quality; or as a design technique, in order to improve class design (Beck, 2002; Martin, 2006; Astels, 2003). This paper continues to document a series of patterns that can be used by developers that are using TDD as a design technique. The two preceding papers documented respectively the basic TDD step patterns (Guerra 2012) and patterns for designing object dependences (Guerra et al. 2013a). Both papers present patterns used during the TDD session to move forward on class development. This paper focuses on practices that should be applied before starting a TDD session, preparing the developer for the following development. Before starting any TDD session it is important to know the Functionality List of the scenarios for the software to be created, Understand the Class Role in Architecture of any classes that will be modified, Know your Neighborhood of any related or collaborating classes, and Choose Your Weapons for the best tools to implement the test suitable to the class functionality. This paper presents a study based on the authors’ experiences with TDD and some documented TDD experiences to identify the patterns whose names are highlighted on the previous sentence. The target audience for these patterns is developers with knowledge on unit testing that understand TDD basic concepts, and want to refine and understand better the TDD process. The patterns consider TDD as a design technique, and not only used by development after a previous design. It includes considerations of how the class being developed by TDD relates to the architecture and to the other classes around it. Since TDD is an agile technique, the practices documented here do not need to part of an explicit and formal process, but they should be part of a lightweight and implicit process. The pattern format used is based on the classic Alexander format. It starts with the pattern name and some alias, followed by a picture that illustrates the pattern idea. The intent of these images is to present a strong Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. A preliminary version of this paper was presented in a writers' workshop at the 21st Conference on Pattern Languages of Programs (PLoP). PLoP'14, September 1417, Monticello, Illinois, USA. Copyright 2014 is held by the author(s). HILLSIDE 978-1-941652-01-5.