Skip to content

emilybache/attack-calculator-kata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Attack calculator kata

The goal of the Kata is to refactor some legacy code which is a little bit messy. In order to properly do the refactor, you will have to create unit tests, of course 😉. If you prefer, you can use the branch 'with_tests' and go straight to the refactoring.

The kata topic is inspired in Dungeons and Dragons role game. In that game, whenever a character tries to hurt another one, there's a dice roll and some calculations which take into account the attack and defense skills of the characters involved. As you can imagine, this is just an excuse to toy around with the code, so don't expect 100% fidelity between the game and the code.

Refactoring tips

In “Working Effectively with Legacy Code” Michael C. Feathers talks about “Extract and Override”. Also Roy Osherove talks about it in the book “Art of Unit Testing“. An alternative is "Peel" or "Slice" as described by Llewellyn Falco, for example in Using ApprovalTests in .Net 14 Peel and Slice.

Acknowledgements

This exercise was originally designed by Xavi Ametller.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 50.8%
  • Java 49.2%