Keywords: Pedagogy, unit testing, text encoding
Students often struggle to ascertain just how much they know about a new topic, and thus fail to seek needed remediation. In the context of data science education, I suggest that one way to avoid this trap, is to provide exercises paired with "unit tests", a type of software testing widely used in industry. These tests allow students to quickly and programmatically determine whether their attempted solution is correct, and thus to determine whether additional work is necessary. For variation this method can also be "flipped": students are asked to write informative tests for some piece of code. I illustrate this with a set of exercises used to teach the principles of text encoding to Python beginners enrolled in an introductory class in computational linguistics. We also describe how this technique can be adapted to a pencil-and-paper exercise.