Our debut hackathon

We truly went into the unknown when we hacked away White Rabbit at the Readmill hackathon last month. It was our first hackathon; we neither knew what to expect nor what was expected of us. I had been sitting on this app idea for over a year now and it was the perfect opportunity to get it started.

Acknowledging my own failures, I do value punctuality and driving long distances in Australia comes as no surprise. So I found myself often querying Google maps to figure out how long it would take me to get places. From there, figuring out at what time I should leave was not rocket science, but I also had to be conscious of when that time came. So, the app was simple, it would tell you exactly when you had to leave to make it to your next appointment on time.

The hack in a nutshell

We started by looking into the Google Maps API, sorting through the wealth of info it returns and figuring out how to test the app with the Android emulator. After some time, we could read our calendar events, synced from our Gmail calendar and figure out how far the event was and thus when to leave to get there on time. We were pretty happy but the hack didn’t look like an app. Not yet.

The rest of the early morning was spent digging up the Internet for some cool icons, beautifying the app and most importantly running the app as a service. The idea being, that a cute rabbit would pop up in your status bar whenever it was time to leave for your next appointment.

The screenshots

So, 20 hours later, the sun rose and ta-da, we had our hack fit for demo. With the ability to turn notifications on or off, the app only consisted of one simple screen and would then just run in the background.

Whenever it was time to leave, a notification would pop up in the status bar and it could be expanded to show the event in details.

The upshot

A rewarding weekend filled with caffeine, ping pong, pizzas and falafel.

Where are we now?

You might have picked up that the app name changed somewhere along the way; please read on.

It surprised us that Google had not implemented such a feature, given that all the data was there. This was back before Google Now came out last year and we had not revisited our thoughts for a while. We do know now that Google has indeed implemented this feature.

We also found out that there existed a White Rabbit app on Google Play released in December last year. It was most disappointing that the existing White Rabbit app didn’t make use of any graphics or reference to Alice in wonderland. We never thought that White Rabbit was this unique concept or unique name for that matter, but still heart-brokenly renamed our app “I’m late I’m late!”.

Nevertheless, I just wanted to dedicate this blog entry to our app that will remain for us, our first hack.

The repo is up on Github here.

Learning from Mistakes

Recently our Android app; Open Secret Santa received a user review that was actually useful.

That in of itself is probably newsworthy, if you’ve ever had the misfortune of attempting to track down bugs from single sentence problem descriptions containing nothing more than some vague indication that something didn’t work and a brief treatise on how your app sucks, then you’ll understand what getting value from user reviews on Google Play is like.

In this case, the review provided a complete description of the failure scenario, which in lead in turn to the uncovering of a bug, how testing was inadequate and a rethink about how I should have written some of our code to make it more testable in the first place.

As explained in my previous post, the Draw Engine is a library I wrote that is responsible for creating Secret Santa draws using a mapping between participants and the other participants to whom they restricted from giving. Refer to the Draw Engine source code on GitHub.

The review reported -

The program looks good, but when I tried to use this for our family it said it couldn’t draw.

Two married grandparents, two daughters and sons-in-law and two children for each daughter. I restricted spouses from giving to each other. I also restricted the grand children from giving to their siblings or their own parents and the middle generation parents from giving to their own children.

Maybe a tough challenge, but everyone should have had at least six people they could give to.

The reviewer seemed to have a good point and given they’d put all this detail into a review I owed it to them to check it out. I tried the scenario using the app on my phone and it worked, hmm. I then wrote a quick unit test to verify the scenario programmatically in the Draw Engine in the hope that I could eliminate the possibility of a faulty Draw Engine and isolate the bug further. That test also passed. Hmm…

Then… I ran the “same” test again and it failed. My attention was then drawn to the code inside the Draw Engine that shuffles the members to faciliate redraws being in a new order.

Collections.shuffle(randomMembers, new Random());

It was then pretty obvious that the algorithm was failing due to the variation in the order the nodes were being visited, which was being determined by the Random object.

The code in the BasicDrawEngine was updated, but I was still surprised that I’d managed to miss the problem initially. After all, this was the part of the app I was most confident in! But, it was clear that I wasn’t actually able to exercise all the states and path of the algorithm by simply varying the input. I hadn’t and couldn’t test it properly.

It’s now reasonably obvious that the DrawEngine shouldn’t be responsible for the rerandomisation of the members. This should be performed externally – by the component that actually knows that it’s a redraw (ie in my Android app code). By doing this and providing the randomisation element to the DrawEngine – either explicitly (as a new Random() instance) or via the randomising of the members list order itself then the code can be tested more easily as the test can now better control the execution paths that were previously at the mercy of the Random object hidden deep inside the engine.

Interestingly enough, I recently stumbled upon an old-ish but relevant article that explains the principles I’ve just described, especially in the context of testability. The article (and my experiences!) certainly gave me a better understanding on how my method signature choices failed me and how designing for test pays off.

Most importantly; I can say that a Google Play review actually managed to help a developer find a problem – surely that’s a first!


ps- You can track the testing refactor here.

Refactored Draw Engine code now on Github

I’ve just finished (perhaps) refactoring the Draw Engine source code of our Android app Open Secret Santa and have pushed it out to Github.

The Draw Engine code is responsible for creating the Secret Santa draws from a list of participants and the other participants that they are restricted from giving to. It’s not Android dependent and there’s a whole range of possible algorithms that could be used to generate the result.

The idea behind the refactoring was to make the Draw Engine more modular, rather than just being another package in the app. This would then make code more reusable and simplify the process of iteracting with the open source world; the new module can simply be employed directly as a Git submodule.

I’ve also added tests that allow collaborators to verify new engine implementations as they are created.

Finally, I’ve moved to using a Maven based build system, due to the better integration with Jenkins and Sonar which I have employed to track code coverage in the Draw Engine and the application itself. The Android archetypes available will make the release process much simpler too.

Anyway, take a look at the repo. I’m still getting a handle on some of the technologies, so feedback is appreciated.


GeekGirl Meetup Berlin 2012

Back in July, word of the September meetup in Berlin had already made its way to Melbourne, where I quickly registered to secure a much coveted spot and to be part of the first meetup of its kind.

Having never worked with another girl in over 5 years in the industry, I was looking forward to meeting other female software engineers and it sure delivered!

There was something; a feeling of happiness, relief, comfort or awe as I looked around the Betahaus filled with others like me. The feelings were shared and it just clicked.

The organisation was spot-on, as speakers took their 30 minutes slot to share their knowledge and experience across a range of topics. With the caveat being that for every talk I attended, I also missed out on the two that were happening simultaneously in different rooms, amongst my top picks:

  • User-centred Social Media Strategies where @hypercatalecta practiced what she preached and delivered a simple yet powerful presentation and showcasing one of their own wonder. Check out the video Nike The Chance.
  • Stupid Human Tricks for Successful Agile Development from @trixolina who was as funny as she was accurate about how to boost productivity in the workplace.The speech has been recorded and is online here.
  • From PageRank to DiscoRank: make your search results swing, which took us into the Next SoundCloud DiscoRank algorihtm thanks to @utstikkar who managed to get us hooked on matrices.


  •  3 Steps to create self-value at work from Carolina Fernandes Lemos Bonin who was the rebel speaker without a twitter account.

Thanks to all the speakers who were inspiring and more invaluably, female role models often hard to find in our male-dominant industry. It is undeniable that similar personalities and character traits are simply instinctively drawn towards each other and relating to other girls just felt more natural.

Thanks to the organisers @greenemilymay@starkcoffee,  @heidiharman, @anschieN and to the sponsors @SoundCloud and @betahaus for making it possible and giving us a scene where girls from Sweden, Australia, Spain, Italy, England, Mauritius, Brazil, America, Russia, France, China amongst others I’m sure, were able to share a similar job title and so much more.

And without forgetting the Charity Bake Sale raising money for @Camfed.

Read more about the other topics that were covered at the website http://www.geekgirlmeetup.de/

Looking forward to the possibilities ahead and catching up at the next meetup!

Next post: we’ll talk about the testing techniques we’re applying to our Android app from last year; Open Secret Santa as we prepare to release a new version for Christmas 2012!