Archive

Archive for the ‘Technical’ Category

JavaScript as a First Class Language

December 8th, 2011

A couple of weeks ago I presented at the internal ThoughtWorks conference called XConf about how we have been treating JavaScript as a First Class Language recently on our current project. What it means to us is:

  • Modularise JS code (JAWR helps)
  • Unit test it. (we use Jasmine and JSTestDriver)
  • Static analysis, “checkstyle for JS”. (we use JSHint)
  • JS Dependency Injection to facilitate testing

Here are the slides with more info and some code samples.

Technical ,

ThoughtWorks Brazil in João Pessoa

October 25th, 2011

I am extremely excited about the fact that ThoughtWorks is organising a Boot Camp Recruitment Event in João Pessoa this month. I was born in João Pessoa and it is also where I lived while I was at university UFPB Federal University of Paraiba.

I have been working for ThoughtWorks for the last 4 years and would totally recommend it to all my friends. So, if you are a passionate IT person in João Pessoa go check it out.

tw-brazil-joaopessoa

And, if one day, potentially, hypothetically, eventually ThoughtWorks decides to open an office in João Pessoa… And if you work for ThoughtWorks in any other offices all over the world… and you decided to transfer there, here’s what you would find… I love this city… I’m just saying… :)

joao pessoa

Photos from

www.pbase.com/alexuchoa/joao_pessoa

http://about.me/arthurlucena

Technical

TW SSC - Deep Sea Fishing

October 19th, 2011

Last Sunday (16/Oct) we went on a deep sea fishing trip as part of the SSC – Sydney Social Club, an ThoughtWorks initiative to help people have fun together…

TW_SSC_Deep_Sea_Fishing-162-Edit-Edit

Camila caught the first fish on the boat… A tiny little one, but really cute, like her Smile

TW_SSC_Deep_Sea_Fishing-59

Right after that I started feeling seasick and I threw up 6 times… It was a horrible experience. I had taken a ginger seasickness tablet, apparently, it doesn’t work. When we came back to the harbour I felt much better.

TW_SSC_Deep_Sea_Fishing-84

And that was when we had a lot of fun cooking some bbq and also the fish that we caught.

TW_SSC_Deep_Sea_Fishing-153

And we had delicious food…

TW_SSC_Deep_Sea_Fishing-171

Technical

Gource–The history of a codebase

September 4th, 2011

Codebase history generated using Gource.

Technical ,

Testing Ajax with WebDriver – Make your tests deterministic

August 24th, 2011

We had some non-deterministic tests on our project so we decided to implement a generic way to test ajax calls using webdriver. I was quite impressed with how quickly we achieved this, mainly due to the fact that javascript is dynamic and functional. And also thanks to my js learning sessions with Romain, who is also responsible for a great majority of the js code below :)

Here’s the code, split into well defined components as we’ve been treating javascript as a first class language. It has also been unit tested, but I’ll save that for another post.

Http

A wrapper around jquery ajax

var Async = Async || {};
Async.Http = function() {

    function get(url, data, successHandler, errorHandler) {
        $.ajax({
            url: url,
            data: data,
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            async: false,
            success: successHandler,
            error: errorHandler
        });
    }

    function post(url, data, successHandler, errorHandler) {
        $.ajax({
            type: 'POST',
            url: url,
            data: JSON.stringify(data),
            dataType: 'json',
            contentType: 'application/json; charset=utf-8',
            success: successHandler,
            error: errorHandler
        });
    }

    return {
        get: get,
        post: post
    };

};

Notifier

A stateful js component that keeps track of all the ajax calls and adds a div to the dom with that information.

var Async = Async || {};
Async.Notifier = function() {

    var $notifierElement = $('<div id="asyncNotifier" class="done">');
    $('body').append($notifierElement);    

    var inProgress = 0;

    function start() {
        ++inProgress;
        $notifierElement.removeClass('done');
    }

    function finished() {
        --inProgress;
        if (inProgress === 0) {
            $notifierElement.addClass('done');
        }
    }

    return {
        start: start,
        finished: finished
    };

};

HttpAsyncDecorated

A decorated version of Async.Http that uses Notifier.

var Async = Async || {};
Async.HttpAsyncDecorated = function(http, asyncNotifier) {

    function decorateWithFinish(handler) {
        return function(data, textStatus, jqXHR) {
            handler(data, textStatus, jqXHR);
            asyncNotifier.finished();
        };
    }

    function get(url, data, successHandler, errorHandler) {
        asyncNotifier.start();
        http.get(url, data, decorateWithFinish(successHandler), decorateWithFinish(errorHandler));
    }

    function post(url, data, successHandler, errorHandler) {
        asyncNotifier.start();
        http.post(url, data, decorateWithFinish(successHandler), decorateWithFinish(errorHandler));
    }

    return {
        get: get,
        post: post
    };

};

JS App Context (Wiring things together)

Here’s the js code that glues everything together… Like a “javascript app context”.

var MyAppMain = MyAppMain || {};
MyAppMain.Context = function() {
    function startup() {
        var http = Async.HttpAsyncDecorated(Async.Http(), Async.Notifier());
	MyApp.SomethingThatUsesAjaxHttp(http);
    }

    return {
        startup: startup
    };
};

WebDriver

And finally we need to use webdriver to wait for the div with the class asyncNotifier. We used WebDriverWait for that.

public static void waitForAsyncCallsToFinish(WebDriver driver)
{
	waitForCssClass(driver, By.id("asyncNotifier"), "done");
}

Technical ,

ThoughtWorks Poker Night

August 19th, 2011

As part of the Sydney Social Club we had a Poker Night in the ThoughtWorks Sydney Office.

We had so much fun… There was not really much money involved, everyone chipped only $5 just to make things a bit more exciting.

poker_night_thoughtworks_social_club-68

poker_night_thoughtworks_social_club-41

Enif, Leo’s partner, was the winner of the night.

poker_night_thoughtworks_social_club-14

poker_night_thoughtworks_social_club-97

We had hilarious all in’s, like this one with almost nothing

poker_night_thoughtworks_social_club-95

poker_night_thoughtworks_social_club-79

Technical

Agile Australia 2011

June 19th, 2011

The so waited conference Agile Australia 2011 happened in Sydney last week. 2 days of overwhelming presentations talking about this software development philosophy that is celebrating its 10 years since its manifesto.

Agile is a means to an end

I felt like the message of the conference was that it’s not about being Agile, it’s about being BETTER. ThoughtWorks logo Get it DONE was aligned with this message.

agile australia 2011-14

Unfortunately many organizations are missing the point of the original reason why Agile was created. Some of them have strategies towards becoming agile, they even have the percentage of how much agile they’re aiming to be… And I wonder how can that be measured? And what problem they are trying to solve when being agile.

I hope the conference was a wake-up call as this topic was extremely discussed and I hope that people understand that agile is a philosophy, not a religion (as some pointed out) that ultimately helps teams achieve success and productivity.

Agile is not a religion, it's a filosophy

Agile is not a religion

Lean Lego Game

Francisco and I ran a introductory workshop for Lean called Lean Lego Game. We had a lot of fun. The workshop had 24 seats and almost 50 people showed up.

Agile_Australia_2011_Lean_Lego_Game-53

Agile_Australia_2011_Lean_Lego_Game-56

Agile_Australia_2011_Lean_Lego_Game-40

 

Mingling

I had the opportunity to chat with some colleagues from ThoughtWorks, previous projects and also to meet new people with similar interests Smile

agile australia 2011-139

Continuous Delivery

Continuous Delivery was another big topic at the conference. It seems like this is one of the next logical steps towards becoming a highly productive team. Having the power to decide when and what features should go to production is the dream of every business person who has been locked by IT constraints and unnecessary bureaucracy.

agile australia 2011-26

Fowler brings us back to the roots of Agile

The end of the conference was triumphal with Martin Fowler doing his Uncle Bob impersonation and also reminding us all of what Agile is all about. I really enjoyed watching his presentations about Non-Determinism in Tests and Technical Debt, a topic about which I am quite passionate too.

 

More photos can be found here and here.

Technical

Lean Lego Game at Agile Australia 2011

May 17th, 2011

I’m very happy and excited that I’ll present the Lean Lego Game at the Agile Australia 2011 with Frank. The game was created by Danilo and Frank who have presented it at several conferences all over the world.

1 month to go and looking forward to it… Smile

lean-lego-game-agile-australia-blog

Technical , ,

ClearCase Merge Excuse for Slacking Off

March 3rd, 2011

If you have ever worked with ClearCase, you will understand this “adapted” version of the classic XKCD joke for programmers excuse for slacking off.

Technical , ,

Is your stand-up meeting boring? Try the “Walk the Wall” Stand-Up

February 28th, 2011

Stand-up Meetings are a simple, yet effective, way of getting teams to communicate, commit to short term goals and solve problems. There is a proposed format for stand-up meetings which suggests that each team member should provide answers to the following three questions:

  • What did you do yesterday?
  • What will you do today?
  • Are there any impediments in your way?

Have you ever done that and eventually it turned out to get pretty booooooring? I have… Countless times…

Yesterday/Today Stand-Up Meeting (Traditional Proposed Format)

The Yesterday/Today format is a good way to start with, do not get me wrong. I think it’s very important for teams that are not used to communicating daily to start with that format. I just think that we should always look for improvements as opposed to just following a pre-determined format… Recently we have been trying something a little bit different and it turned out to be much more effective, I’ll explain why. Jason Marcotte coined the term as the Walk the Wall Stand-Up Meeting, I quite liked it.

Basically the sequence of the stand-up meeting is determined by our Story Wall. Each item on the wall gets discussed taking into account the 3 questions mentioned before. Martin Fowler reminds us on his post to “Focus on the Backlog” and this is what this new format is all about:

Walk the Wall Stand-Up Meeting

Here are some of the issues that we are addressing by doing the Walk the Wall Stand-Up.

Monologue/Soliloquy

During the Yesterday/Today Stand-Up we noticed that each team member ended up talking alone and in sequence, usually there were no discussions or quick Q&A. That defeats one of the main purposes of the stand-up, which is communicating. I found a word that describes what we were experiencing: Soliloquy.

Walking the wall allows more than one team member to talk about something, e.g.: explain what they were working on yesterday. It could be that they were actually pairing on that particular item and have similar things to say about it. It also allows people to talk to each other about a particular item (Story, Task or anything on the wall) that is relevant to the entire team. After implementing this we had developers/ba’s/testers talking more about a particular item.
But…
Keep an eye on the quiet members of your team… One of the good things about the Yesterday/Today stand-up is that everyone gets to say something, which empowers and therefore motivates them. The facilitator should perhaps ask direct questions sometimes.

Means to an End - Tasks/Achievements

The three questions above suggest that each member has to explain “what they did” as opposed to “what they achieved”. This leads people into explaining the “tasks” that they executed, as opposed to “goals” that they achieved. E.g.: “Yesterday I went to meeting A and I wrote document B and I paired with John on story D”. There’s a lot missing there:

  • What was achieved?
  • Do you need anything from anyone here in order to proceed?
  • Is this harder/easier than what you thought? Can someone else help?

We see those discussions happening when it’s focused on the stories. It is easier and more likely that someone will mention that “In order for me to finish Story A I need help from a BA” for example.

Facilitator

We also learnt that it helps to have a facilitator during the the stand-up just like we do with retrospectives.

Walk the Wall Stand-Up Meeting with Facilitator

But…

  • It is not a micro-management status update when the manager asks everyone what they are doing and how long it’s going to take so that he can update his Gantt Chart.
  • Rotate the facilitator
And always try to think outside of the box… Do not just follow recipes, be creative and invent your own ways of improving, mix and match and see what happens… :)

Technical , , ,