Archive

Archive for the ‘Agile / Lean’ Category

Indian Summer

August 7th, 2009 Josh Graham 1 comment

I’m visiting our India operation for a few months, mostly at our Pune office. I’m trying my hand at various coaching activities on a number of fronts, including working with some of our technical leads, aspiring architects, business development team, and recruitment.

I’ve always been a fan of our teams in India and China. In the early days of the ThoughtWorks Sydney office, to help fill the rapidly growing demand pipeline, we were able to bring people in from TW offices around the world, including some from India (Nitesh rocks!). We also had to distribute some delivery work to India (and later, China too) on some large projects. This was an eye-opening time for us in learning how to make Agile software development work across teams in different places and timezones. (People like Ben Hogan, Naresh Jain, Shyam Mohan, and Jane Robarts have been able to share some of that experience at conferences.)

It wasn’t the reduced rates that these projects were able to offer to clients that appealed to them – it was the large capacity of ThoughtWorks talent available that we simply couldn’t fill quickly enough locally. ThoughtWorks and clients alike insisted on top grade delivery team members, no matter where they happened to be located during any given iteration (we rotated people through the locations quite a bit to engender better collaboration, shared understanding, and teamwork).

Being a senior member of the company for four years, I had always felt a little incomplete in not having visited any offshore teams – based on the stories from others who had visited, I was missing out. I’m pleased now I’m here and I can experience for myself the atmosphere, attitude and aptitude of the Pune office and I’ll get to meet everyone from Chennai and Bangalore at the ThoughtWorks India Away Day in a few weeks.

It’s also pleasing that we have evolved the offshore capability to the point it is a compelling set of offerings that really appeal to companies looking for top quality, technical innovation, agile software delivery, and commitment to results within leaner budgets. http://offshore.thoughtworks.com/

I’m very excited to be here right now. Amanda is knocking out her “F# In Action” book from Manning as fast as an autorickshaw darts between pedestrians, I’m working with some awesome new and old faces, and the dal makhani is delicious!

However, I’m not having much luck getting people to call me “RoganJoshG”… ;-)

Categories: Agile / Lean Tags:

The value of test names

May 29th, 2008 Josh Graham No comments

My colleague Jay Fields recently blogged about the value of test names.

We had a little discussion about it yesterday on IM. Here’s a summary.

Josh Graham

I feel the test name is important for two reasons:
1) it is intentional programming – a neural pathway is established in your brain as you write the name of the test method so your mind tries to think about what the hell you are trying to achieve by doing all that typing
2) for those test consumers you speak of to get a sense of the behaviour of the system as specified by the stories and high level acceptance criteria

Jay Fields

2) [is] fair enough. Before introducing expectations on any client project I’ve brought it up as “what do you think about” and let the team decide. The last thing I want is an idea to be branded as bad because the wrong ppl used it
1) I think is based on the person. I always found it 10 times harder to write a sentence, I just want to get to the code but, I’m crazy for making the code intention revealing

Josh Graham

Picking a reasonable moniker for the test name is useful too, when something breaks (particularly if it occurs often)… “That #$%#$%! shouldRejectLostOrStolenCard test is failing again – must be the clearing house API has changed or they’ve crashed once more”.

Jay Fields

yeah, that’s an interesting point
wish you would have replied with that one, I’d have put it in my entry

We then talked about how to attach a moniker to the test on different languages – method names in Java being the easiest, while anonymous inner classes being a way to do so without having a moniker (other than perhaps a comment) at all.

I still contended that a method was a reasonable level of granularity to contain a test and use the method name as the moniker. A method (it’s declaration and its body) is location independent – it can be moved around in its module and you can still find it and its moniker appears in the abstract syntax tree so it’s very easy to find when using an editor that maintains an AST.

Jay’s responses to my scenarios in which this proves useful assume a short TDD cycle and also good developers.

So, while the test name may be superfluous in some cases, I don’t mind the extra mental effort of summarising the intent of the test into its name – and if that is overly difficult or not needed (both of which are plausible) then a banal label like enclosing the test in a method called “test1″ is a small price for me to package it up in a manageable, easy-to-find chunk.

YMMV.

Categories: Agile / Lean, Coding, Testing Tags:

CruiseControl comes of age. Cruise and relax.

April 23rd, 2008 Josh Graham No comments

Hot on the heals of the Mingle 2.0 announcement, ThoughtWorks Studios has released information on the next generation of the world’s most popular Continuous Integration engine, CruiseControl, called Cruise.

It is a ground-up rewrite accomplished in around 8 months with an emphasis on catering to enterprise software development teams and large-scale applications. It combines sequential build pipelines (for, say, progressively more complicated or longer-running tests) with concurrent build tasks using a grid of agents.

The Cruise server can dispatch work to agents on ye olde CruiseControl servers. Although the Cruise product is not Open Source Software, the licensing terms are generous and in line with Mingle. Pricing is yet to be released.

With the usability innovations of cc.rb and the great foundation laid by CruiseControl and CruiseControl.NET we’re excited at the prospect of using the newest and best Continuous Integration tool on the market, from the company who changed the way developers integrate their software changes and who wrote the book on build pipelines.

Categories: Agile / Lean Tags:

ThoughtWorks Anthology

March 23rd, 2008 Josh Graham No comments

My CTO, Rebecca Parsons, announced the publication of the ThoughtWorks Anthology a few days ago:

I am thrilled to announce that the ThoughtWorks Anthology is now ON SALE!

http://www.pragprog.com/titles/twa

There are essays by Roy and Michael Robinson, Martin, Neal Ford, Tiffany Lentz, Stelios Pantazopoulos, Ian Robinson, Erik Doernenburg, Kristan Vingrys and James Bull, as well as ex-TWers Dave Farley, Jeff Bay and Julian Simpson. (And of course your’s truly made her own contribution). Mike Aguilar wrote the introduction.

Some comments that appear in the book:

Jim Fischer writes, “The anthology provides a peek into the diversity of views and perspectives held by a company that dares to take on the long-accepted tenet of the IT industry that custom software is too hard and too costly.”

Big Dave Thomas writes, “Software is in many ways a team sport, and the leaders shape the software culture. Often successful organizations don’t take the time to document them, and hence others don’t benefit from them. This interesting collection of personal essays gives a glimpse into the culture of ThoughtWorks through some of its leaders.”

I’m really excited that this project has come to fruition and I hope you all enjoy what you see.

Rebecca

I was lucky enough to review the content earlier this year. It’s a keeper.

UPDATE: Some press… http://www.sys-con.com/read/541124.htm

Jamming for Inveneo

February 29th, 2008 Josh Graham 1 comment

After a meeting of the office of the CTO, most of us stayed around in our San Francisco office for a few days to do some podcasts and to participate in a Code Jam for Inveneo, a not-for-profit who provide computers and connectivity to developing countries (especially their schools, hospitals, and poorer villages).

They install a server in, say, a hospital with a few lower-powered, custom desktops (almost iMac in configuration). These, as well as the servers, can run off solar panels for power.

We were presented with a worthwhile problem with a number of interesting constraints:

  • Low-power server running Ubuntu, with two small SATA hard disks in a Linux software RAID-1 array
  • VMWare images of the servers for testing
  • Python, bash, mdadm, and beep as our “programming languages”

When a RAID array fails, we need to alert any (if any) humans who are near the server. This can be interesting as the only things nearby might be the tree it is mounted in with a long-range WiFi, or the goat who uses it as a heat source at night. This means that any alert should be sufficiently frequent and annoying for the locals to contact someone who can let the support technician know. The conflict is that it also might be the nurses in their office at the hospital who have work to do and don’t want to be disturbed.

The solution was to use the PC speaker to beep. We can control the pitch and duration of the beep. Some combinations sounded too much like an ECG machine so that was no good. In the end, we chose a simple rising scale that would sound odd in any environment (except, perhaps, in a Mike Oldfield recording). This is repeated by default every 30 minutes.

We also had to send an email to the support technician. This doesn’t work when the server doesn’t actually have any connectivity (as some are used only as a local communications hub), or when connectivity is unreliable. Even then, many of the technicians are hours or even days away from the servers.

As many of the technicians aren’t particularly technical, we also had help by identifying which of the two disks had failed and allow them to simply change the one labelled “Disk 1″ or “Disk 2″. Serial numbers are good for this but VM hard disks don’t have serial numbers (I think that’s a feature request to both VMWare and Parallels).

We had Jeff Wishnie from Inveneo as the customer, Anda Abramovici as IM, Jonny Leroy as BA, Paul Hammant and Chad Wathington as QA, and the star developer crew of Drew Olson, Sammy Zahabi, Ola Bini, Erik Doernenburg and your’s truly. We quickly learned the following:

  • The skills we needed (and had, just a little rusty) were more along the lines of Unix devices, shell, ASCII control characters, and simulation
  • Python sucks (a bad tradesman blames his tools? perhaps – but it still sucks)

Anyway, we got most of what we wanted done in the time, and given the context, more than we anticipated. But we all would have liked to get a lot more done and would have if we were using our tools of choice (which are chosen for very good reasons).

Nonetheless, we’re doing it for the kids and it was great!

What a buzz. Super Agile. Super Fun. Go Inveneo, you rock!!

Agile Meetup Alliance

February 16th, 2008 Josh Graham No comments

UPDATE: 4 continents now represented. I’m not sure that we’ll ever get Antarctica, but come on South America and Africa, I know you’re out there.

Calling all Agile and Lean user groups around the world.

If you have an online presence, particularly with one of the usual online group sites, I encourage you to add it to the worldwide meetup alliance.

The purpose of the Agile meetup alliance is to allow Agile Alliance user groups around the world to collaborate on events and to help those who travel to meet up with like-minded software professional wherever they are.

http://www.meetupalliance.com/agilealliance/

Of course, make sure you sign up to the Agile Alliance too!

Looking forward to adding your user group.

Categories: Agile / Lean, Conference Tags:

2008 Issues and Opportunities for Australian business

December 18th, 2007 Josh Graham No comments

Probably worth looking at if you’re international, as it contains many global references and is likely to be applicable to you anyway.

http://www.straterjee.com/2008Issues&Opportunities.pdf

Straterjee is a business and marketing strategy consultancy using an agile approach to deliver results more quickly (sound familiar?). Their people have foundations in business strategy and they’re part of Australia’s leading marketing and communications group, STW and sit along Aussie household names like Singleton Ogilvy & Mather, Massive Interactive, and Ikon.

I met Dave and Tristan from straterjee and it was great to see how Lean and Agile principles are naturally applied in another type of consulting service. I was given the honour of contributing to their annual forward viewing paper on behalf of ThoughtWorks and the whole report is a great read.

Categories: Agile / Lean Tags:

Dynamically defined Smoke Test Suites for Java

September 11th, 2007 Josh Graham 2 comments

Most of my ThoughtWorks colleagues love tests. We love writing tests and watching them fail, and we love writing the code that then makes them pass. We love tests so much that most of the time taken in building the software is in the running of the tests to make sure we haven’t done something dotty to break the software.

We hate when the time taken to run all those tests takes more than a few minutes, and this causes a lot of discussion internally as well as on our blogs. My strategic preference is to make the application smaller and thus the builds quicker, by building the software as discrete components (built and deployed independently) that are composed into an application. But before that, there’s a long list of things to make the builds and tests quicker. The list is never long enough, though.

We regularly discuss/concoct innovations in testing at the Sydney TW office. A few weeks ago Stacy Curl started a discussion on an idea he’s had for a while around optimising acceptance tests. During this discussion, we talked about various techniques, including profiling and coverage, which then prompted thoughts around knowing which code each test covered.

This then blossomed into a requirement which was to instrument the code that is covered by each test such that when that code is changed, the tests that cover it are known. This then lets us run only the tests that “need” to be run when we change some code. I say “need” because there are always things below or outside the code that may alter behaviour, so a full test suite still has to be run at some point, just not in a way that delays feedback on the most likely problems.

In essence, we wanted a tool that defines the smoke tests (pre-commit build, initial CruiseControl pipeline build) dynamically. The “changed” code could be based on file system modified times, Subversion status, CruiseControl modificationset, etc.

Unfortunately, the context provided by tools like Clover, Emma and Cobertura isn’t sufficient to indicate which test is running (no stack is available in the metrics). The upshot was I went off and looked at using AspectJ aspects to trace the code during a test run. Gianny Damour helped with early optimisations of my advices and gave me the introduction to “cflow” which allowed me to remove my own stack-peeking logic. I was going to call it TestThis! (as in this.method()) but because of the annoyance in lowercase called it TestMe instead (no throwback to VB intended), with the almost obligatory “J” prefix for Java. Josh Price rightly pointed out that the resultant name “JTestMe” is lame – another reason to merge with ProTest (see below).

Only the source file name is tracked. While we could instrument to the method level, we felt that this was too granular and that any change to the source file should trigger all tests that touch any of that class’ logic. It also works for superclasses, inner classes and called classes – that is, the tests may not call the code directly, but because the code is within their control flow, they’re all tracked.

public aspect TestCoveringAClassObserver {
    pointcut allTestMethods(TestCase test):
        target(test) &&                                                   // capture the TestCase
        execution(public void TestCase+.test*())                          // and advise execution of any JUnit test methods
    ;

    before(TestCase test):
        cflow(allTestMethods(test)) &&                                    // within the control flow of the allTestMethods advice
        (execution(!private * *(*)) || execution(!private * *())) &&      // when executing any non-private method
        (execution(* !TestCase+.*()) || execution(* !TestCase+.*(*))) &&  // that is not in the test case class
        within (!com.thoughtworks.testme..*)                              // and not within any JTestMe class
        {
            recordLink(thisJoinPointStaticPart.getSourceLocation(), test);
        }
    ;
}

Even with the extra guards to avoid recursive advice explosions and to ignore instrumenting the test code itself, you can see that the core piece of code is a ridiculously few lines of AspectJ. The “database” updated by the recordLink() method is a fat ugly (but very fast) object de/serializer that I haven’t bothered cleaning up much.

To allow you to easily run your code with or without instrumentation (you may be nervous that AspectJ has subtly altered behaviour), I’ve used the AspectJ Load Time Weaving (from the AspectWorkz merge). It also means you can continue to use your own custom JUnit test runners. Instrumented – use aj5’s java --javaagent). Normal – use java.

At CITCONF in Sydney a few weeks back, where I gave this a quick demo, the crowd were very encouraging and the Atlassian Clover (nee-Cenqua) guys, who demonstrated a tops new version, were academically interested in the neat and tidy use of aspects (they can’t use them for a reason I can’t remember?? Will find out next meetup).

There’s a long to-do list, the first of which are make it more “one-click” to use and explore a merge into ProTest (a test prioritising tool – and I figure the tests that JTestMe identifies are just another way to prioritise tests). Others are SVN integration and Ant task, and a filter for the excellent Continuous Testing tool (which also allows for prioritising tests).

It’s just been accepted into the Codehaus so have a peek and let me know. The usage is clunky (change the JTESTME_HOME values and the aj5 java agent path and test cases in the Windows cmd files) but it works for HelloWorld demonstration purposes (no automatic file modification detection yet).

Categories: Agile / Lean, Coding, Open Source Tags:

JUnit 4 can’t tell the test its name!

May 22nd, 2007 Josh Graham 2 comments

TestCase.getName() was useful from time to time. I recently used it on a project where the name of the test was used as the “client application” name in the database connection properties. This was good for tracking what tests were doing in the database when they made use of stored procedures (by using SQLSleuth for example).

JUnit 4 does not have any out-of-the-box mechanism for a test case to get it’s own name (including during setup and teardown).

JUnit 4 has some interesting architectural changes under-the-covers (some of which we’ll touch on shortly), but the main change to the outside world was the use of annotations to drive the testing framework.

Previously, we used framework-imposed conventions — like test cases must be public void methods whose name starts with “test” in a class that extends a subclass of TestCase, and de facto conventions — like tests are in the “test” source tree and, if a unit test, have the name of the class they’re testing with the suffix (or prefix) “Test”.

The TestCase base class came with some nice properties, like getting the name of the current test case.

<siderant>
Is the new API so much more fabulous than the old? As Jason Yip asked me, “Does it make you write your tests any better?”. For my piece of the apple pie, I don’t think so.
<\siderant>

So, as JUnit 4 does not use inheritence from TestCase, you lose the properties the base class provided, and that includes getName(). So how does my test case know it’s name?

Before you reach for your Throwable, it’s no good just looking at the stack because @Before and @After methods may want to know the test case name too, and their method name isn’t it.

It turns out that this little gem was not included in the gift-wrapped functionality of JUnit 4. I had a little hunt around and found a posting by Gabriel Cooper that held the key. I set about testing it and making sure the global mutable state the technique requires was at least thread-safe.

Here’s the result. Hopefully something of it’s like appears in the default runner sometime soon (and it could do it in it’s run() method without messing around with listeners).

Visit the ThoughtWorks Sydney GeekNight code repository to have a look at the full Eclipse project with multi-threading tests (also has some nice use of Futures to assist in testing for thread-safety).

Categories: Agile / Lean, Coding, Open Source Tags:

Whole Team Collaboration

September 11th, 2006 Josh Graham 1 comment

Through Jason Yip to Kathy Sierra about using Venn Diagrams rather than hierarchies.

Here’s something I gave to a client a year ago showing how collaboration increases success and efficiencies.

(The original powerpoint slide animated the growing circles).


Categories: Agile / Lean Tags: