Dennis Laumen

We who cut mere stones must always be envisioning cathedrals.

The Design of iOS 7: Simply Confusing →

Last monday Apple gave us a sneak peek at iOS 7. This update introduces a bold new visual style for an OS which was, frankly, starting to look a little stale1. Although I like the direction Apple took I think the execution is severely lacking. Especially some of the icons are atrocious. What I find interesting about the new look though is the blend of flat design with the use of distinct visual panes. It makes the OS look a bit less sterile than Windows (Phone) 8 for example. iOS 7 does have some of the same downsides as other flat UIs, most notably the buttons which I always fail to recognize as buttons2.

I’m really hoping this was an early look and the final version is way more polished than the peek Apple gave us this week. I think Joshua Topolsky nails it in his article on The Verge:

Apple is showing that it can adapt, borrow, and tweak ideas from the competition, that it can expand what iOS feels and looks like as well as what it can do. The problem now is that it seems to be buckling a bit under the weight of an end-to-end redesign. I’m hopeful that in the next few months, as Apple ramps up for the introduction of new hardware at its fall event, some of the design and functionality issues that have yet to be addressed will be nipped and tucked.


  1. I still prefer it over its direct competitors though.

  2. This is a problem in most flat designs I’ve seen to date.

Published by Wercker!

This post was automatically published by Wercker! Wercker is a Dutch startup company which aims to make continuous delivery easy. I just added the Github repository of my Octopress blog, added a YAML file, and clicked some buttons in a slick web interface and my blog posts are automatically published once I push them to GitHub. Nice!

Given-When-Then With Spock

As a recent newcomer to the Groovy and Grails world I only recently discovered Spock. Spock is a testing and specifications framework for Groovy applications (but Java apps are welcome too!).

One of the nice features of Spock is the support for so-called blocks. These blocks start with simple labels like when and then. These labels can even be decorated with a nice description which explains in natural language what the blocks are intended for.

Most of the examples of Spock specifications look like this:

1
2
3
4
5
6
7
8
9
def 'pushing an element on the stack'() { // A nice description of the feature!
    when: // This is an example of a block, it starts here and ends at the next block or the end of the method.
    stack.push(elem)

    then: // These blocks don't even have labels, I'll show them in a minute!
    !stack.empty
    stack.size() == 1
    stack.peek() == elem
}

Although this is fine in and of itself I prefer to structure my tests according to a user story’s acceptance criteria. When doing this I use the now ubiquitous given-when-then scenarios as defined by Dan North and Chris Stevenson.

For example, consider the following user story (the following examples are from Dan North’s excellent article I just linked to):

+Title: Customer withdraws cash+
As a customer,
I want to withdraw cash from an ATM,
so that I don’t have to wait in line at the bank.

One of the possible given-when-then scenarios looks like this:

+Scenario 1: Account is in credit+
Given the account is in credit
And the card is valid
And the dispenser contains cash
When the customer requests cash
Then ensure the account is debited
And ensure cash is dispensed
And ensure the card is returned

Unfortunately, I couldn’t find anything hinting at support for these scenarios using Spock (like given and and blocks). As per usual, I wasn’t looking very well as Spock gives you all the needed information in its documentation. I wrote this blog post anyway just to help the folks googling for “spock given-when-then” and “spock acceptance criteria” (and to remind myself of my own oversight of course!).

Using Spock’s aforementioned support for blocks and labels one could implement the scenario above as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def 'Account is in credit'() {
    given: 'the account is in credit' // Look a label! Like I promised earlier!
    def account = new Account()
    account.credit = 2000

    and: 'the card is valid'
    def card = new Card()
    card.valid = true
    card.account = account

    and: 'the dispenser contains cash'
    def dispenser = new Dispenser()
    dispenser.cash = 25000

    when: 'the customer requests cash'
    dispenser.requestCash(100, card)

    then: 'ensure the account is debited'
    account.credit == 1900 // No explicit assertion API, lovely! 

    and: 'ensure cash is dispensed'
    dispenser.cash == 24900

    and: 'ensure the card is returned'
    !dispenser.hasCard
}

I think it looks and reads great! What I especially like about Spock is that it’s really flexible and powerful but has a minimalist syntax.

So, are you still looking for nice specification framework for Groovy (or Java)? Stop looking, go download Spock!

The Soundtrack to April 2013 →

Another month, another Soundtrack by Phil Wilce. If you’re interested in new music this series of Spotify playlists are must-listens!

April is fully loaded. 50 live rounds. All hit the bulls-eye.

From the raucous hellfire of Major Lazer and Tyga. To the deadly sniper attack of Misty Miller and Kodaline.

There are carefully picked-off targets from the new albums by Peace, Low, Devendra Banhart and Steve Mason

And a brutal attack from Vision.

http://www.twitter.com/iamnottheenemy + http://thesoundtrackto.tumblr.com

Aim. Fire. This is the Soundtrack to April 2013.

Meet the Man Who Sold His Fate to Investors at $1 a Share →

Fascinating article about a guy who decides to become a publicly traded person. Shareholders vote on pretty much every big decision he makes.

Then, on August 10, 2008, Merrill asked the shareholders to decide whether he should get a vasectomy. He didn’t tell McCormick that he was going to bring them in on it. As the CEO of himself, he simply wrote a note to his shareholders explaining his position on the subject. “Children are a financial drain,” Merrill wrote. “The time investment of raising a child is immense. The responsibility is epic. The impact on future projects would be drastic. In light of these factors, it makes sense to reduce the chances to nearly zero and have a vasectomy performed.”

Wow. Buy your shares at KmikeyM.