KEMBAR78
Kata String Calculator | PDF
Software
Craftsmanship
Alicante
Software
Craftsmanship
Alicante
Who we are
What we like
Why do we care?
You are a software developer
You like agile, programming
Make community. Join us!
Software
Craftsmanship
Alicante
Meetup http://meetup.com/Software-Craftsmanship-Alicante/
Twitter @AlicanteSwCraft
Slack http://softwarecraftsmanship.slack.com/messages/alicante/
Slides http://slideshare.net/AlicanteSwCraft
Github https://github.com/alicanteswcraft
Enrique Barbeito García
@enriquebarbeito
Kata String Calculator
Practicing TDD
Software
Craftsmanship
Alicante
@enriquebarbeito
Test-Driven Development in a nutshell
Software Craftsmanship Alicante
Test-Driven Development in a nutshell (1/2)
Code Katas
Kata String Calculator
Show me the code
Key concepts
❏ XP practice stated in 2003.
❏ TDD = TFD + Refactoring
❏ TDD != testing, so it is most about software design
❏ Does not replace architecture or design
❏ It is also a development process with a repetitive cycle.
Repeat with me: red-green-refactor! All-Code-Is-Guilty.jpg
@enriquebarbeito
Test-Driven Development in a nutshell
Software Craftsmanship Alicante
Test-Driven Development in a nutshell (2/2)
Code Katas
Kata String Calculator
Show me the code
Key rules when doing TDD
❏ Ensure isolated specs
❏ Arrange. Act. Assert
❏ One verification per test/spec
❏ Write only one spec at a time
❏ Do not lose the green during a refactor step
❏ No debugging (neither output logging) TDD cycle
@enriquebarbeito
Code Katas
Software Craftsmanship Alicante
Test-Driven Development in a nutshell
Code Katas
Kata String Calculator
Show me the code
❏ Code exercise which helps you to hone your skills
through practice and repetition
❏ Simple problem, easy to practice, every day
❏ Experiment with solutions
❏ Focus on
❏ the process of writing the code
❏ naming test cases
❏ the red-green-refactor cyclekata.gif
@enriquebarbeito
Kata String Calculator
Software Craftsmanship Alicante
Test-Driven Development in a nutshell
Code Katas
Kata String Calculator
Show me the code
int Add(string numbers)
❏ The method can take 0, 1 or 2 numbers, and will return their sum (for an empty
string it will return 0) for example "" or "1" or "1,2"
❏ Allow the Add method to handle an unknown amount of numbers
❏ Allow the Add method to handle new lines between numbers (instead of commas).
❏ Support different delimiters.
❏ Calling Add with a negative number will throw an exception.
@enriquebarbeito
Show me the code
Software Craftsmanship Alicante
Test-Driven Development in a nutshell
Code Katas
Kata String Calculator
Show me the code
Demo
Enrique Barbeito García
@enriquebarbeito
FIN. Thanks!
Questions?
@AlicanteSwCraft
Please, follow!
Please, Join us!

Kata String Calculator

  • 1.
  • 2.
    Software Craftsmanship Alicante Who we are Whatwe like Why do we care? You are a software developer You like agile, programming Make community. Join us!
  • 3.
    Software Craftsmanship Alicante Meetup http://meetup.com/Software-Craftsmanship-Alicante/ Twitter @AlicanteSwCraft Slackhttp://softwarecraftsmanship.slack.com/messages/alicante/ Slides http://slideshare.net/AlicanteSwCraft Github https://github.com/alicanteswcraft
  • 4.
    Enrique Barbeito García @enriquebarbeito KataString Calculator Practicing TDD Software Craftsmanship Alicante
  • 5.
    @enriquebarbeito Test-Driven Development ina nutshell Software Craftsmanship Alicante Test-Driven Development in a nutshell (1/2) Code Katas Kata String Calculator Show me the code Key concepts ❏ XP practice stated in 2003. ❏ TDD = TFD + Refactoring ❏ TDD != testing, so it is most about software design ❏ Does not replace architecture or design ❏ It is also a development process with a repetitive cycle. Repeat with me: red-green-refactor! All-Code-Is-Guilty.jpg
  • 6.
    @enriquebarbeito Test-Driven Development ina nutshell Software Craftsmanship Alicante Test-Driven Development in a nutshell (2/2) Code Katas Kata String Calculator Show me the code Key rules when doing TDD ❏ Ensure isolated specs ❏ Arrange. Act. Assert ❏ One verification per test/spec ❏ Write only one spec at a time ❏ Do not lose the green during a refactor step ❏ No debugging (neither output logging) TDD cycle
  • 7.
    @enriquebarbeito Code Katas Software CraftsmanshipAlicante Test-Driven Development in a nutshell Code Katas Kata String Calculator Show me the code ❏ Code exercise which helps you to hone your skills through practice and repetition ❏ Simple problem, easy to practice, every day ❏ Experiment with solutions ❏ Focus on ❏ the process of writing the code ❏ naming test cases ❏ the red-green-refactor cyclekata.gif
  • 8.
    @enriquebarbeito Kata String Calculator SoftwareCraftsmanship Alicante Test-Driven Development in a nutshell Code Katas Kata String Calculator Show me the code int Add(string numbers) ❏ The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example "" or "1" or "1,2" ❏ Allow the Add method to handle an unknown amount of numbers ❏ Allow the Add method to handle new lines between numbers (instead of commas). ❏ Support different delimiters. ❏ Calling Add with a negative number will throw an exception.
  • 9.
    @enriquebarbeito Show me thecode Software Craftsmanship Alicante Test-Driven Development in a nutshell Code Katas Kata String Calculator Show me the code Demo
  • 10.
    Enrique Barbeito García @enriquebarbeito FIN.Thanks! Questions? @AlicanteSwCraft Please, follow! Please, Join us!