Abstract
While both acceptance-test-driven development (ATDD) and test-driven development (TDD) are methodologies that advocate writing the tests before the code, ATDD (or BDD) is usually considered to lend itself better to bigger test scopes and to scenarios that describe how the users use the system, while TDD is considered to lend itself more specifically to unit tests, which uses the smallest test scope (of a single class or even a method), and therefore tests more technical details. For that reason, unit tests and TDD are considered practices that are done directly by the same developer that implements the code under test (CUT). While toward the end of this chapter we’ll question the distinction between TDD and ATDD, we first need to understand more about unit tests and TDD in general.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
CUT can either mean “code under test” or “class under test.” I use this acronym interchangeably whenever the difference is not important or the meaning is clear from the context. Otherwise I’ll use the explicit term.
- 2.
- 3.
As Martin Fowler said about the JUnit framework: “Never in the field of software development was so much owed by so many to so few lines of code.”
- 4.
- 5.
Kent Beck, Test-Driven Development: By Example (Menlo Park, CA: Addison-Wesley, 2002).
- 6.
Michael Feathers, Working Effectively with Legacy Code (Englewood Cliffs, NJ: Prentice Hall, 2004).
- 7.
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software (Menlo Park, CA: Addison-Wesley Professional, 1994), p. 124.
- 8.
In the Software-Engineering Radio podcast, episode 215, around minute 56 onward, the authors of the GOF book themselves discuss the problems with the Singleton pattern ( http://www.se-radio.net/2014/11/episode-215-gang-of-four-20-years-later/ ).
- 9.
In his website, http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod , there are links to the major documents where these principles originally appeared.
- 10.
- 11.
Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts, Refactoring: Improving the Design of Existing Code (Menlo Park, CA: Addison-Wesley Professional, 1999).
- 12.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Arnon Axelrod
About this chapter
Cite this chapter
Axelrod, A. (2018). Unit Tests and TDD. In: Complete Guide to Test Automation. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3832-5_17
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3832-5_17
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3831-8
Online ISBN: 978-1-4842-3832-5
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books