Chapter 9. Test-driven development

 

This chapter covers:

  • 9.1 Building quality into the process 190
  • 9.2 Database select 192
  • 9.3 Database insert and update 201
  • 9.4 Real database transactions 205
  • 9.5 Summary 209

I misplaced my cellphone once and could not find it anywhere. This happens to me sometimes, and I know exactly what to do about it: I pick up another phone and call the cellphone. Usually, this makes it easy.

But this particular late night, something spooky happened. Although I could hear it, I simply could not locate it. The sound appeared to be coming from somewhere inside a bookshelf, and although I had no idea why I would have left the phone there, I kept looking, listening, and groping for it.

But to no avail. I could still hear it, and I believed I had found the approximate location of the sound, but there was no way I could pinpoint its location. Another odd thing was the fact that I could hear only the vibrating alert, but not the regular ring-tone, even though I believed I had done nothing to silence it.

I had practically given up, when it dawned on me: it’s on the other side of the wall. I went into the living room, and there it was. Now I could even hear it ringing. I had been looking for it in vain for at least half an hour, trying to narrow down the search as best I could. But what I really needed was to expand my perspective. Then it was easy to find.

9.1. Building quality into the process

9.2. Database select

9.3. Database insert and update

9.4. Real database transactions

9.5. Summary