Skip to content

mattjones753/simple-clean-code-kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-clean-code-kata

A kata for cleaning up some 'unclean' code

The exercise

The focus of the exercise is the ProductPriceCalculator class. Its job is to calculate the price of a product for a given user. Each product has a name and a price and a name. If a user is an employee they get 5% discount on all products. The ProductDAO is essentially a mock database for product information, the UserDAO

Things to look for

In order to clean up the code, you should look for the following things

  • poor naming
  • repeated code blocks
  • nested conditional blocks
  • nested loops
  • unexpected side effects
  • superfluous comments
  • misleading comments
  • 'magic' numbers
  • poor segregation of responsibilities

Tests

A test is provided that ensures the expected behaviour of the application remains in place. If you would prefer you can start by implementing this test from scratch, something would probably need to do in a real life scenario.

About

A kata for cleaning up some legacy code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages