1 The basics of unit testing
This chapter covers
- Defining entry points & exit points
- Defining a unit of work & unit tests
- Contrasting unit testing with integration testing
- Exploring a simple unit testing example
- Understanding test-driven development
Some assumptions before we begin:
Yes. The previous editions of this book were in C#. I’ve foun that about 80% of the patterns there have transferred over quite easily. So you should be able to read this book eve if you come from Java, .NET, Python, Ruby or other languages. The patterns are just patterns. The language being used is there just so we can demonstrate those patterns. But they are not language specific.
1.1 The first step
There’s always a first step: the first time you wrote a program, the first time you failed a project, and the first time you succeeded in what you were trying to accomplish. You never forget your first time, and I hope you won’t forget your first tests.