Test Smell: Irrelevant Information
Learn how to eradicate irrelevant information with the use of meaningful constants.
We'll cover the following...
A well-abstracted test emphasizes everything that is important to understand and deemphasizes anything that’s not. The data used in a test should help tell a story.
Sometimes, we’re forced to supply data to get code to compile, even though that data is irrelevant to the test at hand. For example, a method might take additional arguments that have no impact on the test.
Magic literal and meaningful names
Magic literals are literals used arbitrarily, without a clear explanation of their meaning. Magic literals are considered poor practice because they reduce ...