<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Alexandre Martins' Blog</title>
	<atom:link href="http://blog.m.artins.net/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.m.artins.net</link>
	<description>On software &#38; technology</description>
	<pubDate>Tue, 08 Sep 2009 13:22:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Hamcrest: Improving Reducer Implementations</title>
		<link>http://blog.m.artins.net/hamcrest-improving-reducer-implementations/</link>
		<comments>http://blog.m.artins.net/hamcrest-improving-reducer-implementations/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:22:00 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=253</guid>
		<description><![CDATA[In the beginning of the year I posted about the ways you can use Hamcrest out of test code, together with hamcrest-collections. This combination allows us to write different kinds of matchers to select and reject items from lists, as well as applying map and reduce to them. After a while making use of them [...]]]></description>
			<content:encoded><![CDATA[<p>In the beginning of the year I posted about the ways you can use <a href="http://blog.m.artins.net/hamcrest-out-of-test-code">Hamcrest out of test code</a>, together with hamcrest-collections. This combination allows us to write different kinds of matchers to select and reject items from lists, as well as applying map and reduce to them. After a while making use of them on my current project, I wanted to share what I liked a lot, and what I didn&#8217;t like a lot. My friend <a href="http://lizdouglass.wordpress.com">Liz Douglass</a> has also written a <a href="http://lizdouglass.wordpress.com/2009/09/07/lists-maps-etc">post sharing our experience</a>, and I will just complement it a bit&#8230;</p>
<h2>What I Liked A Lot</h2>
<p>There&#8217;s no much to write here, as we all know that this combination is quite powerful when you&#8217;re looking for writing code that reads more like english language, making it much easier to express the intent of your code. Not to mention that we get rid of for loops everywhere in the codebase.</p>
<h2>What I Didn&#8217;t Liked A Lot</h2>
<p>One aspect I didn&#8217;t like since the beginning when implementing Reducers is that they are coupled to one specific type. It reduces a list of one type into a result of the same type. And from the <a href="http://en.wikipedia.org/wiki/MapReduce">Wikipedia definition of Map and Reduce</a>&#8230; </p>
<p><cite><br />
<strong>&#8220;Map&#8221; step:</strong> The master node takes the input, chops it up into smaller sub-problems, and distributes those to worker nodes.<br />
</cite></p>
<p><cite><br />
<strong>&#8220;Reduce&#8221; step:</strong> The master node then takes the answers to all the sub-problems and combines them in a way to get the output - the answer to the problem it was originally trying to solve.<br />
</cite></p>
<p>&#8230; we can see that it doesn&#8217;t mention that the result should be of the same type as the original one, after applying the reducer. And that&#8217;s exactly what I wanted to do instead. People said I was trying to combine both Map and Reduce into a single implementation. I kind of disagree with that, because the fact that I am reducing a list into a result of a different type, it doesn&#8217;t mean that I am transforming the original input (like multiplying each item in a list of integers by 2, before concatenating them). Confusing?</p>
<p>Let me try to explain it using an example. Given we have a list of integers&#8230;</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
List<Integer> list = Lists.create(1, 2, 3);
</pre>
<p>and that I want to concatenate these numbers into a string. With the current <a href="http://code.google.com/p/hamcrest-collections">hamcrest-collections</a> implementation, that would be possible doing something like&#8230;</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
Iterable<String> listOfStrings = FunctionMapper.map(list, new Function<Integer, String>() {
    public String apply(Integer number) {
        return String.valueOf(number);
    }
});

String result = Reduction.reduce(listOfStrings, new Reducer<String>() {
    public String apply(String first, String previous) {
        return first.concat("+").concat(previous);
    }
});

Assert.assertEquals("1+2+3", result);
</pre>
<p>It&#8217;s quite a lot of code just to concatenate a list of numbers! One day while pairing with <a href="http://watchitlater.com/blog">Tom Czarniecki</a>, we decided to reimplement the <a href="http://code.google.com/p/hamcrest-collections/source/browse/trunk/hamcrest-collections/src/org/hamcrestcollections/Reduction.java">Reduction</a> and <a href="http://code.google.com/p/hamcrest-collections/source/browse/trunk/hamcrest-collections/src/org/hamcrestcollections/Reducer.java">Reducer</a> classes, so that we could create more flexible and simple Reducer implementations, and of course writing almost half the lines of code.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
public interface Reducer<T, U> {
    U apply(T first, U previous);
}
</pre>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
public class Reduction {

    public static <T, U> U reduce(List<T> list, U initialValue, Reducer<T, U> reducer) {
        U currentValue = initialValue;
        for (T item : list) {
            currentValue = reducer.apply(item, currentValue);
        }
        return currentValue;
    }
}
</pre>
<p>To do the same number concatenation with this new implementation, is just a matter of defining a new Reducer, that concatenates them in a string.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
Assert.assertEquals("1+2+3", Reduction.reduce(list, "", new Reducer<Integer, String>() {
    public String apply(Integer first, String previous) {
        return previous.concat("+").concat(String.valueOf(first));
    }
}));
</pre>
<p>Much simpler!</p>
<h3>Advantages Of This New Implementation</h3>
<ol>
<li>Do I have to mention again that it&#8217;s much cleaner?</li>
<li>We use java.util.List instead of Iterable.</li>
<li>No exception is thrown if the list to reduce is empty. It just uses the initial value provided on the reducer implementation.</li>
<li>Flexibility to reduce a list into a result of any type.</li>
</ol>
<p>Hope you enjoy it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/hamcrest-improving-reducer-implementations/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wrong Communication In Distributed Teams</title>
		<link>http://blog.m.artins.net/wrong-communication-in-distributed-teams/</link>
		<comments>http://blog.m.artins.net/wrong-communication-in-distributed-teams/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 14:08:39 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Consulting]]></category>

		<category><![CDATA[Management]]></category>

		<category><![CDATA[Organizational Transformation]]></category>

		<category><![CDATA[Scrum]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=240</guid>
		<description><![CDATA[One of the big challenges faced by distributed teams is how to get over the communication gap created by the physical distances that separates them. We all know that communication, either verbal or non-verbal, is fundamental for any project to be delivered successfully. When a team is good at communicating, they cultivate a more effective [...]]]></description>
			<content:encoded><![CDATA[<p>One of the big challenges faced by distributed teams is how to get over the communication gap created by the physical distances that separates them. We all know that communication, either verbal or non-verbal, is fundamental for any project to be delivered successfully. When a team is good at communicating, they cultivate a more effective sense of collectivity and cooperation, having faster feedback, by sharing information (knowledge) and having valuable discussions.</p>
<p>But this is not quite the real world for distributed development teams. It’s much harder, not to say almost impossible, to know what exactly is happening on each other’s mind. What problems and technical challenges are they facing? What are they doing now? What points are they considering when designing a new feature? How important is for them to write tests? Are they following the project development standards?</p>
<h4>Blame the &#8220;Bandwidth Limited&#8221; Communication Tools!</h4>
<p><cite><br />
Software development teams, by the nature of their work, needs to discuss and assess different ideas to solve complex problems. And they are very difficult to communicate when using tools such as email or telephone, which on the book they call “bandwidth limited”. And those are exactly the ones available for most distributed teams. So face-to-face communication suits better for this kind of discussions, using the assistance of diagrams or sketches, not to mention the use of body language. This would give us immediate feedback, just by looking into the other person’s eyes, which communicate understanding.<br />
</cite><br />
<span style="font-size: smaller;"><em>* Extracted from <a href="http://tinyurl.com/kpoxmx">The Organization and Architecture of Innovation: Managing the Flow of Technology</a> (with some modifications).</em></span></p>
<p>And as you can&#8217;t always minimize distances to allow verbal communication, you have to look for other ways, and maximizing non-verbal communications is definitely a road to go down.</p>
<h2>Some Bad Outcomes</h2>
<h3>Poor Code Quality</h3>
<ul>
<li><strong>Code Duplication</strong> (<a href="http://www.c2.com/cgi/wiki?DuplicatedCode">see</a>)</li>
<p>It&#8217;s quite usual. For example, the guy wants to load a XML file as a String so that he can perform some assertions over the result. He will implements something like a <code>FileLoader</code> class. But what he doesn&#8217;t know is that another developer has already implemented a class with this behaviour.</p>
<li><strong>Reinventing the wheel</strong> (<a href="http://en.wikipedia.org/wiki/Reinventing_the_wheel">see</a>)</li>
<p>This is partially caused by lack of communication and partially a result of the programmer&#8217;s discipline. When adding a new library to the project the team must have a discussion and look for the benefits earned by using it. Before adding a XML parsing library that you&#8217;re used to, have  a quick chat with the team will let you know if is there any other parsing library being used. Maybe someone could make a walk-through with you on it. But it is your responsibility to know how to use it afterwards.</p>
<li><strong>Code For The Others</strong> (and for yourself)</li>
<p>When coding, you should always ask yourself if your peers would be able to understand what are you producing. Better still, you should ask if you would easily understand it again in a couple of weeks from now. It&#8217;s quite common when coding, you get contextualized with what you need to do to deliver that functionality. This context will always get lost after finishing, unless you share it with the others or document it. There are <a href="http://tinyurl.com/m73tjb">some</a> <a href="http://tinyurl.com/3jms4t">good</a> <a href="http://tinyurl.com/lxr9ke">materials</a> <a href="http://tinyurl.com/n34a2h">out</a> <a href="http://tinyurl.com/mkh47l">there</a> that <a href="http://tinyurl.com/lxj2qn">shows</a> you how to write clean and readable code.</p>
<li><strong>Broken Builds</strong></li>
<p>In a distributed team, a broken build not only just affects the people in your room, it also affects people in rooms into other cities. So reverting a broken build should be taken into account, specially when you have a slow build, then definitely the commiter would get himself into a big problem! Imagine a long build that takes about 30 minutes for example, and someone commits something broken. If he fixes it really quickly, it still may take 1 hour for the other team to be able to commit its changes and consequently 1 hour and a half lost in productivity in the other cities. It&#8217;s all about communication - the quicker the build, the quicker the feedback. So a fast and successful build is mandatory!</ul>
<h3>Fear of Refactoring</h3>
<p>Poor code quality results in fear of refactoring. Who hasn&#8217;t been in a situation, working on a tightly coupled system, where it was quite hard to do any refactoring? Any attempt would propagate the changes deep in the source code, ending up <a href="http://www.catb.org/~esr/jargon/html/Y/yak-shaving.html">shaving the yak</a>, not going anywhere.</p>
<h3>Absence of Trust</h3>
<p>I see this one as a result of the other two I mentioned above. When your team is biased to go off the tracks when trying to comply with code standards, some precautionary measures are generally created to avoid the worse.</p>
<p>I&#8217;ve seen a case where a pair, assigned to implement a story, and almost completing the development, ended up realising that another pair was also looking at it. Don&#8217;t ask me why!</p>
<p>I&#8217;ve also seen people creating triggers on the version control system, so that for each commit from one team, the other received an email with all the commit information. This is good in one side, because you can easily identify cowboy commiters that don&#8217;t write tests. But this is also used to check if the code is acceptable, reverting if not!</p>
<h2>My Current Experience</h2>
<p>The team I&#8217;m currently working with is facing some of these problems, and during all last week, when I was on the other side of the fence, visiting the other part of out team on Tasmania, this became even more highlighted. Although we were having daily stand-up meetings, I felt like I was missing something, specially because there was another team in Melbourne joining us and I still didn&#8217;t know how it was going to work out. Chatting with my friend <a href="http://www.markhneedham.com/">Mark Needham</a> about it, he recommended me a book called <a href="http://tinyurl.com/kpoxmx">The Organization and Architecture of Innovation: Managing the Flow of Technology</a>, where there&#8217;s a chapter dedicated exclusively to this point, and that I could probably get some ideas of how to overcome this problem.</p>
<h3>Taking actions</h3>
<p><cite>It seems obvious that an organization that wants its technical staff members to communicate needs to ensure the distances among them are minimized. Unfortunately, the traditional and most common form of office configuration does just the opposite. Not to mention when they are in separated buildings.</cite></p>
<p>The quote above also extracted from the book, doesn&#8217;t tell anything new, and that&#8217;s exactly one of the issues we wanted to fix. Now, with three teams we agreed that we would need to have them communicating face-to-face more often. So the rule is that every week we should have at least one person from each team visiting a different one. Apart from that, we are continuing with our <a href="http://en.wikipedia.org/wiki/Stand-up_meeting">daily stand-up meetings</a>, each team separately, and later on another daily meeting, but between teams (in the Scrum world called <a href="http://agilecommons.org/posts/d551a84f06">Scrum of Scrums</a>). This one involves, by default, only the iteration manager and the tech lead, but everyone else is also welcome to attend.</p>
<p>We also had to put more effort on improving the non-verbal communication, as they are more required on distributed teams. With this separation teams have to be even more strict with what they permit or not in the codebase. We introduced development tools such as <a href="http://checkstyle.sourceforge.net/">Checkstyle</a> and <a href="http://tinyurl.com/ktn6mn">Compile With Walls</a> to ensure this. Checkstyle acts as a hammer on misbehaved commiters and Compile With Walls ensures that project structure is being respected. Sometimes quite good threads (over IM or email) are created by people trying to understand why a Checkstyle rule has failed.</p>
<p>(Thanks to <a href="http://watchitlater.com/blog/">Tom Czarniecki</a> for helping me with this one.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/wrong-communication-in-distributed-teams/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ThoughtWorks Australia is Hiring!</title>
		<link>http://blog.m.artins.net/thoughtworks-australia-is-hiring/</link>
		<comments>http://blog.m.artins.net/thoughtworks-australia-is-hiring/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 12:45:00 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[ThoughtWorks]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=234</guid>
		<description><![CDATA[ThoughtWorks Australia is looking for new talents! 
This time we are hiring Senior QA Testing Consultants!
So if you want to work in this fast growing, unhierarchical consultancy, applying your knowledge of testing in a variety of client environments while constantly using the latest methodologies and technologies, you can continue reading this post, otherwise, just don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.thoughtworks.com/">ThoughtWorks</a> Australia is looking for new talents! </p>
<p>This time we are hiring <strong>Senior QA Testing Consultants</strong>!<br />
So if you want to work in this fast growing, unhierarchical consultancy, applying your knowledge of testing in a variety of client environments while constantly using the latest methodologies and technologies, you can continue reading this post, otherwise, just don&#8217;t bother <img src='http://blog.m.artins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Working with us, you&#8217;ll get to work alongside truly talented teams and help them enhance their performance by bringing quality assurance to the forefront of clients&#8217; minds. As well as ensuring the bug-free delivery of custom built software, you will also be working with clients to advise them on improving their test processes and teaching them about the very latest from the QA world.</p>
<h3>Some Of The Duties</h3>
<p>Our test processes are very different to many organisations. Testers are involved from the initial requirements gathering through implementation to deployment. They are always around to ask the awkward questions and try scenarios that analysts or developers are unlikely to dream up. They are involved when analysts are capturing requirements in the form of user stories. These stories are then converted into acceptance tests outlining specific scenarios. Testers play a big part in making sure those tests are well defined and complete so that developers know when they have finished implementing the functionality defined in a story. For more information, visit <a href="http://testing.thoughtworks.com">http://testing.thoughtworks.com</a>.</p>
<h3>Desired Experience</h3>
<ul>
<li>Be a very hands-on tester who is comfortable across a whole range of functional testing including UAT, acceptance and system testing with tools like Fit, Fitnesse, Silk, Winrunner or any other automation tool</li>
<li>Experience of participating in full life cycle development right from the requirements gathering and analysis phase</li>
<li>Have worked on large, long term projects (more than 10 people, longer than 6 months)</li>
<li>Enjoyment of working closely with developers, analysts and clients in a highly collaborative environment</li>
<li>Exceptional communication skills</li>
<li>An unrivalled passion for delivery</li>
</ul>
<h3>Also Highly Desirable</h3>
<ul>
<li>Experience of creating test frameworks and strategy, choosing automated testing tools and creating testing standards</li>
<li>Experience of, or interest in working with Open Source testing tools like Selenium and Sahi</li>
<li>A knowledge of testing within an Agile development environment</li>
<li>A background in OO development</li>
<li>A track-record of innovation in testing</li>
<li>Experience of working in an onsite, consultancy environment</li>
</ul>
<p>So if you are interested, then click <a href="http://www.thoughtworks.com/work-for-us/apply-online.html">here</a> to apply online. And just a quick reminder that ThoughtWorks offers Visa Sponsorship for candidates.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/thoughtworks-australia-is-hiring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lean: Go-Kart Exercise</title>
		<link>http://blog.m.artins.net/lean-go-kart-exercise/</link>
		<comments>http://blog.m.artins.net/lean-go-kart-exercise/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 22:24:06 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Lean]]></category>

		<category><![CDATA[Organizational Transformation]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=229</guid>
		<description><![CDATA[Last week I attended the Lean Thinking And Practices For IT Leaders workshop organised by ThoughtWorks. There we had the presence of Mary and Tom Poppendieck, my colleague Jason Yip and two consultants from KM&#038;T. One of the things that I really liked about it was that it wasn&#8217;t only driven by presentations, but also [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the Lean Thinking And Practices For IT Leaders workshop organised by <a href="http://www.thoughtworks.com">ThoughtWorks</a>. There we had the presence of <a href="http://www.poppendieck.com/">Mary and Tom Poppendieck</a>, my colleague <a href="http://jchyip.blogspot.com">Jason Yip</a> and two consultants from <a href="http://www.kmandt.co.uk">KM&#038;T</a>. One of the things that I really liked about it was that it wasn&#8217;t only driven by presentations, but also by a lot of practical exercises, so we could get a better feeling of the benefits of applying these thinking and practices. One of the exercises we did was the Go-Kart game.</p>
<h2>How it works?</h2>
<p>Two teams are created (alpha and beta), and each one has to split up into five groups with the given responsibilities: <strong>disassembly</strong>, <strong>transportation</strong>, <strong>assembly</strong>, <strong>observation</strong> and <strong>time-keeping</strong>. They are given the task to completely disassemble, transport and re-assemble a <a href="http://flickr.com/alexmartins/3450187772">Go-Kart</a> as quick as possible, in a safe manner, while the observer write notes about problem points. The whole process is done twice, so that you can run it once,  analyse the process used, based on feedback provided by the observer, and think of ways to improve it, before running the second time.</p>
<p><a href="http://www.flickr.com/photos/alexmartins/3450187896/"><img src="http://farm4.static.flickr.com/3589/3450187896_a6ab657bed.jpg?v=0" style="border: 0px; float: left;" width="290" height="340" /></a><a href="http://www.flickr.com/photos/alexmartins/3449371477/"><img src="http://farm4.static.flickr.com/3584/3449371477_05c6d1daa5.jpg?v=0"  style="border: 0px;" width="290" height="340" /></a></p>
<h2>First Attempt</h2>
<p>In our first attempt, all we knew was that we had to split the team into five groups. We had no idea of the necessity of a detailed process, but doing all the phases as fast as possible. Vikky, our team leader, proposed the creation of a manual with the detailed steps needed to assemble the kart, to be used by the assembly team. And that&#8217;s what we did!</p>
<h3>Our marks</h3>
<p><strong>Planing time:</strong> 10 minutes<br />
<strong>Disassembling time:</strong> 5 minutes<br />
<strong>Assembling time:</strong> 12 minutes<br />
<strong>Total time:</strong> 14 minutes 20 seconds<br />
<strong>Quality of delivered product:</strong> OK</p>
<h3>Problem Points (Gathered by observers)</h3>
<ul>
<li>The team took seven minutes to get organised and start doing something.</li>
<li>No leadership nomination. Vikky, one of the team members, had to auto-niminate herself as the team leader.</li>
<li>Disassembly group didn&#8217;t notice differences on the washers and on the bolts, causing uncertainty and waste of time in the assembly group.</li>
<li>Bottleneck on the transportation of the parts from one station to another. No one from disassembly group to pick up the parts, making the transporter keep holding them, stopping the process flow.</li>
<li>The components needed to assemble specific parts of the car were not delivered together, making the assembly group wait for the remaining ones.</li>
<li>Some members in the assembly group were in a rush to finish fast and ignored the manual, resulting in some mistakes.</li>
</ul>
<h2>Second Attempt</h2>
<p>Before starting the second attempt we got together to discuss the problem points, coming up with some ideas of improvements. Here they are:</p>
<h3>Improvements</h3>
<ul>
<li>We nominated people on both disassembly and assembly groups to be in charge of handing and picking up parts from the transporter.</li>
<li>We decided to hand the parts related to each other in chunks, so that they could be assembled straight away, eliminating the time wasted waiting for remaining parts.</li>
<li>We nominated specialists for roles such as assembling the wheels, etc.</li>
<li>We added one more member to the transportation group, to get rid of the bottleneck.</li>
</ul>
<p>Instead of spending a long time planning, we did it the agile way,  highlighting only things we knew at the time, very quickly, and running through, spiking and checking if we were actually carrying out with the improvements, before doing the official attempt. We found some problems, adjusted to them and immediately got organised for the second attempt.</p>
<h3>Our marks</h3>
<p><strong>Planing time:</strong> 10 minutes<br />
<strong>Disassembling time:</strong> 1 minute 50 seconds<br />
<strong>Assembling time:</strong> 2 minutes 33 seconds<br />
<strong>Total time:</strong> 3 minutes 45 seconds<br />
<strong>Quality of delivered product:</strong> OK</p>
<p><img src="http://blog.m.artins.net/wp-content/uploads/2009/04/woohoo.gif" style="border: 0px;" width="105" height="150" /></p>
<p>Click <a href="http://www.flickr.com/photos/alexmartins/sets/72157617213798518/">here</a> to see some photos of our team during the exercise.</p>
<h2>Conclusion</h2>
<p>Lean advocates that you should pursue perfection when improving your process - <em>aiming to reduce effort, time, space, cost and mistakes</em> - and I learnt that this applies to any organisation, of any size. Thus, from the process used on this game, <strong>collaboration</strong>, <strong>self-organisation</strong>, <strong>rapid feedback</strong> contributed a lot to our improvement, helping us to eliminate waste.</p>
<p>So, what could you do for your organisation?</p>
<p>Take a step back, take a look at <strong>the big picture</strong> of how things work in your company and ask yourself questions such as: How do we deliver? Does it takes longer to test and deploy our system than to develop it? Who do we depend on to put the system onto production? What is causing a bottleneck? What could I do to change this scenario? Answer these questions (or others you make up) and think of improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/lean-go-kart-exercise/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hamcrest Out Of Test Code!</title>
		<link>http://blog.m.artins.net/hamcrest-out-of-test-code/</link>
		<comments>http://blog.m.artins.net/hamcrest-out-of-test-code/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 12:38:30 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Behaviour-Driven Development]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Domain-Driven Design]]></category>

		<category><![CDATA[Functional Programming]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=168</guid>
		<description><![CDATA[It&#8217;s been a while since I read some interesting posts showing creative uses of Hamcrest library out of test code. Since then I&#8217;ve been proscrastinating to implement my own version, trying strongly typed java delegates. 
Thankfully this week I came across a nice API called hamcrest-collections. It uses Hamcrest to implement features such as select, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I read <a href="http://joe.truemesh.com/blog/000705.html">some</a> <a href="http://jroller.com/ghettoJedi/entry/using_hamcrest_for_iterators">interesting</a> <a href="http://cromwellian.blogspot.com/2006/07/fun-with-generics-and-cglib-functional.html">posts</a> showing creative uses of <a href="http://code.google.com/p/hamcrest/">Hamcrest</a> library out of test code. Since then I&#8217;ve been proscrastinating to implement my own version, trying <a href="http://weblogs.java.net/blog/alexwinston/archive/2005/04/strongly_types_1.html">strongly typed java delegates</a>. </p>
<p>Thankfully this week I came across a nice API called <a href="http://code.google.com/p/hamcrest-collections/">hamcrest-collections</a>. It uses Hamcrest to implement features such as <strong><code>select</code></strong>, <strong><code>reject</code></strong>, <strong><code>map</code></strong>, <strong><code>reduce</code></strong> and <strong><code>zip</code></strong> familiar from languages like Ruby and Python. </p>
<h2>Selectors</h2>
<p>Selectors can be used to select or reject items that matches a given Matcher, from any iterable object. It reminds me the <a href="http://martinfowler.com/apsupp/spec.pdf">Specification Pattern</a> from <a href="http://domaindrivendesign.org/">Domain-Driven Design</a>, which is also used for querying objects that satisfies defined specifications.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
public static final Person john = new Person("John", 28);
public static final Person nicole = new Person("Nicole", 12);
public static final Person ryan = new Person("Ryan", 23);
public static final Person nathan = new Person("Nathan", 18);

public static final List<Person> list() {
    return Arrays.asList(john, nicole, ryan, nathan);
}</pre>
<p><br/><br />
The code below selects from the list of users defined above, the ones that are under twenty.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
@Test
public void should_select_only_people_under_twenty_years_old() {
    List<Person> users = Person.list();
    Iterable<Person> underTwentyList = select(users, underAge(20));
    assertThat(underTwentyList, hasItems(nicole, nathan));
    assertThat(underTwentyList, not(hasItems(john, ryan)));
}
</pre>
<p><br/><br />
The code below rejects all the users that are under twenty.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
@Test
public void should_reject_every_people_under_twenty_years_old() {
    List<Person> users = Person.list();
    Iterable<Person> aboveTwentyList = reject(users, underAge(20));
    assertThat(aboveTwentyList, hasItems(john, ryan));
    assertThat(aboveTwentyList, not(hasItems(nicole, nathan)));
}</pre>
<p><br/></p>
<h2>Map and Reduce</h2>
<p>Map is used to apply a function onto each item in any iterable object, whereas Reduce combines all these elements, applying a Reducer implementation. In our example, we map the timesTwo function, that doubles each element in the list, and then we reduce it by adding up all of them.</p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
@Test
public void should_double_each_number_in_the_list_then_sum_all_of_them() {
    List<Integer> numbers = Arrays.asList(1, 2, 3);
    MultiplyBy timesTwo = new MultiplyBy(2);

    Iterable<Integer> result = map(numbers, timesTwo);
    assertThat(result, hasItems(2, 4, 6));

    Integer sum = reduce(result, new Sum());
    assertThat(sum, equalTo(12));
}</pre>
<p><br/></p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
public class MultiplyBy implements Function<Integer, Integer> {
    private Integer factor;

    public MultiplyBy(Integer factor) {
        this.factor = factor;
    }

    public Integer apply(Integer number) {
        return (int)number * factor;
    }
}</pre>
<p><br/></p>
<pre style="border: solid gray 1px; width: 90%; padding: 10px;">
public class Sum implements Reducer<Integer> {
    public Integer apply(Integer first, Integer second) {
        return first + second;
    }
}</pre>
<p><br/></p>
<p>Despite the bias created by some developers, that Hamcrest should not be used anywhere else but test code, specially after JUnit has defined it as its new matcher library, just ignore it and add these features to your runtime library, so that you can let your creativity drive you when developing. Get rid of &#8220;for&#8221; loops from your life! <img src='http://blog.m.artins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/hamcrest-out-of-test-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>2008 Retrospective</title>
		<link>http://blog.m.artins.net/2008-retrospective/</link>
		<comments>http://blog.m.artins.net/2008-retrospective/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 12:45:59 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Career]]></category>

		<category><![CDATA[Career Development]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=150</guid>
		<description><![CDATA[
After reading posts from some friends I decided to write my 2008 retrospective, so there it go!
Personal Life

First year married  
Moved to the land down under.
Tried to go to the gym, but it still seems like I am better as an investor  

Professional Life

Joined ThoughtWorks Australia.
Tried to post more often on my blog.
Became [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm2.static.flickr.com/1121/3165708881_d2c0a88982_m.jpg" border="0" width="270" height="179" align="right" /></p>
<p>After reading <a href="http://www.markhneedham.com/blog/2009/01/01/2008-my-technical-review/">posts</a> <a href="http://dahliabock.wordpress.com/2008/12/28/2008-in-hindsight/">from</a> <a href="http://haacked.com/archive/2008/12/30/not-your-typical-top-ten-of-2008-post.aspx">some</a> <a href="http://www.lixo.org/archives/2008/12/25/2008-in-numbers/">friends</a> I decided to write my 2008 retrospective, so there it go!</p>
<h3>Personal Life</h3>
<ul>
<li>First year married <img src='http://blog.m.artins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Moved to the <a href="http://en.wikipedia.org/wiki/Australia">land down under</a>.</li>
<li>Tried to go to the gym, but it still seems like I am better as an investor <img src='http://blog.m.artins.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<h3>Professional Life</h3>
<ul>
<li>Joined <a href="http://www.thoughtworks.com/">ThoughtWorks</a> Australia.</li>
<li>Tried to post more often on my blog.</li>
<li>Became a Certified Scrum Master Of The Universe!</li>
<li>Projects: 4</li>
<li>Conferences attended: <a href="http://jaoo.com.au/sydney-2008/">JAOO Sydney</a></li>
</ul>
<h3>Learning</h3>
<ul>
<li>Languages learned: <a href="http://erlang.org/">Erlang</a>, <a href="http://www.ruby-lang.org">Ruby</a>, <a href="http://clojure.org/">Clojure</a> (started)</li>
<li>Books bought: 15</li>
<li>Books read: </li>
<ol>
<li><a href="http://www.amazon.com/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530">Test Driven Development</a></li>
<li><a href="http://www.amazon.com/Job-Went-India-Pragmatic-Programmers/dp/0976694018">My Job Went To India</a></li>
<li><a href="http://www.amazon.com/Waltzing-Bears-Managing-Software-Projects/dp/0932633609">Waltzing With Bears</a></li>
<li><a href="http://www.amazon.com/Programming-Erlang-Software-Concurrent-World/dp/193435600X">Programming Erlang</a></li>
<li><a href="http://www.amazon.com/Agile-Software-Development-Scrum/dp/0130676349">Agile Software Development With Scrum</a></li>
<li><a href="http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition">Agile Web Development With Rails</a></li>
<li><a href="http://www.amazon.com/Agile-Retrospectives-Making-Teams-Great/dp/0977616649">Agile Retrospectives</a></li>
<li><a href="http://www.pragprog.com/titles/shcloj/programming-clojure">Programming Clojure</a> (started)</li>
<li><a href="http://www.amazon.com/How-Mind-Map-Ultimate-Thinking/dp/0007146841">How To Mind Map</a></li>
</ol>
</ul>
<h2>2009 Resolutions</h2>
<p>Still haven&#8217;t planned properly what to do for 2009, the only thing for now is continuing learning Clojure, and understand more about applying <a href="http://en.wikipedia.org/wiki/Lean_manufacturing">Lean principles</a> into software development.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/2008-retrospective/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Clojure: Integrating With Java</title>
		<link>http://blog.m.artins.net/clojure-integrating-with-java/</link>
		<comments>http://blog.m.artins.net/clojure-integrating-with-java/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 06:44:04 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Clojure]]></category>

		<category><![CDATA[Functional Programming]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=145</guid>
		<description><![CDATA[Currently I am learning Clojure. It is a functional programming language, but not a pure one, since you can both write code that share state (mutable) and also ones that doesn&#8217;t.
Why Clojure?
The main reason why I chose Clojure is its easy interoperability with Java, still one of the most used languages, bringing to it the [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I am learning <a href="http://clojure.org/">Clojure</a>. It is a functional programming language, but not a <a href="http://en.wikipedia.org/wiki/Purely_functional">pure one</a>, since you can both write code that share state (mutable) and also ones that doesn&#8217;t.</p>
<h2>Why Clojure?</h2>
<p>The main reason why I chose Clojure is its easy interoperability with <a href="http://java.com">Java</a>, still one of the most used languages, bringing to it the power of Lisp. It&#8217;s fast, since the code is compiled, and it supplements some of Java&#8217;s weakness, such as the Collections framework and concurrent programming. It is pretty straightforward to write concurrent programs, everything is automatic, no manual lock management!</p>
<h2>Integrating With Java</h2>
<h3>Importing classes</h3>
<p>A single class:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(import java.util.List)
</pre>
</p>
<p>Multiple classes from the same package:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(import '(java.util List Set))
</pre>
</p>
<h3>Creating instances</h3>
<p>Using Java&#8217;s <span style="font-family: courier;">new</span> keyword:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(new java.util.ArrayList)
(new ArrayList) ; after importing
</pre>
</p>
<p>Assigning a new  <span style="font-family: courier;">List</span> to a Clojure variable:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(def list (new java.util.List))
-> #'user/list
</pre>
</p>
<p>Syntactic Sugar:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(ArrayList.)
</pre>
</p>
<h3>Accessing ﬁelds</h3>
<p>Static fields:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(. Math PI)
</pre>
</p>
<p>Syntactic Sugar:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
Math/PI
</pre>
</p>
<h3>Invoking methods</h3>
<p>
<h4>Static Methods</h4>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(.currentTimeMillis System)
</pre>
</p>
<p>Syntactic Sugar:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(System/currentTimeMillis)
</pre>
</p>
<p>
<h4>Non-static Methods</h4>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(. list size)
(. list get 0) ; returns the object stored at index 0
</pre>
</p>
<p>Syntactic Sugar:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(.size list)
</pre>
</p>
<h3>Mixing Them All</h3>
<p>Clojure provides a macro called  <span style="font-family: courier;">memfn</span> that makes possible execute Java methods as functions. So, for a list of String objects, if I want to make all of them upper-case, all I have to do is:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(map (memfn toUpperCase) ["a" "short" "message"])
</pre>
<p>The  <span style="font-family: courier;">map</span> function applies the function/method  <span style="font-family: courier;"> toUpperCase</span> to each element in  <span style="font-family: courier;">["a" "short" "message"]</span></p>
<p>You can also use the  <span style="font-family: courier;">bean</span> function to wrap a Java bean in an immutable Clojure map.</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(bean (new Person "Alexandre" "Martins"))
-> {:firstName "Alexandre", :lastName "Martins"}
</pre>
<p>Once converted, you can manipulate the new map using any of Clojure’s map functions, like:</p>
<pre style="border: solid gray 1px; width: 60%; padding: 5px;">
(:firstName (bean (new Person "Alexandre" "Martins")))
-> Alexandre
</pre>
<p>The code above extracts the <span style="font-family: courier;">firstName</span> key, originally from the  <span style="font-family: courier;">Person</span> object.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/clojure-integrating-with-java/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Retrospectives: Analogy For Developers</title>
		<link>http://blog.m.artins.net/retrospectives-analogy-for-developers/</link>
		<comments>http://blog.m.artins.net/retrospectives-analogy-for-developers/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 13:47:03 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Retrospective]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=143</guid>
		<description><![CDATA[One day, while reading Esther Derby&#8217;s book, preparing for a retrospective session, I came across a great analogy between retrospective and development life-cycle:
While continuous builds, automated unit tests, and frequent demonstrations of working code are all ways to focus attention on the product and allow the team to make adjustments, retrospectives focus attention on how [...]]]></description>
			<content:encoded><![CDATA[<p>One day, while reading <a href="http://www.amazon.com/Agile-Retrospectives-Making-Teams-Great/dp/0977616649">Esther Derby&#8217;s book</a>, preparing for a retrospective session, I came across a great analogy between retrospective and development life-cycle:</p>
<p><cite>While continuous builds, automated unit tests, and frequent demonstrations of working code are all ways to focus attention on the product and allow the team to make adjustments, retrospectives focus attention on how the team does their work and interacts.</cite></p>
<p>Indeed it helps people improve practices and focus on teamwork. That&#8217;s why it is one of my favorite meetings.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/retrospectives-analogy-for-developers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ping Pong Pairing: Even More Fun!</title>
		<link>http://blog.m.artins.net/ping-pong-pairing-even-more-fun/</link>
		<comments>http://blog.m.artins.net/ping-pong-pairing-even-more-fun/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 13:05:16 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Coaching]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Pair Programming]]></category>

		<category><![CDATA[Test-Driven Development]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=137</guid>
		<description><![CDATA[The agile software development practice I like the most, and at the same time, the one I find the most difficult is pair programming. Each individual has his/her own way of working, and characteristics such as motivation, engagement, habits, open-mindedness, and coding/design style varies a lot from individuals. Sometimes, to get a balance between these [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.m.artins.net/wp-content/uploads/2008/12/pingpong.jpg" style="border: 0px;" width="150" height="113" align="left" />The agile software development practice I like the most, and at the same time, the one I find the most difficult is pair programming. Each individual has his/her own way of working, and characteristics such as motivation, engagement, habits, open-mindedness, and coding/design style varies a lot from individuals. Sometimes, to get a balance between these differences is quite hard. I am still not an expert in pair programming coaching, but I&#8217;ve been learning a lot on my current assignment.</p>
<p>And from this experience, it seems that clients are definitely more involved and amused when it comes pairing following the ping pong pattern.</p>
<h3>Ping Pong Pattern</h3>
<p>It happens when the developer 1 from a pair implements a test for a given feature and see it failing, then passes the keyboard to developer 2 who makes the test pass, do some refactoring on the code and implements another test, passing the keyboard back to developer 1 to do the same thing and continue until the feature is done.</p>
<h3>Why Do We Like</h3>
<ul>
<li><strong>Challenge</strong> - Each time a developer writes a test for you to make it pass, it sounds like a challenge, then you do it and write another one, challenging him back.</li>
<li><strong>Dynamics</strong> - The worse thing is a developer that just hogs the keyboard, making you feel a useless. Ping pong pairing makes you swap keyboard more frequently.</li>
<li><strong>Engagement</strong> - Developers are much more engaged because they are constantly coding, not only observing.</li>
<li><strong>Fun</strong> - It is so much fun when you have all the above items together!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/ping-pong-pairing-even-more-fun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Martin Fowler: HumaneRegistry</title>
		<link>http://blog.m.artins.net/martin-fowler-humaneregistry/</link>
		<comments>http://blog.m.artins.net/martin-fowler-humaneregistry/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 22:53:33 +0000</pubDate>
		<dc:creator>Alexandre Martins</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Consulting]]></category>

		<category><![CDATA[Organizational Transformation]]></category>

		<category><![CDATA[SOA-Governance]]></category>

		<guid isPermaLink="false">http://blog.m.artins.net/?p=134</guid>
		<description><![CDATA[Latest Martin Fowler&#8217;s post about HumaneRegistry mentions the first project I was involved working for ThoughtWorks. It was a SOA-Governance consulting with some development effort, and also some effort on harvesting information about services provided by different applications inside the organization, compiling and placing them on the wiki. The idea was to get both service [...]]]></description>
			<content:encoded><![CDATA[<p>Latest <a href="http://www.martinfowler.com">Martin Fowler</a>&#8217;s post about <a href="http://www.martinfowler.com/bliki/HumaneRegistry.html">HumaneRegistry</a> mentions the first project I was involved working for <a href="http://www.thoughtworks.com/">ThoughtWorks</a>. It was a <a href="http://en.wikipedia.org/wiki/SOA_Governance">SOA-Governance</a> consulting with some development effort, and also some effort on harvesting information about services provided by different applications inside the organization, compiling and placing them on the <a href="http://en.wikipedia.org/wiki/Wiki">wiki</a>. The idea was to get both service builders and consumers to contribute, inputing information about the services they develop/consume aiming to build a solid service registry for all the services, with some highlighted features such as:</p>
<ul>
<li>Service description and what the user needs to use it.</li>
<li>Who is the best person for the consumer to speak to, by looking the graph indicating who&#8217;s been contributing to the project.</li>
<li>Who&#8217;s using it, by looking the graph indicating which applications has been invoking EJBs and consuming messages.</li>
<li>And some other ones mentioned on Martin&#8217;s <a href="http://www.martinfowler.com/bliki/HumaneRegistry.html">post</a>.</li>
</ul>
<p>This was such a rewarding experience to work with great professionals like <a href="http://erik.doernenburg.com">Erik Dörnenburg</a> and <a href="http://blog.halvard.skogsrud.com/">Halvard Skogsrud</a>. And it was cool that Martin documented this on his bliki.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.m.artins.net/martin-fowler-humaneregistry/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
