Red Pencil Code Kata

March 4, 2011 at 3:54 pm 7 comments

At one of my clients I have seen a real feature request being used as a Code Kata. I found the feature description very interesting and created a Code Kata description from it:

Red Pencil Code Kata

We provide a shopping portal, where dealers can offer their goods (similiar to Amazon market place). We want to support red pencil promotions for reduced prices. During the red pencil promotion the old price is crossed out in red and the new reduced price is written next to it.
To avoid misuse of red pencil promotions the red pencil promotions are activated and deactivated automatically.
The scope of the Code Kata is the implementations of the rules for activation and end of red pencil promotions.
  • A red pencil promotion starts due to a price reduction. The price has to be reduced by at least 5% but at most bei 30% and the previous price had to be stable for at least 30 days.
  • A red pencil promotion lasts 30 days as the maximum length.
  • If the price is further reduced during the red pencil promotion the promotion will not be prolonged by that reduction.
  • If the price is increased during the red pencil promotion the promotion will be ended immediately.
  • If the price if reduced during the red pencil promotion so that the overall reduction is more than 30% with regard to the original price, the promotion is ended immediately.
  • After a red pencil promotion is ended additional red pencil promotions may follow – as long as the start condition is valid: the price was stable for 30 days and these 30 days don’t intersect with a previous red pencil promotion.

Entry filed under: it-agile-blog-planet. Tags: .

Test-Mnenomics und Testing-Dojos Interview zur Architektur in Scrum

7 Comments Add your own

  • 1. Bernd Schiffer  |  May 19, 2011 at 1:42 pm

    Nice kata, thank you!

    What’s the reason behind “The price has to be reduced by … at most bei 30%”? Why’s a price reduced by more than 30% not worth a red pencil label?

  • 2. stefanroock  |  May 19, 2011 at 6:32 pm

    Because unserious behaviour of the seller is assumed, maybe even fraud.

  • 3. Bernd Schiffer  |  May 20, 2011 at 9:06 am

    Re: 2.
    Ah, I see. Sounds like patronization to me, but anyhow, I see the point.

  • 4. Bernd Schiffer  |  May 20, 2011 at 9:09 am

    I can’t report any experience yet about executing this exercise as a kata. But we did the exercise now once within a coding dojo with four participants. The exercise was fun and source for lots of discussions afterwards. We found plenty of different objects within this exercise, and at least the start was quite smooth.

  • […] recently trained the Code Kata: Red Pencil Promotion introduced by Stefan Roock in 2011. We had two different approaches between the pairs. One took the whole story to implement what the […]

  • 7. Ardalis - JavaScript Date Tips  |  July 18, 2014 at 7:33 pm

    […] Software Craftsmanship meeting at the Falafel Software training center in Hudson, Ohio, I did the Red Pencil Kata using JavaScript.  Although I’ve run into it in the past, I was stuck for a little while […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

%d bloggers like this: