mobile menu icon

The Crazy Portfolio kata, a short kata to practice breaking dependencies, testing and refactoring legacy code

Published by Manuel Rivero on 21/03/2024

Katas, Learning, Community, Legacy Code, Refactoring, Testing


We created this short legacy code kata to practice dependency breaking, testing and refactoring techniques. It’s called the Crazy Portfolio kata.

It is part of a legacy code course that we are launching next month. We’re currently working on this kata on the deliberate practice sessions we are doing with Audiense’s developers.

The kata has many things to make legacy-code lovers happy: side effects, nasty nested conditionals, no documentation, lots of duplication, dead code and interesting boundary conditions.

This is the TypeScript’s code to whet your appetite:

The Crazy Portfolio Legacy kata can be used to practice techniques, such as, dependency breaking, characterization testing, structural testing, approval testing, mutation testing and, of course, refactoring.

You can find the whole code in this repository: Crazy Portfolio kata. Soon, we’ll add versions for other languages. Pull requests are more than welcome.

I hope you enjoy solving it.

Acknowledgements

I’d like to thank Fran Reyes for facilitating this kata with me.

Also thanks to Audiense’s developers for being the beta testers of this kata. It is always a pleasure to work with you.

Finally, I’d also like to thank Josue Miranda for the photo.

Volver a posts