So let's look at this one by one. The fact the program takes
too long to execute is not really a bad smell. It probably indicates
some problem with the code and the fact that we might need to
modify the code to make it more efficient, but it's not something that
we will normally classify it as a bad smell, so we're not going to
mark it. The second one, conversely, is definitely a bad smell. The fact
that the method is too long is a typical example of bad smell
and one in which we might want to apply some refactoring, for example,
the extract method or the
decomposed conditional refactorings. There's definitely
nothing wrong with the fact that the classes cat and dog
are subclasses of class animal. Actually, that sounds pretty appropriate, so
this is not a problem and definitely not a bad smell.
Whereas the fact that every time we modify method M1,
we also need to modify method some other method M2 as
a typical example of bad smell. So this can actually be
considered a specific example of what we just called "shotgun surgery."
So it is a case in which we might want to
use, for instance, the move method refactoring to fix the issue.