Coder Social home page Coder Social logo

esterdanielytterbrink / theatrical-players-refactoring-kata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emilybache/theatrical-players-refactoring-kata

0.0 0.0 0.0 542 KB

Example from first chapter of 'Refactoring' by Martin Fowler, with tests and translations

License: MIT License

JavaScript 5.22% C++ 9.51% Python 5.09% PHP 15.03% Objective-C 1.64% Java 9.38% Scala 7.73% Go 15.10% C# 12.62% Kotlin 7.82% Swift 9.70% CMake 1.00% Batchfile 0.17%

theatrical-players-refactoring-kata's Introduction

Theatrical Players Refactoring Kata

The first chapter of 'Refactoring' by Martin Fowler, 2nd Edition contains a worked example of this exercise, in javascript. That chapter is available to download for free. This repo contains the starting point for this exercise in several languages, with tests, so you can try it out for yourself.

What you need to change

Refactoring is usually driven by a need to make changes. In the book, Fowler adds code to print the statement as HTML in addition to the existing plain text version. He also mentions that the theatrical players want to add new kinds of plays to their repertoire, for example history and pastoral.

Automated tests

In his book Fowler mentions that the first step in refactoring is always the same - to ensure you have a solid set of tests for that section of code. However, Fowler did not include the test code for this example in his book. I have used an Approval testing approach and added some tests. I find Approval testing to be a powerful technique for rapidly getting existing code under test and to support refactoring. You should review these tests and make sure you understand what they cover and what kinds of refactoring mistakes they would expect to find.

Acknowledgements

Thankyou to Martin Fowler for kindly giving permission to use his code.

theatrical-players-refactoring-kata's People

Contributors

ardalis avatar chaabani-anis avatar claremacrae avatar colindecarlo avatar dertseha avatar domenique avatar emilybache avatar gregorriegler avatar khooviraj avatar larseckart avatar nolwennd avatar nostradamnit avatar pen-y-fan avatar ybakos avatar ythirion avatar

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.