Virtual Surreality
It’s too real to be true


Kiva - loans that change lives

May 29, 2008

The value of test names

Filed under: Coding, Agile / Lean, Testing — Josh Graham @ 5:35 pm

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.

April 23, 2008

CruiseControl comes of age. Cruise and relax.

Filed under: Agile / Lean — Josh Graham @ 6:07 pm

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.

March 23, 2008

ThoughtWorks Anthology

Filed under: Coding, Architecture, Agile / Lean, Information Science, Open Source, Reading — Josh Graham @ 6:39 am

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

February 29, 2008

Jamming for Inveneo

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!!

February 16, 2008

Agile Meetup Alliance

Filed under: Agile / Lean, Conference — Josh Graham @ 8:34 am

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.

December 18, 2007

2008 Issues and Opportunities for Australian business

Filed under: Agile / Lean — Josh Graham @ 3:40 pm

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.

September 11, 2007

Dynamically defined Smoke Test Suites for Java

Filed under: Coding, Agile / Lean, Open Source — Josh Graham @ 5:29 pm

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).

May 22, 2007

JUnit 4 can’t tell the test its name!

Filed under: Coding, Agile / Lean, Open Source — Josh Graham @ 6:26 pm

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).

September 11, 2006

Whole Team Collaboration

Filed under: Agile / Lean — Josh Graham @ 8:55 pm

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).


June 7, 2006

Core approach

Filed under: Agile / Lean, Cooking — Josh Graham @ 5:37 pm

Perhaps our core approach to solving problems is much like a sauciƩr making the perfect jus: reduce and test.

This is applied to any part of the information science process — whether it’s strategy, requirements, architecture, design, coding, testing, deployment, or lifecycle management.

Reduce all along the way: Minimise inputs, activities, and outputs to improve clarity, trivialise change, and realise value at the earliest opportunity.

Test all along the way: Verify and validate assumptions and expectations. Discover and evolve understanding. Innovate and execute.

Lean. Assured. Savour the results.

Next Page »

Powered by WordPress

payday loan daily payday cheap long term payday loans cash loans till payday service no fax payday loans asp direct lender payday loans payday loans denver nd news story payday loans outlawing payday loans north dakota cash advance payday loans software califronia payday loans no fax payday loan payday loanonline payday loans no fax payday loans uk poor credit loan construction to south carolina cash advance payday loans payday loans located in stone mountain georgia easy no fax payday loans online payday loans no pay day fax gardena california payday loans payday loans with payback in installments fast cash payday loans in advance kansas city payday loans and cash advance loans payday loans with payments cash loans net payday till payday advance cash til payday loans in atlanta montana payday loan 500 payday loan online payday no fax payday loans payday loans no job credit check payday loans quick cash instant payday loan fast c payday cash loan payday cash loans bad credit payday loans no fax utah cash advance payday loans online payday loans project payday no teletrack payday loans instant payday loan payday loan fraud washington state faxless payday loans cash advance payday loan payday loans online no fax payday loan payday advance loans low fee payday loans geneva roth payday loans payday lenders ten dollar payday loan bad credit payday loans payday candy bar payday loan lenders default payday loan bad credit debt consolidation internet payday loan student no fax payday loans online cash advance loan sonic cash payday loan with no faxing or employment verification savings account payday loans no telecheck payday loans payday loan walpole instant payday loans i need a payday loan immediately payday cash advance legitimate payday loans payday loan with no credit check or no faxing payday max fast cash payday loan cheap payday loans free payday loan payday ok bad credit payday loan payday loans for bad credit sonic payday cash till payday military payday loans payday loan software payday loans online cash advance loan personal payday loans no credit check no faxing no paper consolidation debt loan payday cheap payday loan cash fast loan online payday tendollar payday loan payday loans national cash advance bad credit payday loan payday cash loan online payday loans payday loan p no fax payday loans savings account payday loans uk payday loan no fax payday select faxless payday loan same day payday loans check advance paycheck payday cash loans charlesto personal loans payday loans 1500dollarstoday com easy online payday loans payday cheques easy payday loans low cost payday loans fast cash advances payday loans payday loan relief help state law free payday loans can you tell the payday loans to stop call you at work borrow money now cash advance simple payday loan preferred missouri cash advance and payday loans cheapest payday loans fastbucks instant online payday loans fast cash advance online payday loan new mexico victims of payday loans payday loan manual easy no teletrack or telecheck payday loans no teletrack payday loan payday loans no credit check payday loan by western union i need money now easy payday loan borrow fast advance cash loan online payday payday loans gold coast i want a no teletrack payday loan easy no fax payday loans payday loans no credit check payday loan approved loan online payday payday loans no fax payday loans online payday advance fast where can i buy payday loan forms cash advances advance cash online payday loans pre payday no bank account xtra cash payday loan online cash payday loan online payday loans online sonic payday loan payday paycheck loan quick no fax payday loans online payday loan payday loan canada no fax no bank payday advance loans payday loons without fax free same day payday loans online direct payday lenders no credit checks or faxing online instant fax payday loans online instant no fax payday loans texas cso payday payday advances how to obtain multiple faxless payday loans advance cash payday loans online loan canadian payday loans cheat at payday freecell western union sent payday loan fast payday loan advance cash payday loans online cash advance loan title loan florida auto and payday loans online payday cash advance instant loans payday loans payday loan online cashadvancesusa com low interest payday loans payday cash loans fast usa only payday loans online no faxing up to 241500 genovone roth payday loans canada student loans payday advance mo payday loan payday loan online bad credit cash advance payday loan cash advance loan illinois quick advance advance cash loan payday no requirement payday loan fast payday loans best payday loans payday loan business no fax payday loans online b cash advance b loan completely instant loan payday payday loans with no faxing and instant approval payday loan softwear low rate payday loan payday loan qualifications no bank account payday loan oklahoma fast cash advance payday loan payday scam calls cash day fast loan pay payday quick cash advance payday loan online loans advance cash loan payday payday loan industry statistics no fax or verification payday loans payday loan no fax search long term payday loans magnum low cost payday loan payday loan franchise payday loans no fax no teletrak how to get out of payday loans no income doc payday loans attorney for payday loans nc indian wells payday loan payday cash loan savings account payda military loans online payday loans cash a1paydayad guaranteed payday loan payday loan service new jersey online payday loans savings account payday loan instant payday loans online cash deposit direct fax loan payday cash apply fastest payday loans online litchfield payday loan fast loans bad credit online approval payday quick payday loans online one hour payday loans emerengency no fax payday loans no fax payday advance no credit check bad credit faxless payday loans quick payday loans fast online payday loans criminal prosecution default payday loan louisiana genove payday loans washington cash advance payday loans software attorney for payday loans texas cash advance payday loans software payday loan in florissant missouri direct payday loans quick payday loan low fee payday loan njfastcash personal loans online payday loan payda payday loan cash advance bz credit no fax payday loans faxless payday advance no fax cash zip payday loans miami payday loan cash advance payday loans bad credit payday cash loan scams direct lender payday advance online instant payday loans completely online no teletrack or no fax payday loans texas payday loan stories about westbury ventures payday loans cash advance las vegas payday loans paycheck advance online short term payday loans 500 payday cash advance utah payday loan companies payday loan pay back in 1 week cash advance or payday loan direct payday loan payday loans advance pay day loans online cash advance quick almost instant cash advance payday loans payday loan online refinance home loans loan until payday payday loans in new jersey payday loans auto title bad credit loans andnot payday loan savings account no fax payday loans payday cash advance loans online low interest payday loan payday loans cash advance online payday loans military loans delaware cash advance and payday loans cash advance now payday loan california cash advance cash advance payday loans online cash advance payday colorado advance cash ga in loan payday california cash advance payday loan pay advance payday loans online paycheck advance p advance cash loan payday through union western wired money payday payday payday advance loan payday loans no fax or credit check faxless payday loans no checking account no faxing and no credit check payday loans cash advance loan illinois payday loans online cas no fax cash in 1 hour payday loans emergency advance payday hold personal check cash loans i want a no teletrack and a no telecheck payday loan payday loans fast new improved payday cash advance loans chicago payday loans payday cash loans no faxing all online bad credit loans for military payday loans militar payday loan salt lake city payday loan bad credit knox payday loan payday one cash payday loans online payday loans with no faxing or credit check banks issue payday loans payday loan in chicago illinois