stephane-genicot.github.io

Software Development Books

Alt text Alt text Alt text Alt text Alt text

About this Kata

This short and simple Kata should be performed using Test Driven Development (TDD).

There is a series of books about software development that have been read by a lot of developers who want to improve their development skills. Let’s say an editor, in a gesture of immense generosity to mankind (and to increase sales as well), is willing to set up a pricing model where you can get discounts when you buy these books. The available books are :

  1. Clean Code (Robert Martin, 2008)
  2. The Clean Coder (Robert Martin, 2011)
  3. Clean Architecture (Robert Martin, 2017)
  4. Test Driven Development by Example (Kent Beck, 2003)
  5. Working Effectively With Legacy Code (Michael C. Feathers, 2004)

Rules

The rules are described below :

One copy of the five books costs 50 EUR.

Developers seeking to deliver quality products are queueing up with shopping baskets overflowing with these books. Your mission is to write a piece of code to calculate the price of any conceivable shopping basket.

For example, how much does this basket of books cost?

Answer :

(4 * 50 EUR) - 20% [first book, second book, third book, fourth book]

(4 * 50 EUR) - 20% [first book, second book, third book, fifth book]

= 160 EUR + 160 EUR

= 320 EUR (knowledge is priceless but has a cost)

Clean Code - TDD : click here

IMPORTANT: Implement the requirements focusing on writing the best code you can produce.