Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codecop/dependency-breaking-katas
Exercises to practice breaking dependencies to test legacy code.
https://github.com/codecop/dependency-breaking-katas
code-kata dependency exercise kata legacy legacy-code legacy-kata
Last synced: about 2 months ago
JSON representation
Exercises to practice breaking dependencies to test legacy code.
- Host: GitHub
- URL: https://github.com/codecop/dependency-breaking-katas
- Owner: codecop
- License: other
- Created: 2018-11-23T14:45:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T21:04:21.000Z (11 months ago)
- Last Synced: 2024-02-13T22:24:53.327Z (11 months ago)
- Topics: code-kata, dependency, exercise, kata, legacy, legacy-code, legacy-kata
- Language: Java
- Homepage:
- Size: 465 KB
- Stars: 14
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# Dependency Breaking Katas
Exercises to practice breaking dependencies in legacy
code to create tests for it.## Goal
We have some legacy code. We need to make changes.
To make changes we need to introduce tests first.
We might have to change some code to enable testing.
We need to introduce so-called Seams (see [Michael
Feathers' Working Effectively with Legacy
Code](https://www.goodreads.com/book/show/44919.Working_Effectively_with_Legacy_Code)).Changing code without test is risky, so we want to
* Only change as little code as possible.
* Rely on automated Refactoring tools as much as possible.
* You must not change the public API of the class.### Assignments for Techniques
* Parametrise Constructor
* Subclass And Override Method
* Extract And Override Call
* Replace Global Reference With Getter
* Extract And Override Factory MethodPlanned
* Extract Interface
* Adapt Parameter### Task
Each task presents you with a class and some collaborators.
* Bring this class under test. Make sure to cover all paths in the core logic.
* There is an existing test class with a first test case which might or might not work.
* You cannot change collaborators because they are used by other teams as well.### License
[New BSD License](http://opensource.org/licenses/bsd-license.php), see `license.txt` in repository.