Chapter 7. String Handling

Strings are pervasive in computer programming. Whether joining names or generating or parsing XML documents, strings are a fundamental representation for much of the world’s data, which leaves us with the task of verifying string data in our tests.

In this chapter, we examine several ways to verify strings in our tests. We start with the easiest and weakest approaches and increase the strength of our verification with little increase in the complexity of our approach. In the end, we have an approach that gives us strict verification yet is resilient to code changes and friendly to localization strategies.

Get Quality Code: Software Testing Principles, Practices, and Patterns 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.