Album Cover

Legacy Code Java

Close Preview
There were only three direct calls to RiskAssessor. Why then did you also include the next two lines in getAmountAtRisk()?
That judgment call, friends, is the biggest one to make when applying E&O. The more code you extract and override, the less "of the real thing" you do test.
In this case, two elements guided our decision:
  • Collaboration aside, that paragraphing comment "get risk assessment" is an instance of the Comment code smell. It's telling us what the code does, instead of calling a method named accordingly. That would usually have us extract a method.
  • After retrieving data from RiskAssessor, the code only produces a simple multiply. We're pretty confident that multiplication works.
| Tweet...
Page rating: | Rate this Page