On Unit Testing

I hate unit testing, I also love unit testing; not like Marmite, I always hate Marmite.

Unit testing is one of those things, in my experience at least, that every developer dislikes doing – particularly in a TDD team. Working using TDD feels completely backwards (initially, at least); you don’t have any code to test, so how could you possibly write any tests? But more importantly, unit testing takes the developer away from the developing, from what they enjoy, and in their mind, from what they’re employed to do.

This is wrong, and developers should know it – deep down, I actually think a lot of developers do know this – testing is not a bad thing, and certainly isn’t something to avoid like a plague. Automated testing is a painful process to start adhering to, and even painful to support as the software grows. I’d definitely say that it’s worth it over time, because as the source code continues to grow, and be refactored, the automated testing should at least give peace of mind when making changes.

I don’t have any references for anything I’ve said so far, it’s all opinion, and I’ve yet to work anywhere that has unit testing nailed down; I’ve certainly worked in places where the intention is there, and there’s even some unit tests, but they’re often not kept up-to-date, or cover a tiny percentage of the codebase. Personally, in a non-professional sense, there’s one reason I like unit testing – the passing of tests.

Unit Test passes

Who doesn’t like things to pass?

This may just be me, but I feel a huge sense of satisfaction when I’ve written a unit test and I see the little green ticks against the test (I’m very aware this is an image of Visual Studio/ReSharper’s unit testing UI, but I’m sure unit test results are similar in other IDE’s). I always have the small niggling doubt in the back of my mind that the test is wrong, but that’s when I can go back and check. The test has passed, so now I can relax knowing that the result of what I was testing is what the expected result was. Sure I’m going to get tests that fail, but that’s the point, it highlight’s that something is wrong (even if that something is the test itself).

I’m not always for unit testing, however. I’ve seen some places where people insist on unit testing a UI; I don’t get that, it seems like a lot of effort for very little gain, particularly as UI’s are much more prone to changing than back-end/business logic. I’m happy for someone to prove me wrong if there’s a convincing argument for why I’m wrong, but as things stand I can’t think of any time I’d want to unit test a UI.

All that being said, however, I still can’t find bring myself to write a unit test, so for now I’ll have to rely on good old-fashioned test plans.

Working With Flux

Sadly, not flux capacitors; happily, a short post, because there’s not much to say. I’m talking about f.lux, small application that has made quite a noticeable impact on my daily usage of computers.

The concept is fairly straightforward, and I think the flux website does a much better job at explaining it than I ever could:

it makes the color of your computer’s display adapt to the time of day, warm at night and like sunlight during the day.

It’s even possible that you’re staying up too late because of your computer. You could use f.lux because it makes you sleep better, or you could just use it just because it makes your computer look better.

Essentially, the application reduces the amount of blue in your screen as the sun sets, meaning your display gets a much warmer tone. I originally started using f.lux at work; due to the location of my desk, I notice the diminishing light quite quickly, and found that the brightness of the monitors was a little too much to class as ‘comfortable’. This is the main reason I use f.lux – it makes using a computer in lower light settings much, much more comfortable, I find the screen to be easier on my eyes, so I can work later in more comfort, or I can use my computer at home later at night without straining my eyes.

You may be thinking, “I design X, so I need to see the colour as correctly as I can”, well you can disable f.lux for an hour, or until sunrise, or for an hour. The point is, that you can disable it to suit your needs, and then just re-enable it afterwards

The best part, in my mind, is that it’s free. There is no charge to use the application, all I wish is that I could have it on my phone without jailbreaking it. Regardless, I’d easily recommend f.lux, at the very least, it’s worth a try.

Getting Things Done

I’m fairly new to the concept of Getting Things Done (GTD), in fact, I suspect like many people, I’ve been introduced to it partly from the Free App of the Week promotion on iOS, where Things from Cultured Code is free for both iPhone and iPad – they’re separate apps – until the 28th (and the desktop application is discounted by 30%).

I’m not going to try and explain the concepts of GTD to you, there’s plenty about it online, and actually found this video to be quite helpful in helping me figure out how I should be using Things. This blog post was actually one of the tasks I had in my ‘Next’ list…admittedly for the last 3 days, but today I’m finally checking it off!

I think one of the reasons I’ll probably keep on using things is partly because I’m very prone to saying that I’ll do something, or that I need to do something, but then completely forgetting about it. I can remember to do things regularly; like go to work on week days, or shower in the morning, or eat… I can only assume, therefore, that I’ll be good at remembering to review items I have in Things. As soon as those items are in ‘Today’, I’ll have to move them or do them, because I don’t like having badge icons on my phone.

For me personally, I think something like this will be more of a benefit than I currently think, purely because (as mentioned above) I frequently forget what I needed to do. Adding the things I need to do to the Inbox just to get them off my mind has already been a benefit (even though I’ve only added around 15 items so far…).

While there are other software solutions available to use, such as OmniFocus, but for now I’m going to stick with Things and see how that goes. Who knows, maybe it’ll even help me keep up with writing posts on here (and thereby improve my writing!) – I already have another post I want to write…

Relocation, relocation, relocation

Rather than just mimicking the phrase “location, location, location”, there have been 3 things that have moved recently.

My Job
I recently moved job, after finding that I wasn’t enjoying things there anymore. An added bonus is the whole career progression aspect, but also the new experiences and people I’ll meet. Not to mention the table tennis, which I really need to improve on!

My Home
A mere 6 weeks after getting married, my new wife and I were told that we had to move, as the landlord of the place we were living had sold it. Cue a mad rush to find somewhere else to live! Luckily we’ve found somewhere that’s bigger and not much more expensive, and generally better for us than where we were, so with hindsight, a nice turn of events.

My Server
I believe I’ve mentioned his before, but my server is hosted with Digital Ocean. I’ve had nothing but good experiences with them; sure I’ve had to use their support a couple of times, but not because of reliability issues, more to understand how to do something with the control panel, or a billing type issue. I had to use their support again the other day, when I tried to move this server over to the new London data centre they launched, following an error when transferring a snapshot from the Amsterdam DC to London. The initial ticket, and subsequent responses were all received within 45 minutes – nothing marked as urgent, that’s just the response time for ‘normal’ users. Can’t argue with that!

A short 5 minutes (plus DNS propagation time) after the snapshot was in London, I’d got the server up and configured in a new home. If only moving house was so easy…

Office for iPad

Most of the people I know, and I suspect, most people that own an iPad, knew it was a ‘when’ Office for iPad was going to get released, rather than if. After new CEO Satya Nadella announced Office for iPad (or rather, Word, Excel, and PowerPoint) earlier today, along with Azure Active Directory, I had a couple of thoughts, which I’m going to share here.

Firstly, perhaps most importantly, is a view I think many share. This release comes far too late. Now, granted, the new flatter look of iOS 7 compliments the UI of Office 2013, open which Office for iPad is clearly based, but it’s still too late. Particularly now Apple give iWork away with any iOS device purchased since September last year. Microsoft should have released this a year ago, at least; the reason for the delay could be anything, and what’s done is done. Business users will likely get onboard with this release quite quickly, but I’d be willing to bet it’s only going to be those that are almost fully invested in a Microsoft environment.

Office for iPad uses a ‘freemium’ business model (I hate that word…), in that it’s free for all users to download, and they can view documents just as they would on the PC/Mac versions of Office. To edit, however, you need a subscription to Office 365. Currently, until Microsoft release the Personal Plan, the cheapest option is £80 per year, or £8 per month (it’s actually £79.99 and £7.99 respectively, but let’s not fall for that), or $100 yearly / $10 pcm in the US. This isn’t an extortionate amount, but I know that for some people, that’s going to price it out of their reach, when it could come in quite handy for them.

Taking my fiancée as an example (or if you’re reading this 9 days after it’s been posted, my wife); her job required quite a bit of travelling between locations, as well as a fair amount of work preparing documents, so she used Pages on her iPad. It was perfect, save for the having to convert to Word documents to send to people, and convert back when opening email attachments. Pages handles it fine, but it’d be nice to avoid that step and use something familiar throughout the document’s lifecycle (e.g. Office for iPad).

Now, I’m by no means a business expert, but surely not including an in-app purchase to enable editing of documents was short-sighted, and a big mistake? Sure, if they take the approach of free app updates when the next version of Office is out, then some users get a really, really cheap deal from an in-app purchase, but if a new app is released, where Office 365 users get the editing functionality by signing in, and another in-app upgrade is available for those without 365, then Microsoft get the best of both worlds? I genuinely cannot understand the decision to not take that approach, it certainly rules the use of it out for me.

The final thing that I think was missing, is an updated version of Office for Mac. It’s been 3 years since a new version was released, and it’d be nice to bring the whole UI in line with the new iPad apps and Office 2013 for Windows. It’s a much needed update that I hope is one of the things Satya Nadella said we’d be hearing about in the ‘next few weeks’.

Aside from the things noted above, I can’t fault the app’s Microsoft have developed here, without checking out the editing side of things, they look incredible, anybody who’s used a modern (i.e. Ribbon UI) version of Office will feel right at home… I just can’t shake the feeling that this won’t quite be the launch people thought it would be.