Extract Method refactoring movie
Once complexity metrics, like Cyclomatic complexity, have flagged a method, three proactive steps can be taken to reduce the risk of defects:
- Write tests for that method
- Refactor the method into smaller, more isolatable methods
- Write tests for those newly created methods
This flash demo walks you through the steps of applying the Extract Method refactoring pattern within Eclipse and writing a corresponding test case utilizing the JUnit-addons framework.
