Exercise 27. tr
This exercise is continuing the study of doing TDD (test-driven development, a.k.a. test first–style development). It’s important to know how to do this kind of programming since it is used in many places, but as mentioned before it does have its limitations. You’ll be doing one more exercise using TDD while implementing the tr command. Be very sure that you are being strict about writing your test first, then the code, then audit both.
In the previous exercise I told you to build your test case and your code incrementally. This is usually the least error-prone method of development, but it doesn’t help you get better at analyzing your own code. In this exercise you’re going to do things slightly differently as I’ll have you write ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access