Example - not needing a test
void populateContactInfo() {
populateName();
populateAddress();
populatePhone();
}
Example - needs at least 2 tests because there are 2 branches of code
void populateContactInfo() {
if (hasName) {
populateName();
}
else {
populateDefaultName();
}
populateAddress();
populatePhone();
}
The phrase Test-If-Development has one other benefit. That is,"If" you are doing "Development", you "Test". Period.
No comments:
Post a Comment