programmingkatas

21
programming Katas

Upload: gabriele-lana

Post on 15-Jan-2015

2.003 views

Category:

Technology


0 download

DESCRIPTION

Programming Kata is a practice to improve your programming skills through something called "deep practice"

TRANSCRIPT

Page 1: ProgrammingKatas

programming

Katas

Page 2: ProgrammingKatas

“IfI would

have had

time...”

Page 3: ProgrammingKatas

“You will never

have time!

Page 4: ProgrammingKatas

you canbe faster

Page 5: ProgrammingKatas
Page 6: ProgrammingKatas

Practicemakes YOU

better...

Page 7: ProgrammingKatas

deepPractice

makes YOU...

Page 8: ProgrammingKatas

perfect

Page 9: ProgrammingKatas

Should be

challenging

the kaizenway

Page 10: ProgrammingKatas

Should be

REpeatedmany times

Page 11: ProgrammingKatas

Should receive

feedback(be the best,

be the worst)

Page 12: ProgrammingKatas

perfect

Page 13: ProgrammingKatas

Stringcalculator

Kata

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 14: ProgrammingKatas

1. Create a simple String calculator with a method Add(string numbers).• can take an unknown amount of numbers separated by a comma, and will return their sum• for an empty string it will return 0• for “1” it will return 1• for “1,2” it will return 3• for “5,7,10,3” it will return 25

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 15: ProgrammingKatas

2. Allow the Add method to handle new lines between numbers (instead of commas).• for “1\n2,3” it will return 6• make sure you only test for correct inputs. There is no need to test for invalid inputs for these katas

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 16: ProgrammingKatas

3. Allow the Add method to handle a different delimiter.• the beginning of the string can contain a separate line that looks like this“//[delimiter]\n[numbers…]”• for “//;\n1;2” it will return 3• for “//;\n1;2\n3;1” it will return 7

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 17: ProgrammingKatas

4. Delimiters can be of any length with the following format “//[delimiter]\n”.• for “//***\n1***2***3\n2***2” it will return 10

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 18: ProgrammingKatas

5. Calling Add with a negative number will throw an exception “negatives not allowed” - and the negative that was passed.• if there are multiple negatives, show all of them in the exception message

Original kata by Roy Osherove from http://osherove.com/tdd-kata-1

Page 19: ProgrammingKatas
Page 20: ProgrammingKatas

MOREKatas

onhttp://katas.softwarecraftsmanship.org/

Page 21: ProgrammingKatas

Questions?