Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Karumi Dojo - Kata Roman Numerals

Karumi
June 12, 2016
74

Karumi Dojo - Kata Roman Numerals

Slides used during the Karumi Dojo Kata Roman Numerals.

Karumi

June 12, 2016
Tweet

Transcript

  1. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Karumi Dojo Pedro Vicente Gómez Sánchez Android Expert at Karumi [email protected] @pedro_g_s github.com/pedrovgs
  2. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Irene Herranz Managing Director Alberto Gragera Technical Director Jorge Barroso Android Expert Davide Mendolia Full Stack Engineer
  3. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Karumi Dojo • We are here to practice and learn. • This is a bullshit free environment. • This exercise meant to be collaborative, not competitive. • Try to open your mind to new concepts.
  4. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Karumi Dojo • We are here to practice Test-Driven Development. • TDD is a software development process, not a dogma. • We are going to practice pair programming. • Keep always in mind the TDD Cycle.
  5. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Rules: • Write enough test code so that to get a single test failure. • Write enough production code to get all your tests to pass. • Refactor until the code is Simple/Clean.
  6. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Rules: The TDD Cycle RED GREEN REFACTO R 3. Simplify and clean your code. 1. Write a failing test. 2. Make the code work.
  7. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Roman Numerals The Romans wrote numbers using letters - I, V, X, L, C, D, M. The Kata says you should write a function to convert from normal numbers to Roman Numerals: eg 1 --> I 10 --> X 7 --> VII For a full description of how it works, take a look at http://www.novaroma.org/via_romana/numbers. html. * There is no need to be able to convert numbers larger than 3000.
  8. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Tips • Baby steps. • Don’t lose the green. • Choose the language you prefer. • Refactor your code. • Build errors are not failing tests. • Follow the TDD Cycle.
  9. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Roman Numerals bonus: • Write a function to convert in the other direction, ie numeral to digit. Eg: I --> 1 X -> 10 VII --> 7
  10. Pedro V. Gómez Sánchez - [email protected] - @pedro_g_s - github.com/pedrovgs

    Contract testing • Contract tests check if the contract defined by a interface is implemented properly. • Using inheritance we are going to create a base test cases which every implementation has to execute. • Take two different sorting algorithms and apply this technique.