Some Things

Some things once done can never be undone Some things not done can never be done Some things once said can never be unsaid Some things unsaid can never be said Some things permanent are now broken and scattered Some things temporary still remain solid and fixed Some moments will never come again...

Goodbye WordPress

Goodbye self-hosted WordPress. It’s been educational but I’m tired of the maintenance, security risks, and the spam. This blog was created when I was beginning to explore my options and I’ve decided that its future does not require a publishing platform. From now on this blog will be a static site, currently generated by Jekyll. I’ve migrated the posts but not the comments. If you feel the need to get in touch you can find me on Twitter....

Consumer-Driven Contract Tests

The most useful way I’ve seen such contract tests work is that the team that consumes the messages creates and publishes an artifact in their build pipeline for use by the creators of the messages. For this example let’s have it create a tarball with a shell script entry point. The inputs to the shell script can be a URL to the api-server and any other parameters required, like user IDs, oauth tokens, etc....

Zero-downtime deployments

For some time now I’ve been thinking about all the different approaches that I have seen and heard with the goal of zero-downtime deployment for a horizontally-scaled application that relies on a database or some form of persistent storage. On most of the projects that I have worked on this was not a requirement, although a speedy and automated deployment was preferred. However, other projects were for websites and applications that formed the backbone of a 24/7 company and as such the idea of even a couple of minutes downtime was unacceptable....

Conversations with Spring

Not that long ago I gave a ThoughtWorks geek night presentation on Post-Redirect-Get and how to mess with the Spring Framework to make it happen. I've put up the presentation and the code that I used for it on GitHub. Feedback is always welcome....

Caffeine

Caffeine is my shepherd; I shall not doze. It maketh me to wake in green pastures; It leadeth me beyond the sleeping masses. It restoreth my buzz; It leadeth me in the paths of consciousness for its name's sake. Yea, though I walk through the valley of the shadow of addiction, I will fear no Equal™; For thou art with me; thy cream and thy sugar they comfort me. Thou preparest a carafe before me in the presence of The Starbucks;...

Test definitions for developers

One of the best descriptions of the hierarchy of tests that I have seen comes from "Growing Object-Oriented Software, Guided by Tests" by Steve Freeman and Nat Price. 1. Acceptance Tests: Does the whole system work? 2. Integration Tests: Does our code work against code we can't change? 3. Unit Tests: Do our objects do the right thing, are they convenient to work with? Can we now get on with some work, rather than discussing definitions ad nauseam?...

Testing anti-patterns for developers

I've been saving this rant for a while now: 1. Test everything at the front-end, in exquisite detail - every project sponsor understands what tooltip 0 really means. Also a great idea if you like long-running and fragile tests that require deployments, browsers, testing frameworks and the kitchen sink. Testing at different layers, and perhaps even without a browser or (in java) a servlet container is for the weak. 2. Perform a database cleanup before and after every test, whether it needs to be done or not....

Logging Guidelines

Logging - this is something we as developers do very badly - perhaps we need to ban the debugger. Unless you've worked in first-line support or in OPS, the only time you ever look at a log file is as a last resort. This is unfortunate, since the last resort may occur when you are trying to figure out why someone has lost money or when your company is about to be sued by a client (usually for losing their money, video, kids photo, etc)....

Reading code Vs searching code

Modern IDEs now allow you to search for a class or a file and go to it from the search results. On my last few projects I've seen developers using this feature almost exclusively rather than navigating their code tree. This is a very nice feature that I really enjoy using but does it have a dark side? I'm an old school hacker and I like to know how my_code is structured - its packages, dependencies, web root folders, output folders for the IDE and for automated build scripts, etc....