When working with legacy code, subsequent covering with unit tests is not an easy task. Quite often one is faced with the dilemma of refactoring - you need tests for safely refactorings, but the code needs to be refactored first in order to write any tests. ย Bringing existing code in better shape is essential when existing code must be covered with unit tests. In this presentation we focus on refactorings that are targeted for covering legacy code with unit tests, after it has been written without testing in mind.
These are the sources for the presentation. See also:
- Slides 2014: http://www.slideshare.net/rfilipov/refactoring-fortestability
- Slides 2013: http://www.slideshare.net/rfilipov/refactoring-for-tests-0lides
- File > Open...
- Edit the file refactoring-for-tests.userlibraries and adapt your local path.
- Window > Preferences > Java > Build Path > User Libraries > Import...
File > Import... > Existing Projects into Workspace