Showing posts with label ThoughtWorks. Show all posts
Showing posts with label ThoughtWorks. Show all posts

Saturday, 17 March 2012

TDD - All the time

Test Driven Development (TDD) is one of the best practices that extreme programming (Xp) suggests. As defined by Wikipedia, TDD is a software development process, in which a developer writes a failing test case, that defines a new improvement, or new functionality, then produce the code to pass that test and finally refactors it to acceptable standards.

Having said that, the series of questions I hear from people who are introduced to TDD are, "Is it really important to write tests in first place? I know the functionality. Why can't I just sit down and start coding. What do I gain by writing tests first? The whole idea of TDD is completely counter intuitive. Of course I understand the importance of tests. But I can add them later." Very valid questions. There are two simple reasons why I think TDD helps in development.

First thing - TDD is a very intuitive process. Whenever we write a piece of code everyone of us know, what will be the output of the code given an input. We keep simulating that in our brain. Nobody starts coding without a problem statement in mind. Everybody knows what is expected out of the code at every point I'm time. And we validate it with sample input every time. This, exactly, is the idea behind TDD. Set the expectation for the code you write. Implement it. Validate it. Isn't TDD a intuitive process?

I believe in the philosophy of 'Self Documenting Code', code that explains itself without the need for extra documents. The testcases are a very useful add-on to this philosophy. In addition to validating the code, it also captures the intent behind writing a particular code, which comes handy later in the life-cycle of a project, either while debugging or while revisiting a functionality.

Saturday, 4 June 2011

The road to ThoughtWorks

One fine evening in the first month of my final year in college, we got an information from my placement officer that a company called ThoughtWorks (TW) is visiting our campus. None of us got the name right in first place. He spelled it out for us and we googled to find out more about TW. The day before TW was supposed to come to my college, I received a call from one of my lecturers. He asked all the placement reps (I was one of them) to come early that day. I had no clue as to why he called for a meeting but still, being an early bird I showed up early, while none of the others turned up.

The first round of placement was just over, by that time, and there were still some students left in my department who were not placed yet. He started off with asking me the stats and then went on to blast me for not taking any step towards getting those students placed. I tried to explain him on whats going on, but I stopped responding when i realized that he was not ready to listen and started comparing us with the rest of the placement reps in other departments. I was super pissed off. He went on for more than two hours and then calmed down and wished me good luck for ThoughtWorks. I left the room with no motivation to do anything.

In the afternoon we went to attend the pre placement talk, just for the sake of attending it. Initially I was thinking that its gonna be yet another ppt. But i was proved wrong. It was amazing I should say. They took us through the everyday life of an TWer and i was pretty impressed. I was all excited about getting this company. Then came a slide in the presentation that listed the languages and platforms TW works with.  I have written Java programs (as simple as to find the inet address of the machine) in the networking lab. That is all the Java knowledge I had. I've heard of .Net, but didn't have a clue about what Ruby and Perl are about. The question "Will I make it?" was lingering in my mind, but still I wanted to give it a try.

The first round was logical. But the kind of questions were different and interesting. I enjoyed solving those and successfully cleared that. Then came the pairing round. We were given two problem statements. We had to provide a solution to the problem of our choice in the language of our preference. That was really simple for me. I chose a problem that I understood and decided to code it in C, since it was the only language that I was comfortable with at that time. I had no other choice. The most impressive thing about this round was the freedom that we were given to refer to any book of our choice and use internet. Never heard about anything of that sort in any of the recruitment process. While we were coding, people from TW were pairing with us, helping us and assessing us in the mean time. The coding round was over and then came the interview.

The interview started with my self introduction, the only thing that we've been rehearsing for the last one year in all of the pre placement trainings. The interview went on for about 45 mins. After that we were anxiously waiting for the recruitment team to comeback with the results. They called me in first. I walked in thinking that all the rounds were over and getting the offer was the only thing left. Well. Not so soon. I had a wonderlic test to clear. I didn't know how the twelve minutes passed. But in the end it was all for good. I cleared it and received the offer and a bunch of goodies from ThoughtWorks. I was all smiles when I came out, so nobody had to ask me if I was placed. That was the moment I cherished.

It's been three years now, since I joined ThoughtWorks. But this experience has been refreshing and brings me goosebumps every time I think about it.