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. This repo was forked from https://github.com/emilybache/Theatrical-Players-Refactoring-Kata
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.
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.
Thank you to Martin Fowler for kindly giving permission to use his code. Thank you to Emily Bache for creation of this kata.
In the following steps one from the group will fork the repo, add collaborators, each of you clone the forked repo and you can start the Kata in common Mob session!
Fork this repository by clicking on the fork button on the top of this page. This will create a copy of this repository in your account.
Go to your GitHub account, open the forked repository, click on the Settings mentu item, click on the Manage access and then click the Invite a collaborator button. Add all the software craftsmen, who will collaborate on the Kata with you.
Clone the forked repository to your machine.
- Go to the GitHub account with the forked repository, open the forked repository, click on the code button and then click the copy to clipboard icon.
- Open a terminal and run the following git command: git clone "url you just copied", where "url you just copied" (without the quotation marks) is the url to this repository (your fork of this project).
For example:
git clone https://github.com/this-is-you/first-contributions.git
- New driver pulls all the previous changes and start sharing his screen
- You enjoy the mobbing
- When limit is done, the last commit is created
- All commits are pushed to the common repository
- Drivers are switched and new driver starts with the point 1 (pull + sharing his screen)
- get feedback on your code -> just create a Pull Request (or send a link to your public repo with all the changes) and contact us
- get feedback on format of the session -> just contact us and describe, how we can help you
Contact info:
- Milan Schwarz -> [email protected]
- Radim Göth -> [email protected]
- Tomáš Líška -> [email protected]
- Do as small as possible commits, so you can easily revert the changes if you go a wrong way anytime
- Switch Driver regularly
- I recommend to start with 7 minutes for switch a Driver (and experiment with that during the next session)
- Experiment with navigators (e.g. just one can navigate or everybody navigates)
- Have a fun and learn something new from others!