Unstable Terrain

Software development in the real world

Archive for February 2011

Testing JUnit 4 Exception Messages

leave a comment »

In previous years, I have tested exceptions in JUnit tests using variations on the

try {
  doSomething();
  fail();
} catch (Exception expected) {
  assertEquals("Invalid Number of Foos", expected.getMessage());
}

pattern. Various upgrades such as codifying it into an AssertThrows class and checking the correct exception type have helped but it was a pretty ordinary solution.

Changing to JUnit 4 allowed for the annotation below:

@Test(expected=IllegalArgumentException.class)

… but testing the exception message remained ugly.

JUnit 4.7 has a neat upgrade: testing that thrown exceptions have particular messages.

For example:

public class BuilderTest {
  @Rule
  public ExpectedException thrown = ExpectedException.none();

  @Test
  public void invalidMessagesShouldThrowAutoPopulateException() {
    thrown.expect(InternalAssertionError.class);
    thrown.expectMessage("too many autopopulate errors");

    builder.build(createGroupWithTooManyAutoPopulateAnnotations());
  }
}

It also accepts a Hamcrest-style matcher if you want to do something more complicated.

Written by Trent

February 18, 2011 at 4:19 pm

Posted in Software Development, Tools

Tagged with , ,

Growing Pains at CCP Games

with 2 comments

CCP Games is the company that develops the MMO game I play. In the last decade, it has grown from from a startup to a respectably-sized software game studio in three countries and employing hundreds of staff. It also holds the largest party in Iceland every year to celebrate its games, but considering that CCP has more customers than people in Iceland, this may not be so noteworthy.

It has also, anecdotally and otherwise, shown that it is struggling with growing pains, and while CCP has exceptional public-relations skills, cracks are beginning to show in key metrics such as player count and player retention.

One web site that is populated with current and ex-EVE players is Scrapheap Challenge. It has a high percentage of burnt-out players (also called :bittervets:) but also has some stunningly insightful threads and posts about Eve, CCP and, sometimes, society in general. Perhaps a degree of bitterness is inherent in a user base that cares about the game so much.

A thread that caught my eye was about CCP’s latest customer survey, which segued into ‘What This Says About CCP’s Internal Politics” which in turn spawned this wall-of-text post (possibly NSFW). An excerpt is reproduced below:

But this isn’t some new and unheard of phenomenon. […] the basic story is always the same:

A group of people have some plan, and through luck and a lot of hard work they actually succeed in getting something to market. Doesn’t matter if it’s games or clothes, or something else.

Now in the beginning, that small group of people, they all know each other well. The ‘boss’ is basically the guy sitting next to you in the office, eating from the same pizza at dinner, and you have beer afterwards in the same pub. Communication lines are short, and business matters are talked about pretty openly within a group of friends.

But then the success requires more people to come in. And soon, what was a group of friends all working closely together turns in the little separate groups each with specific tasks and discussions. No more shouting around the room: “This is now about dragons in space.” and everything joining in the laughter. Each group has its own targets, it’s own responsibility, and don’t share the same bathroom any more. Sure, there is the raving homosexual-tank, the gym, the free food, but there’s us and them too.

The old boys/group of friends is still there of course, and as they are there the longest, they naturally float to the top of the food-chain. They are now little bosses in their own right, and have responsibilities for their own to attend to. Now there’s a lot of group dynamic, but basically, the new kids on the block are left out of the most of the discussion on business matters, or really anything that matters, really. They are new, you don’t know if you can trust them, we’ve been here longer, we know what is going on, just let them do the job we assign them, and lets keep the discussion among ourselves.

But now comes the hard part. And that is that some of the old group are nice guys to have beer with, and hang around with, but not all of them are necessarily fit to run part of the show. In fact, some are really not fit to be anything except grunts, however long they’ve been there. And some of these new guys maybe new, but they may actually do know what they are talking about, perhaps even more so then some of the old friend group from the beginning.

How to deal with all that is difficult, but essential, and some of the old boys group, especially if they are sub-par, they aren’t quite ready to let go of the reigns of influence. And this is where all the Chinese whispers come in. Who does he think he is (anyone really)? Let’s not have a procedure for staff development; before you know it, they’ve out developed me? You are one of the old group, ofcourse you deserve to earn more. To bad he’s so good at his job, but if we promote him, he could eventually replace me. I want to be one of the old boys as well, so lets make sure they like me. And so on and so forth.

It happens all the time when companies grow from a couple of friends into a proper outfit. Hell, it even happens in outfits that are old! Shit like this is ancient!

And these problems are what you are reading about […]. All those guys were not part of the in-crowd, otherwise they’d still be there. And they weren’t meant to be part of the in-crowd either. So no more information sharing then is necessary with those guys. People who don’t know enough about things can’t make a point. No career advancement plan or employee development plan, that can only make them more indispensable and the old friend group less so. A lot of old hands basically more interested in hanging on to their own position of ‘power’ and ‘influence’ than actually pushing the company forward. And certainly not more transparency or accountability, because, god forbid, some in the old friends group has to basically tell one of the other old friends that he’s just not good enough for the position he’s in. No, far easier to just fire one of the new guys, with little or no warning or reason behind it. Let’s keep the grunts all scared for their livelihood, mostly in the dark about what’s going on, on low pay and with little encouragement to do something exceptional. That way, we, who haven’t really grown along with the company, but who are still in charge here, we, the old left-over of the old friend-group, can keep all the cards to ourselves, keep our cushy over-paid position, and keep smacking down all possible threats to that position.

This isn’t just about information hoarding, that’s just an instrument. This is about bullying. Bullying everyone in submission, keeping them as much as possible in the dark, smacking down any challenge, and maintaining the old hands in the position they know, in their hearts of hearts, they are really not good enough for. Cutting down everything down above your level is a most effective way of making sure no-one notices how poorly you actually are at your job. Especially if you have the power to do so. String along some wannabes as and when you need them. Divide and conquer. This shit is so old and recognisable.

Now, as I said, CCP isn’t particularly exceptional in this. It really happens a lot when small ‘group of friends’ companies grow into companies proper. It is perhaps a particularly crass example of it, mostly I suspect because of cultural influence (on an island where everyone is related, firing someone means upsetting half the island about it, and this may, and probably will, include some of your own family members. And more of that), but all such growing companies go through a phase like this. We’re now a couple of years after those reviews though, and it astonishes me that from what we hear and see, this stuff still hasn’t been resolved. This is what […] I mean with little kingdom syndrome, and a segregated workforce, and all those fancy words.

Good competent management, or rather, upper-management, at one point recognise what is going on. Still doesn’t mean that it is easy to deal with (unless you delight in upsetting the relatives, in this example), but they recognise that this is a threat to the longevity of the company as a whole. Because, as you said, and lets not mince words here, this is what brings companies down from the inside.

It’s not just incompetence. Incompetence is always a problem to look out for, but without the group dynamic, it can be measured (hence the emphasis on :metrics:) and be dealt with quite effectively. But with the group dynamic, the favouritism, this is much harder. This is why like-minded people, for example, ex-CSM [CCP player representatives] who tow the line, get a job at CCP. This is why people who know what they are doing, are good at it, after a while just give up and leave, or fall into near total apathy. This is why NDAs are slapped on so many things, because if word came out to the public, the whole house of cards would collapse. And this is especially why these clingers-on hate the current CSM. Because the current CSM doesn’t take bullshit, is more professional than they are, exposes shit that shouldn’t become known to the grunts and the public, demands a level of accountability that the in-crowd can never live up to and never has been able to (What? Someone can ask my why I want to do stuff? That wasn’t in the contract!), etc., etc., etc.

And, before you start wondering, this is also why [scrapheap challenge] isn’t particularly liked with the in-crowd. Ohh, fuck it, let’s call them by their proper name, by Team Awesome. Because between all the +1s, lolcats, pics of dongs, epic smackdowns, electric boobylube threads, etc., we do actually play this game (well, some of us), and call bullshit on things when we see it. Team Awesome can’t control what we say on our internet spaceships forum, that’s one thing, and we expose for shit the crap that Team Awesome peddles out (if only for the lulz) but which it wants to keep hidden from their own grunts and their own players. Seriously, I’m laughing my ass off. PCR Media Solutions Inc. (of whatever their name is), actually collects all our stuff, and hands a summary of it to CCP leadership (not to CCP grunts, no, that would be too much now, wouldn’t it be! Not that it would matter). That’s right, it’s hilarious, it is easier to get your message through to CCP leadership sperging on this forum than it is actually working for CCP!

Now, what needs to be done by CCP is clear. It’s not going to be easy, by no means, but there are countless examples to learn from. It’s going to be hard for CCP’s upper-management to smack-down on their friends. They’re probably not going to be best-friends-forever (no relationship to the team that’s doing excellent work fixing EVE BTW) with those guys. And there will be some awkward moments at the dinner table, no doubt. And that invitation of the first or second birthday party to you godson or daughter. That’ll probably not land in your mailbox either.

But guess what, being in charge means showing leadership, and that means making hard decisions. It’s lonely at the top, but don’t worry, you get paid well for the privilege, and you’ll be laughing all the way to the bank, so stop complaining. Please stop buying into the reminiscing about dragons in space and lag-fest 3000 player fights, and do the job you get paid well for: make the hard decisions, and move on. The first and practically only directive of a company is to secure it’s financial future. This shit is a direct threat to it. Seriously, deal with it and move on to the next phase. It’s about time now, most of the people involved are losing patience, and that includes your customers. We’re sick an tired of being called terrorists and worse. Get your damn ship in order already!

Passionate, crude, but insightful.

Perhaps you know of other companies where this situation has arisen?

Written by Trent

February 6, 2011 at 11:09 pm

Posted in games, Organisational Theory

Tagged with

The Little Things

leave a comment »

The app I’m developing on has a log file, as most apps do. This afternoon, I noticed this in the logs:

01/02/2011 12:00
01/02/2011 13:00
01/02/2011 14:00
01/02/2011 15:00

Just a nice debugging message to show that the appserver and app’s still up and logging still works, even with no activity.

Innocuous, but a nice touch.

Written by Trent

February 1, 2011 at 5:54 pm