Tuesday, May 31, 2016

Kata: Ohce in Java

Yesterday I facilitated the Ohce kata in a Barcelona Software Craftsmanship event.

Since I was facilitating, I didn't have the opportunity to write any code.

So, when I got home, I did the kata in Java using outside-in TDD and jMock.

I committed after each passing test and each tiny refactoring, so that you can follow the process if you feel like. You can check the commits step by step here.

You can find the resulting code in this GitHub repository.

Thanks to all the attendees and to Magento Barcelona for kindly having us once more.

Update:

I improved the design in this new version of the code:

Monday, May 30, 2016

Sunday, May 29, 2016

Kata: Bank Account in Java (recorded)

I've recorded myself using outside-in TDD to code the Printing Account Statement subset of the Bank Account kata in Java using jMock, in order to be able to later watch me and detect problems to correct.

This is the recording of what I did: If you decide to watch it, please do it at 2x speed (I still write slowly).

These are the commits after each green and every refactoring step.

You can see the code in this GitHub repository.

I recently did another version of this kata.

Wednesday, May 25, 2016

Kata: Revisiting the Bank Account in Java

I did again the Printing Account Statement subset of the Bank Account kata in Java using jMock.

This time, I managed to do it using outside-in TDD without big problems, (see the problems I had the first time).

The only thing I didn't like was that some steps felt too big.

This time I committed after each green and each refactoring steps. Check the commits here.

I think I'm starting to see how this goes.

You can find the resulting code in this GitHub repository.

Friday, May 20, 2016

Kata: Brownish Greenfield Gilded Rose in Java (recorded)

I've recorded myself using TDD to code the Brownish Greenfield Gilded Rose kata in order to be able to later watch me and detect problems to correct.

This is the recording of what I did: If you decide to watch it, please do it at 2x speed (I still write slowly).

These are the commits after each green and every refactoring step.

You can see the code in this GitHub repository.

I also did this kata in JavaScript last week.

Wednesday, May 18, 2016

The Ohce kata, a short and simple exercise to practice outside-in TDD using test doubles

I created this short and simple kata to practice outside-in TDD using test doubles for the mentoring Álvaro and I are doing in Magento Barcelona:

I hope you enjoy doing it.

Tuesday, May 10, 2016

Kata: Brownish Greenfield Gilded Rose in JavaScript

I did the Brownish Greenfield Gilded Rose kata in JavaScript.

I started working on it with Jordi Masramon at the last Software Craftsmanship Barcelona event. Today I did it again from scratch.

In this variant of the Gilded Rose kata you use TDD but you're "forced" to use Item which you can't modify or inherit from.

To avoid having to put up with Item limitations, I used the Adapter pattern.

I also used the Decorator pattern for the Conjured items.

However, their implementations can seem a bit peculiar because I didn't use inheritance. I just used closures and function composition.

If you're interested in the process, check the commits (I committed after each green and each refactoring step).

You can check all the code I've done so far in this GitHub repository.

Monday, May 2, 2016

Interesting Talk: "Trucos para que tu código no aparezca en los Papeles de Pánama"

I've just watched this wonderful talk by Miguel Ángel

Kata: Yatzy Round 1 in Java

I did the first round of the Yatzi kata in Java using jMock.

As I tell in the README, I used "a funny way to explore design having strict mocks in place". Even though it's not very orthodox, it's working fine for me because it helps me to avoid accidentally creating obstacles to refactor.

If I have some time, I'll explain it in a future post. If you're curious about it, check the commits to see its mechanics (I committed after each green and each refactoring step).

You can check all the code in this GitHub repository.