2012 March

Three projects and you automate: vagrant development boxes

bneijt

Introduction

We all know the rule in some form or another: three times and you automate. And although I try to apply it, I find myself repeating some things with every new project, like creating a new CI server.

One solution would be to have a centralized server for all your projects, but customers are mostly not willing to depend on services outside of their network, which means you are often stuck with having to create a local solution for each project.

Having done this three times, I decided to start a repository to store scripts to automate development machine setup. One command to get you a fully functional system you only need to tweak to suit your needs. This blog will show you how to quickly set up a Jenkins server on a local virtual machine.

 Read more

Analyzing twitter using JBossESB

jdewinne

Most ESB example start from some HelloWorld use case, where you have to send a message to the ESB and it will print it to the console. In this post I would like to show that you can do a lot more with an ESB, for example reading and analyzing data from social media like twitter.

The example below will demonstrate how you can use JBossESB to retweet every message containing a certain hashtag. If you want you can extend the example and store all the messages to database, or keep track of those users who have posted the most amount of messages with a certain content.

Prerequisites

Step 1) Create a scheduler using JBossESB
When you want to retweet all messages containing a certain hashtag, you need some kind of scheduler that is fired every second, minute or hour. In the jboss-esb.xml file you can do this by using a ‘schedule-provider’.

 Read more

How to improve your TDD skills

Arjan Wulder

Do you think that you do TDD well because you have been doing it for years now? That is what I thought until I did an exercise called “TDD as if you mean it” and it put my feet back on the ground!

At two different TDD workshops I have tried to build an application following the rules of “TDD as if you mean it”. The first time was in Amsterdam at a Coderetreat and the second time at an XKE session at Xebia. Although I am practicing TDD for a while now, the result of the exercises in both sessions were that I had few tests, even less production code and an application that did not work.

 Read more

Voice navigated apps the next hype?

Robert van Loghem

In the 1980′s there was a TV show called Knight Rider, where Michael Knight, a vigilante with his car K.I.T.T would fight bad guys. The thing that made this show special to me was the car. Mr Knight could talk to it, and it would understand what he said and meant and respond meaningfully. Sometimes throwing a witty remark in there. It gave the car, a personality, it was the co-star of the show.

Siri

Now in 2011, Apple released Siri. An assistant where you can ask certain things, like “What is the weather going to be like tomorrow”, and again, just like the car K.I.T.T., it responds with the correct information. In the above case, the weather for tomorrow based on your current location. If i ask Siri “What THE answer is?”, it sometimes responds with the number 42, this is for nerds and geeks a pretty witty answer (as it is THE answer to THE question in Hitchhikers guide to the galaxy). Thus Siri seems to me, have personality, it answers questions with a certain flavor. For me, in 2011, it was the very first time you could ask almost anything to a device (a mobile phone) and it would (try) to give a smart, witty answer.

Hype?

So is the fact that you are going to talk to your phone and it actually understands what you mean and then responds, something we’re going to see more of in the future or is it just a hype?

 Read more

You do not want agile

Daniel Burm

No really….. you don’t. Well, maybe you do, but the boardroom certainly doesn’t. They have never heard about agile, let alone what it is all about. Is this something that will help us solve our problems or just a new IT buzzword?
 Read more

Apply TDD to Hadoop jobs with Scoobi

Maarten Winkels

Map Reduce is a programming model for writing algorithms that process large quantities of data in a (relatively) short time. The building blocks for the programs are very simple map and reduce functions. Writing programs that do more and more complex tasks to data based on those simple functions becomes harder and harder and thus requires more thorough testing in early stages. This blog attempts to outline a simple method for testing the algorithm of a Map-Reduce program based on scoobi.

 Read more

Creating a simple Test Double for a webservice in NodeJS

Freek Wielstra

It should be common knowledge that for certain types of automated tests, you do not want to rely on the availability of external services for a number of reasons:

  • Uptime of said service (your tests fail if the service is unavailable)
  • Dynamic nature of the data (makes your assertions harder)
  • Execution speed of your tests
  • Excess load generated on the service
  • etc

Ideally, you therefore stub out the external service. Inside your unit tests, you do that using Mock Objects, for example. This is actually harder to do for integration tests – you do not use mock objects in integration tests, because that could change the observed behavior of your application.

In one of our projects, we’ve struggled with this problem for quite some time. There are two major components in it, an iPhone app and a server-side component, which both talk to an external webservice for retrieving the data to display on the app and to work with on the server. In our integration tests, we simply used the production webservice and ran some shallow assertions on the result with varying results.

Recently though, we drew the line. Running integration / UI tests using KIF for iOS on data that changes depending on what time it is ended up in unpredictable results, or assertions that we simply couldn’t make because the data kept changing (and of course because KIF does not have any actual assertions, or is able to match on partially matching UI elements). So we said “Okay, we need predictable results – make that damn fake webservice already.”

What it needed to do was:

  • Return fixed, predictable results with specific, recognised requests
  • Forward the request to the currently used live webservice, so our existing tests don’t all break
  • (later) Add a feature to make the data returned variable, some tests rely on the test data returned to have dates that lie in the future
  • Do not compromise the security – the live webservice requires HTTP authentication.

Of course, it also needed to be done quickly. We postponed making this fake webservice for a while because it seemed like a lot of work, but once we finally decided on making it, we figured “How hard can it be?”. We’ve been waiting for an opportunity to use NodeJS for a while now, and as far as we could see, this was the ideal choice in this case – we have a REST-like webservice (readonly) that mainly does i/o (from the filesystem and the external webservice), and it should be easy and lightweight to build.

So we went to hack in a few steps. Read more for the whole article and the code.

 Read more