andy kelk

Andy Kelk

Chief Information Officer

Walking to LA – could we have done it better with Agile?

You might have read this answer to the question “Why are software development task estimations regularly off by a factor of 2-3?” by Michael Wolfe on Quora; if not, go ahead and read it now. It’s a great analogy and really helps to explain to non-developers why estimations are so often wrong. It also got me thinking about how Agile techniques try and solve the problems of estimation and planning. If we’d been using Agile, what could we have done differently?

I think the first fatal mistake on the journey was indicating a deadline before any work had been done at all. We knew where we were going and we knew roughly how long it might take (or so we thought). How about if we’d set off down the coast and then made the first call to our friends? After the initial difficulties, maybe we’d be more realistic about when we’d reach LA.

But what if we’d come up with that 70 day figure? Typically, there’s three choices: plough on and consider the reward worth the investment; kill the project entirely – turn around and go home; or try and negotiate on scope. How about our friends travel up and meet us somewhere near Hearst Castle? We still get to meet our friends before Easter, although it’s not ideal as they have to do some work they didn’t want to.

The other thing to consider is that our destination may change; maybe our friends move house (good thing we didn’t buy that detailed map of their area, that would have been a waste); or maybe they’ve upped and left entirely and we’ve walked all the way down the coast for nothing - what then? Maybe we should have had different goals – incremental goals that we achieved throughout the journey. Instead of our only pay-off being the meeting with our friends, how could we have delivered value throughout our journey? Well, if we changed our original goal to being a party with all our family and friends, maybe we could have met up with each of our family en route rather than having one big party in LA.

OK, so maybe I am torturing the analogy a bit; maybe you can never find a perfect analogy for software development (I’ve not seen one yet) but the walk down the coast is a great explanatory tool to show how a project that looks simple from the birds-eye view can get sticky once you zoom in.

Moving from Apache to Nginx

As well as hosting sites on the Windows/IIS/.Net platform, we also have quite a few sites that run on the LAMP (Linux/Apache/MySQL/PHP) stack. Although Apache had been tweaked and tuned, we had periodic issues with unexpected load hitting Apache and causing it to slow down or (more often) grind to a halt.

Enter Nginx - the high concurrency webserver that now runs 8.5% of the world’s websites. For running static websites, Nginx seems a no-brainer – it’s dead simple to set up with fewer lines of configuration than Apache and performs admirably under load. Of course, most of the websites we were looking to move had dynamic content to some extent (some WordPress sites; some built with Yii; at least one vanilla, hand-rolled PHP site).

There’s multiple ways to spin this one – from using Nginx as a proxy through to running PHP-FPM (FastCGI Process Manager). In the end, we’ve settled on a set-up using Nginx, spawn-fcgi and PHP. Running on CentOS 5.7, it was remarkably simple to get Nginx up and running – here’s what we did:

  1. Install Nginx
    Installing Nginx is easy if you have the EPEL repository activated. It’s just a simple:

    yum install nginx

    The Nginx config files are located in /etc/nginx

  2. Install spawn-fcgi
    spawn-fcgi is part of the lighttpd project; it runs as a daemon, listening on a port (default is 9000) for connections from the web server. It then manages the spawning of FastCGI processes (PHP in our case). It’s also in the EPEL repos, so go ahead and install it:

    yum install spawn-fcgi
  3. Configure and start spawn-fcgi
    Next up is to configure spawn-fcgi. This is done by editing /etc/sysconfig/spawn-fcgi and providing an OPTIONS environment variable:

    OPTIONS="-u apache -g apache -p 9000 -C 5 -P /var/run/spawn-fcgi.pid -- /usr/bin/php-cgi"

    -u is the user to run as, -g the group to run as, -p is the port to listen on, -C is the number of child processes to spawn for PHP and -P is the pidfile.
    We are running as apache:apache, just to avoid changing any existing file permissions when migrating from Apache. If this is a fresh setup, you might as well run as the nginx user.
    Once that’s done, you can add spawn-fcgi to be started on boot and start it up:

    chkconfig spawn-fcgi on
    service spawn-fcgi start
  4. Configure Nginx
    Here comes the science bit. This step was definitely the most labour-intensive and required a fair bit of manual work, lots of learning and some trial-and-error. We had 21 VirtualHost blocks in our Apache config on one server – each ever-so-slightly different. The basic lessons we learned here:

    • We put each server{} block into its own file in /etc/nginx/conf.d to aid navigation through the files
    • SSL is pretty easy – just follow the example in ssl.conf and paste in the right locations for your SSL certificate/key
    • Simple rewrite rules are quite simple to convert across from mod_rewrite but be sure to put them in a location {} block if appropriate and beware of  using “if”
    • Related to the above, you can use try_files to get WordPress fancy URLs working:
      location / {
          try_files $uri $uri/ /index.php?q=$uri&$args;
      }
    • You can specify one server as a default if a hostname comes through that is not matched:
      listen 80 default_server;
    • Prefixing a hostname with a . is really useful. It matches the exact hostname or any name ending with that value (for example .andykelk will match andykelk.net, www.andykelk.net, blog.andykelk.net, etc). You can also activate this behaviour within a map by using the “hostnames” directive (we have a big map which does a 301 redirect from one hostname to another):
      map $http_host  $name {
          hostnames;
          .singaporepropertyforrent.com              www.iproperty.com.sg;
          [snip ....]
      }
      server {
          server_name _;
          listen 80 default_server;
          rewrite  ^   http://$name/   permanent;
      }
  5. Test your setup
    Of course you need to make sure your nginx configuration is all valid, you can do this with:

    service nginx configtest

    You also will be doing all of this on a test environment, of course, and doing some full testing, right?

  6. Stop Apache
    This is an easy one:

    service httpd stop
  7. Start Nginx
    This is pretty easy too:

    service nginx start
Posted in IT |

As featured in DataManager magazine in Italy

This week, DataManager magazine in Italy published an interview with me about iProperty, online business and IT in general. You can see the article here: http://www.datamanager.it/rivista/cio/iproperty-il-mercato-immobiliare-va-online

As you’d expect, it’s in Italian, so I’ve put a translation (automated, from Google Translate) here:

 

“The non-technical people are much more aware than before on the technology and how to use it, and technicians in order to survive they must understand how to create business value through technology”

 

The real estate market has always been one of the main markets in the world. Recent analysis showed that the decision of purchasing a home mainly thanks to the new technologies is moving online. In particular, according to the survey, the search of the dream would go more often on behalf of external social networks. Ability to compare prices and technical characteristics, speed in acquiring quotes and information and price transparency are just some of the many benefits that customers can now get from an online purchase. The iProperty.com Group is a leader in the Asian market online, with Web sites owned by leaders in Singapore, Malaysia, Hong Kong, India and the Philippines. In 2009, the Group has won the prestigious CNBC Arabiya Asia Pacific Property Awards in the category “Best real estate portal.”We analyzed with Andy Kelk, iProperties IOC to the news in this sector.

 

Data Manager: Can you describe the activity of iProperties? 

Andy Kelk : iProperties is an online media company that operates in real estate in Asia. We offer solutions for real estate agents, builders and other customers who need to reach an audience of property hunters. We have sites with the iProperty.com brand in Singapore, Malaysia, Philippines and India as well as in Hong Kong and GoHome.com.hk rumah123.com in Indonesia. 

What is the role of IT?

As with any online organization, the IT sector is strategic for our business and it is very important to me that IT contributes to business growth, in addition to being a service provider. Our scope is very broad – the design, development, hosting and maintenance of websites we build for our customers, we also also tools that allow real estate agents to manage their ads, we offer services such as email, CRM and management of human resources, develop and support the desktop environment for our employees and our 250 staff in 4 countries.

What are your numbers?

The whole group has more than 2.7 million unique visitors each month, with 46 million page views.  
The IT team of about 50 people representing 20% of the total staff group.  
This year the budget for ‘ IT including salaries, hosting costs, licensing costs, and so on is about 850 thousand dollars. 

Your success is tied to having understood the potential of technology as an enabler for business, what are the steps to success? 

Too often there is a gulf between what is happening in the IT industry compared to what happens in the business.There is often a mentality of “us and them”, which insinuates itself without anyone noticing. I think it’s important that IT teams consider themselves part of the business and not as a separate group. 

Internally, we promote cross-collaboration between the IT team and the rest of the business in different ways. Day after day, we develop software using Agile techniques which place great emphasis on the development team and the product of working together to implement projects. Another important factor is good communication about what each department is doing, using tools like Yammer. We also had great success in creating an event of innovation that has enabled the IT team to invest part of their time to think about what technologies could be used to build something that could benefit the company. The winning team has built an Android application for the search of property that has been launched in two of our markets. 

Your company is based in Malaysia, what is the state of the art development in the IT industry in Asia? 

Asia is rapidly developing in all types of industries. The increasing penetration of Internet and mobile Internet, in particular, are driving the growth. MSC Malaysia status is awarded to companies that promote the technology within the country, there are many investments in Singapore, IDA (InfoComm Development Association) to help technology start-ups and Indonesia is experiencing a real boom in the development of Web giants like Yahoo and Google are opening their development centers here.

Of course, all this leads to competition between companies looking to attract talent, but also guide the great technological communities that are settled in the South-East Asian groups dedicated to Web development, Agile development and technology emerging. 

His team works with Agile software development (Scrum in particular), what are your experiences?

The Agile methodology has been introduced over 2 years ago and I find it an excellent tool for developing software. I would not return to a traditional waterfall development model. 

The Agile is widespread, but not always understood, there is no set of practices that can take them and suddenly become “Agile.” Agile is really a philosophy and a set of principles, rather than something that you can simply read from a book and start applying. The collaboration between customer and development team is an aid in the creation of software, reducing feedback loops, and favoring the formation of self-organized groups who take responsibility, rather than relying on structures hierarchical command and control and practice continuous improvement. 

In the methodology we are following Scrum iProperties regarding the mechanisms of realization of a project team and organization. It is also extremely important in engineering practices are sound and able to support a rapid change. For example, Scrum does not say that you should write unit tests for the code, but if you do not, it will be very difficult to make changes in a predictable time, which makes the execution of the project more difficult. 

What are the projects you’re working? 

One of the major areas in which we are very focused on is mobile . With the massive adoption of mobile devices and the possibility of Internet access from phones and tablets, it is essential that we are ready to offer our services in a convenient way for these users. Mobile users are very busy and the United States at least, there are many more hours spent surfing the Internet on mobile devices than on traditional desktop PC and portable devices. 
We are also working on some changes in our hosting infrastructure. We’ve gone from a handful of physical servers to a set of virtual machines and we are starting to move some of our infrastructure in the Cloud with partners such as Amazon. 

From your point of view, what will happen in the IT industry in the near future? 

The biggest change for IT departments will be transformed into service providers. With the availability of new services for our customers (both internal and external), their expectations of what we offer continues to increase. Offering services such as email and CRM business and make them available on the move will increase the growing expectations of our customers. I also see a big change in the alignment between IT and business – the non-technical people are much more aware than before on the technology and how to use it, and technicians in order to survive they must understand how to create business value through technology.

New look, new blog

This is probably my third or fourth attempt at blogging. I’ve tried restricting myself to various topics before and it’s never really stuck. This time I’m going to go for anything that comes to mind about my life. It may be my topics relevant to my professional life, it may be to do with wherever I am at the time, or it may be something completely random.

Let’s see how long I can last for this time.

 

Featured on ntv7′s Bella

Malaysian television channel ntv7 featured me talking about the iProperty Android app and giving some tips on finding housing.

Behaviour Driven Development – Or “how I learned to stop worrying and love the business”

Behaviour Driven Development – Presentation Transcript

  1. Test Driven Development

    Domain Driven Design

    Behaviour Driven Development

  2. What is BDD?
  3. Why natural language?
  4. How does it deliver business value?
  5. Integrates with TDD:
  6. BDD in action: Cucumber features
  7. The language: Given
  8. The language: When
  9. The language: Then

Pair programming: Making the case for its survival

When we started transitioning to Agile, we were lucky to have support from senior management as well as coaching from external consultants. Part of the deal was that we dived fully into XP including TDD, BDD and pair programming. One of the team rules (that’s literally written on the wall) is that all production code must be done in a pair. Before we moved to Agile we had a very strict peer review policy which mandated that all code committed to source control must be reviewed by another developer. Pairing provides that peer review as well as a whole lot more.

Now that we’re getting more comfortable with Agile and are becoming less reliant on our coaches, there are rumblings (quiet and far off ones, admittedly) around pair programming and I’m starting to feel that I have to justify the practice. I would have hoped by now that the benefits of pairing would have been obvious. It seems I may still have a bit of sell to do. I think I can build a convincing case in favour of pair programming.

  1. You get the product quicker. There have been studies that show pairs complete deliver code quicker than programmers working solo. For example, one study shows that pairs did the same work 40% more quickly [source]. Double the people does not mean double the “man hours”; typically the number of “man” hours spent in total is around 60% more in a pair than with one person working alone.
  2. You get a better product. Overall, teams where pair programming is used produce code with fewer defects than those who work alone. It’s very easy when pairing for one member of the pair to spot simple defects creeping into the code. Ping-pong pairing (where one pair writes the test, the other makes it pass) can also have a big impact as two people will tend to come up with more edge cases than a solo programmer.
  3. You get knowledge sharing. One of the big problems in any organisation can be the creation of “islands of knowledge”. When pairing (and particularly when regularly rotating pairs), everyone gets to touch every part of the system. This means that you don’t end up with one person who is the only one who understands a certain part of the code.
  4. You get skills transfer. Pair programming is a great way for novices to learn from experts. However, beware of assuming that once everyone’s been “trained” that pair programming should be stopped. We also use pairing to cross-skill the team so that, for example, developers learn UI skills.
  5. You don’t waste time. No-one in the team is going to admit it, but if they’re left on their own they waste an awful lot of time. It’s not necessarily malicious, they just reach a roadblock and attention wanders; they read a blog, read some email, check their share portfolio and lose productive time. Not only does having a pair provide peer pressure to keep on working, it also helps prevent you getting to those roadblocks because you have two brains on the one task.
  6. You have happier developers. The developers enjoy pairing – they feel more energised about the tasks they’re doing, they are supported in getting the work done and they are working together as a team. Pair programming can be a leap into the unknown for those who haven’t done it but after taking that leap, the outcome is almost always positive.

Personally I think that number 6 alone is worth doing pairing for, but I know that I’m going to have to work hard to keep pairing as a core part of our development practices.

A home away from home

Look around any office and you’ll see that people love to personalise their space. Like any other office, we have our fair share of personal effects – family photos, fishtanks, novelty items, printouts of webcomics, funny signs (although we’ve stopped short of the “You don’t have to be mad to work here…” variety). It’ll probably come as no surprise, then, that one of the hardest points of the move to Agile & pair programming was the move away from people’s “home” desks.

As mentioned in a previous post, we’ve significantly changed the office layout and are continuing to change with an investment in new desks for the developer pairs to work at. When looking at plans for the Agile areas and assessing the usage of space in the current layout, one thing that soon became obvious was that everyone having their own large desk with a desktop computer and two monitors on when they are pairing for most of their day is not an efficient use of space.

When you come to the bare bones of people’s workspace requirements, they need three things: firstly, a desk at which they can pair with another developer; secondly, a desk they can work at if they’re not pairing (using their MacBook); and thirdly, somewhere to keep their personal items. This can be achieved with a number of “hot” desks that people can rock up at with their laptop and a series of storage areas (cupboards, drawers, etc) for people’s belongings. Personally, I like the idea of hot desking – a change is as good as a rest after all. Even with a desk of my own (strewn with CVs, documents, books and coffee cups as it is), I often find myself lodging in a spare meeting room or sitting in reception in order to get things done away from the distractions of my “normal” work environment.

My concern though is that there’s a risk of de-personalising the work environment if nobody has their own desk. Where do the USB missile launchers, fake fishtanks and kindy masterpieces go then?
There are other things to consider when people lose a “home” desk, such as what happens to the phone they used to call their own? One of my team recently ran into this problem:

I’ve lost my old desk phone. I left it behind after the 4th or 5th desk move, and have no idea where it is. However, people still call it, and leave messages.

I checked my voicemail today, and found a message from the 25th May; my Dad is waiting at reception.

Another of my team spoke of the change from his contracting days when he deliberately made his work area a very personal space in order to offset the feeling of impermanence that contracting can bring. Now he finds himself as a full-time employee but without so much as a picture on his desk.

Ideally I’d like everyone to have some kind of horizontal space they can call their own. It doesn’t need to be a full-sized desk, after all they’re only there 5% of the time; but there should be somewhere you can return to and feel like you’re on your own turf. Ultimately it’ll come down to getting the best possible area for the pairing areas and working out what’s left for personal space, but I’ll do my best to give everyone a home away from home.

The power of the office environment

This may not be news to long-time office dwellers, but the way your work environment looks and operates is really important. Our office has a history with another, very traditional company and the layout really reflects that. It’s nominally open plan (as in, there are no separate offices), but the lines of sight and communication are really closed off. Apart from the pillars and obstructions (a huge compactus which no-one on our floor uses, for example), the partitions between working areas are of a sufficient height to mandate meerkatting if you want to speak to anyone else. The desks all face away from each other and there’s loads of wasted space because of little corner returns on each desk.

When we launched our first pilot Agile project, we found a suitable area, ripped out half the desks and plonked a big, functional table in the middle. Pairing workstations were put on the table and everyone crowded around and started coding. After some initial misgivings about losing personal workspace, the team soon got to enjoy the environment we’d created and it now seems like a natural use of the space.

Soon after, we adopted Kanban work practices for our maintenance and support team; pairing was “encouraged but not mandatory”. Some brave souls had a go, but the desks just aren’t conducive to effective pair programming. They really lend themselves to a “I’m doing some coding, you’re just watching me” behaviour.

So, on launching a second Agile project, I was concerned that getting the pair-programming right was going to be an obstacle to really adopting the rest of the practices. I scouted the office looking for suitable areas where we could put in a central table, but we’d already used our one option for that on the first project. We finally settled on a row of desks at one end of the office that I refer to as the plague pit (although the team have adopted the slightly less doom-laden “play pen” instead). One Friday afternoon, the screwdrivers came out and the pointless corner returns on each of the desks came off. The change from that small action was dramatic – not just in the feeling of space in that part of the office, but also in the ability to line up pairing machines along the desk and have people instantly in an environment where pair-programming seems the natural choice.

Our next step is to do a piecewise refactor of the office environment. The architects have been engaged and we’ve got some cool desk layouts planned for the original Agile area. Our longer term plans also include plenty of whiteboards and spaces for putting up big visible project artifacts. It’ll be great to have a space that was designed with Agile in mind, but we’ve also shown that an office can be moulded into a workable environment with a bit of creativity, some screwdrivers and an investment of time.