What Tests Are We Missing?

We’re rarely handed all the specs on a silver platter. Few are so lucky. Even our Soundex rules, seemingly complete, don’t cover everything. While we were coding, some of the tests and some of our implementation triggered other thoughts. We’ll either make mental notes or sometimes write down our thoughts on an index card or notepad. Here’s a list for the Soundex exercise:

  • What if we’re passed a word with characters normally considered as word separators, such as periods (for example, “Mr.Smith”)? Should we ignore the characters (like we currently do), throw an exception because the client should have split the word properly, or do something else?

    Speaking of exceptions, how do we test-drive exception handling into our ...

Get Modern C++ Programming with Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.