[C]ORRECT: [C]onformance
Explore how to ensure data conforms to expected formats and rules using the CORRECT method in unit testing. Learn to identify and test boundary conditions for inputs such as email addresses and report data structures, and understand how early validation improves test efficiency. This lesson helps you create thorough tests for format validation and boundary cases to strengthen your Java unit tests.
We'll cover the following...
[C]onformance: Conform to a specific format
Many data elements must conform to a specific format. For example, an email address generally follows the form:
name@somedomain
The name and domain portions of the address each follow a different set of fairly detailed rules. Imagine that we want to validate the conformance of an email address to these many regulations.
Perhaps our code parses an email address in an attempt to extract its ...