Test-Driven-Development and Pairing

tdd.jpg

I usually read stuff on/around the internet and in the last months I started reading articles/posts from Medium. It is a great platform to read/write because yo can forget the site style/look and focus on the most important bits. There are a lot of articles about everything; I was reading about TDD and Pair Programming. These are my comments:

The idea is write test before you write code and work with a pairing partner. Some people (like me) think it will reduce the capacity for complete tasks. Additional problems can be little differences between production and local environment, so you can develop a fix in your local but you do not have the certain if the fix will run correctly in production.

When you start to work in TDD, you first write the test, then you can continue to write the implementation. The tests will probably fail when you start writing the implementation, but as you keep writing code, tests will start to pass. When all tests are green, you’ve completed the task. Working in this way let the developers consider possible failure scenarios: the developers have enough context about the requirements. Yep, that sounds good.

Now let’s talk about Pair Programming.

There can be two roles:

  • Driver, the guy who is at the keyboard and types in the editor.
  • Navigator, the guy who guides the driver. Telling what files need to be edited, where they are, etc.Driver, the guy who is at the keyboard and types in the editor.

Noup, it is teamwork. Do not think all the work is done by one guy and the other one is just thinking. They need to work together as a team. Imagine two sets of eyes on the code in your project. It can reduce the probability of errors. All of us usually talk with other developers and we explain our implementation to them. With Pair Programming we can find some issues more easily and fix them right away.

Do not forget the other testing tools. You can do a great developing job doing Pair Programming but it is necessary to complement it executing tests.

Mmmmmm, I think Pair Programming can reduce the on-boarding time for the new developers in our team.

This post was written in order to improve my reading/writing English skills I usually find different articles and I try to write something about it.