TDD and TCR. Okay… Testing.

I could talk to you about Kent Beck or I could just give you the link to his website.

Now you can see I chose the option B.

This week I listened to Kent talk about testing in a way I never heard before.

Test Driven Development

First, watched a conversation. In which I could hear two different points of view on TDD. Test Driven Development (TDD) consists in two steps:

  1. Write a unit test with the expected output, then
  2. Write the code

Very simple, right?

TDD is not for everyone. Some developers will find it really easy -that’s the case of Kent-, others won’t.

From Kent’s point of view Pro TDD:

Maybe I won’t know how to program something, but I’ll know how to test it…

I hope I’m not the only one, but sometimes I’d be coding, then stop and think “I have no idea how to solve this” or I just don’t know how to begin. TDD is really helpful in this situations, because after you write a test, at least you’ll know what are the inputs and outputs, and that’s a first step.

On the other hand, David Heinemeier talks about the struggles of TDD:

It’s unnatural to write a test first for each functionality.

I agree on this. I’ve done TDD a few times at school and… I forget. I would start with the correct flow: write test, code, test fails, code, test passes, repeat… Then, at some point I already programmed a bunch of functions and where are the tests? Well, I forgot to write them – or I pretend I did, but actually just got lazy -.

Test && commit || revert

Second, I listened to a podcast about Test && commit || revert (test and commit or revert, TCR). I’ll keep explaining using quotes. Not sorry.

If you can break it, then you have to be the one who fixes it.

 

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s