Tuesday, 19 April 2016

Agile Retrospectives: Ceremony or Sensation?

You put your left leg in, your left leg out. In, out, in, out, you shake it all about. You do the Hokey Cokey and you….. and then two weeks later you have another retrospective.

Just like the Hokey Cokey, many cynics view retrospectives as a bit of a ritual joke dance. Stand ups, retrospectives and kanban boards - “we must be doing it right”, those agile cynics sarcastically grumble.

Yet other people I've worked with are completely besotted with retrospectives. Their feet start to twitch as the minutes tick down to retrospective o'clock and they’re like excited little children dosed to the eyeballs on exploding candy and fizzy drinks.

So retrospectives… ceremony or sensation?

Are your retrospectives a cringeworthy, and mind-numbing ritual or an exciting opportunity to become a better team?

Monday, 28 March 2016

Optimising Team Boundaries For Iteration Is Fundamental To Agile

Nowadays, agile is a hugely ambiguous term. I still cringe when I see or hear the word and I have an agile jar at home where I must deposit a small sum of money each time I say it. However, I think we can all agree that agile’s heartbeats are it’s iterations. Doing things in short cycles to gather feedback and act with insight.

Accordingly, the structure of teams within your organisation and their responsibility has to be conducive to iteration. In my experience it is a fundamental necessity for truly benefiting from agile and continuous delivery.

But many never reach this depth of understanding. They stall at the scrums, the stand ups and the superficial, without realising that the core of the organisation must be optimised for iteration as well.

Self-contained teams with ownership of complete vertical strips of business functionality is the new normal. Teams unburdened from dependencies on other teams with a clear path ahead for relentless iteration.

Saturday, 13 February 2016

Play Framework Conditional Form Mappings

I'm rather partial to Play Framework's form mappings. Their expressiveness sets a benchmark, bettered by no other web framework I've encountered. And I especially love that there is no need for reflection.

However, my colleagues and I at the VOA uncovered a key use-case that the validations do not handle well - conditional mappings; where validation for one field is based on the value of another field.

Initially we hacked away at potential solutions which were complex and messy. We then submitted a pull request to Play which was rejected. Finally, we created and open sourced the play-conditional-form-mapping library.

We believe this library complements the declarative nature of play's inherent form mappings and solves the problem as simply as we could possibly make it. This post is an introduction to the library.

First, let's quickly reason about why this is important from a user's perspective.

Saturday, 23 January 2016

Testing Without Objects - I Like It

Unit testing behaviours that depend only on functions has been a revelation for me. Without the labour of having to mock objects, I find creating tests easier and feel more satisfied with the resulting code which is cleaner, clearer and at-least as expressive.

I'm not here to bash OO or to promote the one true way. With demonstrative code examples I am instead going to continue where I left off in my last post explaining the benefits I am seeing from composing applications mostly of functions and with fewer objects.

Last time I demonstrated the benefits of using just functions and data to create application services. This post shows their benefits on unit testing.

Saturday, 12 December 2015

Functional Application Services

Each business use case or key transaction in your application can be modelled as a unique, explicit application service. Modelled this way, and named as verbs, application services accentuate key business concepts - improving the alignment between your problem domain and codebase.

The traditional object-oriented approach to application services is now being outshone by functional approaches. Functional application services are more explicit, more concise and more maintainable - especially in functional languages like Scala.

In this post I’ll take you through an example of how I’m doing application services in Scala. The concepts are beginner-level functional programming, though they are definitely a stepping stone toward deeper functional patterns and concepts.

Note: A sample application to accompany this post is on my github. For a similar blog post demonstrating this pattern in C# I highly recommend checking out Mike Hadlow's blog.

Sunday, 15 November 2015

API Testing Patterns for the Play Framework

A robust suite of end-to-end tests for your APIs gives you the confidence to iterate and move quickly. With APIs being easier and faster to test than web frontends, the invaluable benefits of testing come at a low cost of investment.

Two of the key challenges when creating API tests are expressing the desired system-level behaviors precisely and, more technically focused, deciding how to cover external dependencies.

After a few years of working with the Play Framework I’d like to share a few of the testing patterns I am using to both solve the challenges just mentioned and create tests effortlessly and productively.

Sample code to accompany this blog post, including a vagrant dev environment, is available on my github.

Wednesday, 21 October 2015

Strict JSON Deserialization with Enum Validation

It's important to validate data sent to your APIs. Silently ignoring unrecognised fields or not detecting and rejecting values outside of the allowable range is a dangerous way for errors to go undetected.

Clients will be calling your API, getting a 200 response and blissfully assuming everything is wonderfully integrated. Enraged customers will eventually find the problem and it won't result in you getting a pay rise.

These risks are especially inherent to JSON APIs. With XML we have XSDs to enforce the schema. We haven't quite got there with JSON yet, so it's vital to be extra vigilant in your code.

I recently found out that it's actually not as easy as it should be to reject unrecognised JSON fields and out-of-range enum values in Scala (using the Play Framework).