Business-Friendly Functional Programming – Part 1: Asynchronous Operations

Recently, we refactored one of our micro-services in order to apply the Each library. Each is a macro library developed by Thoughtworks that converts native imperative syntax to scalaz‘s monadic expressions. This means that we can write, among other things, asynchronous code with Futures in a plain imperative style.

The micro-service is a Scala application that serves as a RESTful server. It receives requests from browsers. For each of the requests, the micro-service fetches data from other internal RESTful servers, composites these data into one response, and sends the response to browsers.
Continue reading

How we used Category Theory to solve a problem in Java

A few months ago, my colleague Chris Myers and I used some basic category theory concepts to guide us to a design that elegantly solved a problem in a Java codebase.

It isn’t the only way we could have arrived at the design; anyone could have done it, really! However, you might find it interesting to see what practical application of these ideas can look like. Importantly, category theory gives us a framework to shed light on what makes many good design concepts useful, and why. Continue reading

Another epic Tech23

Pitching @ Tech23

“Invention is a solo event. Innovation is almost always a team sport.” – Larry Marshall, CEO CSIRO

This is just one of the stellar quotes that came out of the seventh annual Tech23 event on 17 November in Sydney. The event celebrates Australian innovation by connecting investors, and entrepreneurs from across enterprise, government, university and industry sectors.

23 young companies with high growth potential and technical expertise pitched their stories and problems they’re tackling, with industry experts responding with both insights and advice. But outside of the presentations themselves, one of the most important parts of the event constantly reinforced throughout the day is the connections and collaboration between brilliant people from all walks of the innovation ecosystem. Continue reading

Hack it Forward: Time to give back. Again

In August we held our 2nd ever community and charity based Hack Day at REA: Hack it Forward.

More than 110 people in our Melbourne and Xi’an offices spent two days hacking for social causes, non-profit organisations and helping people in need. This year we partnered with more fantastic groups including:

Yet another wonderful event with 25 projects being tackled in 48 hours by smart, passionate people.

Best of all we captured it all in this little video. Enjoy 🙂

Continue reading

Painless JavaScript testing? Surely you Jest!

title-card

Hark! What is this Jest you speak of?

Jest is an open source JavaScript testing framework built on top of Jasmine, developed by Facebook. Try saying that 10 times fast.

Think of it as several layers of improvement stuck on top of Jasmine. Some of the neat features Jest provides are:

  • Automatically finds tests to run in your project
  • Has in built support for fake DOM APIs, such as jsdom, that you can run from the command line
  • You can test asynchronous code more easily using inbuilt mocked timer functions
  • Tests are run in parallel so they go faster! Vroom vroom.

But the big drawcard is Jest’s automatic mocking of CommonJS dependencies using the require() function. Instead of specifying all the dependencies you want mocked, you do the opposite. For the subject under test, you just use jest.dontMock().

Easy peasy, right? Come with me dear reader, as I spin you a yarn… Two JavaScript test frameworks walk into a bar… Continue reading

The Six QA Hats

Quality assurance does not merely belong to testers but rather belongs to the whole team, so we need to empower everyone on the team with basic testing mind sets in a way that is memorable and enjoyable. Introducing the “Six QA Hats” – a mind-map with six different branches, each of which represents a dimension of focus on testing. The the “Six QA Hats” could help us effectively brainstorm and organise our next major testing activities. Continue reading