Giter VIP home page Giter VIP logo

codecop / dependency-breaking-katas Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 16.0 476 KB

Exercises to practice breaking dependencies to test legacy code.

Home Page: https://www.code-cop.org/presentations/refactoring/Working%20With%20Legacy%20Code%20(2024).pdf

License: Other

Java 30.14% C# 22.20% Batchfile 3.44% PHP 12.57% Makefile 1.48% C 18.39% Kotlin 0.71% TypeScript 10.69% JavaScript 0.39%
exercise kata dependency legacy legacy-kata code-kata legacy-code

dependency-breaking-katas's Introduction

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).

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 Method

Planned

  • 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, see license.txt in repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.