Commented code is a bad code smell

This is a rant about commented code.

Have you ever seen projects with many thousands of line of code that have a significant portion of the code commented out ? I am not talking about descriptive or explanatory comments about what the code does – I mean where the code block itself is commented …

Leaving the commented code in an application lowers the readability of code in the application. Today, source control systems are ubiquitous in software projects – so why do people still comment code and leave it rather than deleting it completely? It simply serves no purpose other than increasing code bloat.

We all do it of course – usually while debugging or understanding code. To discover if a piece of code is used in the application – it is sometimes easy to simply comment the code and let the compiler tell you where it is called from.

But, once we finish we should ether delete the commented code or un-comment it. Commenting code is, at best, a stop gap measure and IMHO a rank code smell indicating that you should probably create a code branch for your code for your experimentation.

It is quite tedious and frustrating to have to pick out the blocks of actual code from between the often, vast stretches, of commented code. Let us, as professional developers, develop the habit of never leaving any such code cruft in anything that we check in to a project !

, ,

Advertisements

What is TED ?

TED is simply a gathering of the remarkable minds to talk about and listen to ideas that they think are worth spreading.  At a glance these are the facts about this organization –

  1. TED started out in 1984 as conference bringing together people from three worlds : Technology, Entertainment, Design.
  2. It was acquired (in 2001) by a Non Profit – The Sapling Foundation. Under the foundation TED has evolved beyond a conference in Long Beach to a have global presence with conferences in US (TEDConference), Europe (TEDGlobal) and India (TEDIndia). The curator of the foundation (and the conference) is Chris Anderson.
  3. The scope of the conference has also become broader to include subject matter, to cover almost all aspects of science and culture.
  4. The conference is very difficult to attend and is by invitation only – in fact there have been claims that it is elitist and the folks at TED have responded to this claim.

All this is public record – but, IMHO what makes TED different is – the quality of the speeches and that they are publicly available on the internet.

The speakers at TED range from business tycoons like Bill Gates, Jeff Bezos, and Richard Branson to political figures like Bill Clinton, Al Gore and Gordon Brown to artists like Bono , Ze Frank and Frank Gehry (there are a lot more including Stephen Hawking, Jane Goodall, Nandan Nilekani, ….- you get the idea).  What moves them ? What excites them ? What do they feel is going to change the world ? These are the topics that they are invited to speak on for 18 minutes. There is a TED Prize – 3 winners are chosen every year from the conference and they get support from the TED organization for “One wish to change the world”. I guess there is something about the experience that seems to bring out the best from the audience, and the speakers, because the presentations made here are simply awesome !

The other aspect of TED and indeed the one that made me aware of them their potential is their endeavor to record and publish all the speeches on their website. The website was started in 2006 is constantly evolving with the latest social networking (Chris Anderson is on twitter) and awesome high quality video. This was what really made me go – whoa… and grasp the power of the conference. I suspect this is also what brought TED to the mainstream and captured the imagination of people like me, who would never have even heard of such a conference otherwise.

Some videos worth watching are –

  1. Hans Rosling – Best stats you have ever seen
  2. Pranav Mistry – Sixth Sense Technology
  3. Karen Armstrong – Charter for compassion
  4. George Whiteside – Postage Stamp Lab

There is some really inspiring stuff  here – I sincerely recommend that you bookmark this website and add it to your reminder list to visit on a regular basis – get motivated and inspired !!

, ,

A podcast review – Software Engineering Radio

I am a fan of podcasting.. video blogging and screen casts are fine, but in terms of convenience and bang for the megabyte – nothing beats a podcast :-). I have been listening to podcasts for a few years now. I am usually listening when walking home from work or doing some chores. In fact I wrote an earlier postabout them along with some of my favorites (at the time).Of late I have listened a lot to a podcast called Software Engineering Radio. Actually, I have been listening to this one for a long time now and it has grown from strength to strength. It was started by a German software consultant – Markus Voelter and is based in Europe (the details are here). There is now a team of people both creating episodes as well as supporting the website. A new episode is published every 10 days and the feed for it is available at the website.

The podcast is about the software engineering and is for professional developers (it says so in the title :-)).  IMHO it is the best podcast for professional developers I have come across.  Markus and his team of volunteers do a great job – the interviews are professionally done and the audio quality is great. The post production is also very well done – in fact they have put up videos about their recording and post-production process. All the recording are released as part of Creative Commons 2.5 license and I think the majority of the episodes are gems worth downloading and keeping.

The coolest thing about Software Engineering Radio and what ultimately makes it such a great resource are the subjects and the people they interview.

The subjects are for the most part about software engineering practice – but they are things that are really useful to ones growth as a software professional. Episodes range from discussions about software development methodology to software languages and tools to computer science research.  In fact there was recently a very interesting episode on the – Difference between Software Engineering and Computer Science.

The people interviewed range from professional software developers and consultants to researchers and academics. Some are giants in their field and others I haven’t heard of (admittedly thats a large percentage of them – maybe because I hadn’t heard of their field in the first place ;-)).

Another thing I would like to mention is the format of the episodes. They are interviews and the team at SE Radio
go to great lengths to prepare and ask just the right questions to
illuminate the topic at completely and extract pearls of wisdom from
the people they interview. I think this format is better than a speech or a presentation because of the interaction between the interviewer and the interviewed.

There is sometimes a problem with the English accent – most of the team are from mainland Europe and have European accents, but it is never so bad that one cannot understand what is being said. In fact one of the things I like about the show are the various accents of people from different parts of Europe, UK and America. It makes the show more interesting to me as I try to guess at the nationalities of the interviewer and interviewed from their accents ;-)

, ,

What is Adobe Flash,Flex and AIR?

Ever since the Internet started becoming a platform for business, people have been working on ways to enhance the limitations of HTML.  One way to do this was to get the user to download and install extensions to the basic browser platform that had the capabilities to run the code used to create regular user interfaces. Several companies introduced various different types of extension – some of the notable efforts in this space are Microsoft with ActiveX controls, Sun with Java Applets and Adobe with Flash. In this post I am going to talk a bit about Adobe’s products in this space.

Over the past couple of years Adobe has been on a platform expansion binge and have significantly added to their capabilities as a web development platform alternative to Microsoft’s .NET and Sun’s Java. So lets start at the beginning – first Adobe introduced the Flash player which was essentially an animation and video platform with some development features (Adobe Flash uses a language called Actionscript) .

As the concept of Rich Internet Applications (as these extensions came to be called) started getting more traction and mind share with the advent of AJAX based technologies – Adobe introduced the AIR platform and the Adobe Flex framework.

The AIR (Adobe Integrated Runtime) platform is a cross platform runtime on which one can deploy applications built using Adobe Flash, HML, AJAX or Adobe Flex on the desktop. Thus AIR is a means by which the developer of an RIA application can extend their presence on to the computers desktop and become independent of the browser.

The Adobe Flex Framework is a bit like Microsoft XAML or Mozilla XUL in that it is uses an XML based language (called MXML) that you use to describe your user interface. You can use in conjunction Actionscript to create applications Flex is an Adobe framework that leverages the Adobe AIR and Adobe Flash run-times. While the framework itself is open source (it’s not free though), the underlying run-times that it targets are proprietary (though I believe they now support the WebKit HTML engine as well which is an open source run-time). Both AIR and the Flex Framework are freely available, Adobe sells an eclipse based tool called Flex Builder that lets easily build powerful applications using the Flex Framework.

A predecessor to all these frameworks you might want to consider is OpenLaszlo.
It is open source framework I came across a couple of years back that
was already supporting flash and I believe now they support a wide
variety of platforms.

Another interesting open source project in this space is Curl which is an MIT project

The competition have not been standing still, however. Microsoft has unveiled Microsoft Silverlight and it’s open source (Mono) counterpart Moonlight, Mozilla has the Prism project and Sun has JavaFX. I don’t know much about Prism or JavaFX but I haven’ seen much traction around either of them.

Finally the HTML 5 specification got off the ground. It has started addressing some of the fundamental issues with the HTML specification and introduced elements for richer media than text like audio and video (along the same lines as image). The web-browser space has also started embracing the specification working to include support for these elements – AFAIK – Opera, Firefox’s Gecko engine and Google Chrome’s Webkit engine are neck and neck in their effort  to support HTML 5 specification with IE 8 following them.

, , ,

Visual Studio .NET 2003 and Windows 7 can get along – Seriously…

I know, I know – VS.NET 2003 is not supported on Windows Vista and above.  In fact Microsoft in their all-knowing wisdom went ahead and supported Visual Studio 6.0 on Vista, but not VS.NET 2003 !!

I don’t know if this speaks to the crappy nature of the VS.NET 2003 product or to weird resource constraints or some other theory (insert favorite MS conspiracy theory here) . The list of supported versions of the Visual Studio product line are AFAIK as follows-

  • Visual Studio 6.0 – Supported on Windows 7
  • Visual Studio 2002 – Not supported on Windows 7
  • Visual Studio 2003 – Not supported on Windows 7
  • Visual Studio 2005 SP 1- Supported on Windows 7
  • Visual Studio 2008 – Supported on Windows 7

So VS.NET 2003 and Window 7 are officially not on speaking terms – but the fact remains I need VS.NET 2003 for my job. Just because MS does not support it – I can’t NOT use it so despite all the warnings we went ahead and installed the darn thing and you know what – it installs – and runs (after a fashion)!  The annoying dialog declaring that the program is not supported is easily dismissed – there is a check box allowing you to block it from appearing again.  Debugging needs you to run in administrator mode – you can set this by right-clicking the shortcut choosing properties and then the compatibility sub-tab – there is a check-box to always run the program as administrator.

The next challenge was VS.NET 2003 refused to load my web projects so I went about looking for a way to set this up…  I opened up the IIS manager and boy let me tell you the IIS manager for IIS 7 is totally different from the IIS 5.0 and IIS 6.0 managers. You can configure everything down to the individual web.config files with this thing. Luckily running ASP.NET 1.1 on IIS7 is supported even though VS.NET 2003 is not so MS provided some helpful articles on IIS.NET – I found this article whose instructions I followed. There were some further gotchas that I encountered that you might be interested in knowing about –

  • I installed VS.NET 2003 SP1 to overcome a compilation problem. Apparently SP1 addresses these issues that occur when you have solutions with a large number of projects.
  • A weird thing is that sometimes the client scripts that are installed with ASP.NET 1.1 do not get properly installed – you need to run “aspnet_regiis” utility with the “-c” option from the command line to ensure it is properly installed.
  • I needed to install “Directory Browsing” from “Control Panel -> Programs -> Turn Windows Features On and Off ” and then switch on directory browsing for the main web-root (theoretically you can over-ride the web-root setting in the individual web project using the web.config files but ASP.NET 1.1 project web.config files are not supported apparently). You need directory browsing to be available in order to add the web-project to your solution from VS.NET 2003
  • You need to be part of the debugger users group on your computer in order to be able to do F5 debugging of your web project.
  • If you want to search across a project or a solution  to work then you need to tweak the compatibility settings . You can do this by right clicking the shortcut to launch VS.NET 2003 and selecting properties, choosing the “Compatibility” sub-tab and then checking “Disable Desktop Compositing” as well as “Disable Visual Themes” .(I got this tip from an answer to a question I posted on Stack Overflow).
  • If you partition your hard drive, make sure you allocate at least double what you used to allocate for the system (C:) drive when you were running on windows – not only is Windows 7 bigger, it needs more RAM and consequently your pagefile is bigger as well. Not to mention you will inevitably install VS.NET 2008 as well as VS.NET 2003 (after all that is the future right) and all the other goodies you had ;-)

Once you have done all this, things are more or less OK – performance is not much better or worse than XP but that’s probably more VS.NET 2003 than Windows 7.  So despite all the warnings and recommendations to use XP in a virtual machine (with 2 GB of RAM at my disposal – yeah right!!) here I am running VS.NET 2003 on Windows 7.  Overall, I think Windows 7 is a cool OS but the experience for me is marred due to reality of having to coax it to work with VS.NET 2003. In my firm – moving everything (and there is a LOT)  to a newer version of .NET is quite understandably a low priority given the economic climate – besides by the time we discuss and negotiate and decide to move MS has already come out with a newer version of everything ;-).

Well HTH  :-)

Take care y’all and be good ;-)

Update: Another blog entry you might be interested in is here.

,

Books Ahoy !

I am a bookworm – this is not a particular new or startling revelation to anyone who knows me. This particular love affair was fanned by my father who has a fetish for collecting things – books are one of these things :-) Over the years I have read a lot of books… I read comics and novels and magazines and newspapers. I read encyclopedias and almanacs and a whole lot of Readers Digest – I love their condensed books. I am the type of guy who will read the backs of cans or the small print in advertisements while waiting in lines :-)

Once I left college and entered the software industry – I became fascinated by the internet and awed  by the amount of information that was available. As my life became more and more nomadic (I was a software consultant) I found it difficult to carry around books (stupid international travel regulations restricting baggage to 30Kgs !) and buying books everywhere I went, while tempting, was way too expensive. Instead the addictive power of Google and broadband connections drew me to the flickering glow of the computer/laptop monitor.

Then suddenly blogging and RSS became mainstream and all of a sudden I was facing information overload. Bombarded by news items, article, opinions, rants, podcasts (I think podcasts a brilliant for certain situations – more here) and video blogging – there weren’t simply weren’t enough hours in the day to keep up!  I started feeling the computer and the broadband connection becoming a leash tethering me the glowing screen. I missed being able to lie on my back and or curling up on a couch with a book.  I bought a laptop and then a PDA (this was back before the iPod and way before smart-phones). Neither were satisfactory solutions – the laptop was too cumbersome, I was scared of dropping it and the battery life sucked. The PDA had more potential but had neither a big enough screen nor satisfactory software.

Last year I moved back home to Trivandrum (Kerala, India) – I looked at all the shelves lined with familiar classics from my childhood and promptly started reading them again (the lack of a reliable broadband internet connection played a part as well I admit). I found some of my colleagues at work shared my love for books and got recommendations, which I blended with my own list of books I wanted to read.   Then I went to the local bookstore and bought some books (actually I bought a whole lot of books) :-)

It feels good to be back reading books – I have broadband but it is not un-limited so I am more picky in what I use it for (software and media downloads mostly). I think I manage to grasp and read more using a book – I think the fact that unlike the computer there are no distractions or options helps one focus more and get deeper into the experience.

The price of books in India is a pleasant surprise compared to international book prices :-) There are few hard-covers and the books aren’t published using high quality paper but I can live with that. The only thing I miss is access to some of the comics/graphic novels I had when I was in America :-( I have heard of  the Kindle from Amazon and I think it’s brilliant – it is however – still a long way away from replacing a books.

PS: I have signed up for an online bookshelf called Readernaut check it out – you can signup if your are interested :-)

PPS: I am on Shelfari as well

Prototype It!

So I saw this post today – it’s by Paul Buchheit a former Googler (he is one of the founders of FriendFeed) and the lead developer of one of my all time favorite software applications – GMail (it was his 20% project at Google) and it’s about the concept of Communicating with code.

Paul writes (in his post) on the concept of  using prototypes  to communicate ideas and concepts. He talks about his work with GMail and how he threw together a prototype in order to show the idea of targeted ads in GMail – targeted ads was not a priority until the prototype showed how useful and interesting it could be. The post ends with a similar exercise that he has done using the Friendfeed API (it’s pretty cool – check it out :-)) The reason I read this post and decided to blog about it is that it talks about developer communication – a topic that I wrote about in another post .

Communicating ideas through prototypes is a great idea – I have always noticed that people get more excited about something they can play with and try out. In fact this is old news in other industries – the auto industry, for example, spends millions to make concept cars to introduce new ideas to the public and solicit feedback Architects likewise – build scale models of their ideas to present to clients. So why don’t we adopt these ideas ? After all we are always talking about “software architecture” and “software construction” and other civil engineering analogies when we talk of software development ;-)

My experience is that when the term “prototype” comes up in software development projects most people are thinking of mock-ups. This is especially true in the web-development shops where there is a separate team of graphics designers creating HTML and image pictures of the user interface while a separate team of developers get to “build” the application from the pictures :-) I think this is a very limiting thing.Prototypes should not be limited to the user experience or to presenting and communicating new ideas. I like to make prototypes of my technical solutions to software problems. For example, if you are trying out this great new idea you had on caching data – write a prototype application – the absolute simplest application you can use to exercise your idea.  This would provide you with feedback on whether your idea is valid as well as show up gotchas or limitations in your design.  The pragmatic programmers in their seminal book – The Pragmatic Programmer refereed to these applications as “Tracer bullets”.

Sometimes the concepts or ideas themselves are large and need a lot of programming to even build the prototype(tracer bullet). In these cases I still believe one must prototype the concept – so the question remains – how do you do this ?
Well one way would be to take the approach Paul took in building the initial GMail prototype – modify some existing code. I find sitting in front of a blank file makes the task ahead seem even bigger than it is – so I start with a piece of code to modify even if it is something as simple as a “Hello World” application.  Another good place to look is in the open source forums (though this might be a problem if you are working in a  company that does not allow open source software) – usually there is some variation on your concept that you could work with there :-). A third option is to accumulate code, links and other resources over time that you can use to jump start your coding.

So – Happy Prototyping :-)

Setting up Ubuntu 8.04 Server on VirtualBox

Yesterday, I was trying to install Ubuntu 8.04 server on my desktop using VirtualBox to set up a virtual LAMP server to play with.

VirtualBox is a virtualizer software like VM-Ware or Virtual PC. It is supported by Sun and is the the only one which is open source. It’s a pretty slick piece of software and  comes with a set of pre built host environments on which you can install various operating systems.  It has a nice intuitive user interface and pretty full featured.

So, I started off on my installation – picked Ubuntu host environment and assigned 512 MB of RAM and 10GB for the hard drive. Then I pointed it to the Ubuntu 8.04 server install ISO and off I went through the install. The install itself went off without any problems – I chose the LAMP server setup and everything went smoothly. The problem was after the install when I tried to boot up the server – I got the following error –

The kernel requires the following features not present on the CPU

0:6

Unable to boot - please use a kernel appropriate for your CPU

So I Googled around for the error and got some blog posts (oh good so I am not crazy :-)) that I went through and I thought I’d summarize it here for reference. So here goes –
The Ubuntu 8.04 Server installation comes with a kernel that assumes that Physical Address Extension (PAE) is enabled in the processor. This is a feature in x86 and x86-64 bit processors that allow them to address more that 4GB of physical address space (which makes sense – this is a server install after all…). This feature is not turned on by default in the VirtualBox software’s virtual processor.  The simple solution is to enable this feature in the VirtualBox software – one does that as follows –

  1. Shutdown the Virtual Machine (VM) instance.
  2. Open the settings on the VM through the VM VirtualBox manager
  3. Go to  -> General -> Advanced -> check Enable PAE/NX
  4. Start your VM
  5. Check to ensure that the Virtual Machine boots properly

That’s it – many thanks to the following bloggers and their blog entries :-)

  1. Hype-Free
  2. Blog Foo

Coding, Puzzles and Mathematics

Coders like to solve problems – the high one gets when one finally ‘cracks’ a problem is one that is as powerful as any drug – they are also alpha males – they don’t like to lose… :-) This powerful combination leads to the traditional image of a pale, pasty, overweight  geek in glasses sitting over a computer screen in the wee hours of the night, mumbling to themselves and ingesting caffeine by the pound.

I’m a bit like that (OK – I am not pale and I like to work in the morning but the rest is similar ;-)) except the problem I might be solving may not even have any real world application. It might simply be a solution to a puzzle !!

This post is about coders and their love of puzzles… Most of us have heard and even experienced the classic puzzle question in interviews for development positions. There are numerous books on this topic (the classic “How Would You Move Mount Fuji? Microsoft’s Cult of Puzzle‘ is a great read) – both about the interviewing techniques as well as methods to solve them. I don’t want to get into a discussion about how good or bad the use of this technique is in interviews (I personally don’t favor them – in the wrong hands they can be horrible – like this one ;-) )

What I like to do is examine the puzzles themselves – puzzles can be of several varieties – one can spend hours and hours over them – indeed some people make it a full-time hobby. There are several puzzle competitions  – one of the most challenging being the MIT Puzzle Hunt (the wikipedia entry is very informative). You also have organization leveraging this interest by posting challenges like the FBI

However, the puzzles that interest me are the ones that have a basis in pure logic. I tend to regard puzzles with an eye to the elegance of the solution. A good logical puzzle with an elegantly simple solution is a thing of beauty – I like to go through the reasoning and try and look for extensions or extrapolations. I look at the assumptions and limitations and try to understand the thought process behind the puzzle.

They are a good way to learn, to get ideas on new approaches.  They expand you mind and  are finally but most importantly – they are FUN. I often use them as a fun way to learn new computer languages – good candidates are mathematical puzzles :-)

Here are some nice links – check them out and happy solving :-)

  1. Maths Challenges – Check out the links section where there are some programming challenges.
  2. Project Euler – Awesome site with some really cool puzzles.
  3. Delphi For Fun – The programs are in Delphi which is aversion of Pascal but it has some nice algorithms.
  4. FBI Ciphers – Ciphers are a fun type of puzzle that kind off go off in to crypt-analysis.
  5. Shine’s Take on IT – My friend Shine is reading “How would you move Mount Fuji?” and is blogging about his read.

Continuous Integration – more than just automated builds

This post is derived from an article by Martin Fowler on Continuous Integration. It my take on Continuous Integration and it’s use.

‘Continuous Integration‘ is a software development practice where members of a team integrate their work frequently; usually each person integrates at least daily – leading to multiple integrations per day. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.

Software development is full of best practices that are talked about at great length and detail but rarely actually done. Continuous integration is one such best practice that has been around under various guises for a long time. Anywhere you have heard or discussed the virtue of having a common build that is done in a regular manner – you are hearing about continuous integration. In fact Microsoft has been doing automated daily builds for years.

The term ‘Continuous Integration (CI)‘  is one that originates in the Agile Programming discipline known as ‘Extreme Programming (XP)‘ as one of its twelve original practices. I believe CI has enough merit that it should be implemented even in projects that are not following XP or other agile development practices.

So how does one go about achieving CI within your software development process?
There are two critical aspects to this effort – evangelizing, educating and mentoring the team in CI practices and creating a repeatable process that allows the team to integrate their code quickly, preferably in an automated fashion.

One of the hardest things to express about CI is how it makes a fundamental shift to the whole development pattern; one that isn’t easy to see if you’ve never worked in an environment that practices it. For many people team development just comes with certain problems that are part of the territory. CI reduces or eliminates these problems, in exchange for a certain amount of discipline. The fundamental benefit of CI is that it removes sessions where people spend time hunting bugs where one person’s work has stepped on someone else’s work without either person realizing what happened. These bugs are hard to find because the problem isn’t in one person’s area, it is in the interaction between two pieces of work. This problem is exacerbated by time. Often integration bugs can be inserted weeks or months before they first manifest themselves. As a result they take a lot of finding. With CI the vast majority of such bugs manifest themselves the same day they were introduced. Furthermore it’s immediately obvious where at least half of the interaction lies. This greatly reduces the scope of the search for the bug. And if you can’t find the bug, you can avoid putting the offending code into the product, so the worst that happens is that you don’t add the feature that also adds the bug. (Of course you may want the feature more than you hate the bug, but at least this way it’s you have the choice.)

Though CI is a practice and so does not need any particular tooling to deploy, it is generally found that automation is a key factor in order to make CI. In order to automate the CI process generally it is recommended that the following is done –

  1. Keep a single place where all the source code lives and where anyone can obtain the current sources from (and previous versions)
  2. Automate the build process so that anyone can use a single command to build the system from the sources
  3. Automate the testing so that you can run a good suite of tests on the system at any time with a single command. (The build does a self test)
  4. Make sure anyone can get a current executable which you are confident is the best executable so far. (The build creates a deployable version of the software)

All of this takes a certain amount of discipline and consistency in the approach. It is difficult to introduce it in a project but once introduced it does not take that much effort to keep it up. So let us examine the points given above in turn.

  1. Keep a single place where all the source code lives and where anyone can obtain the current sources from (and previous versions)
    This is a basic requirement in the software development. Regardless of the size of the team or the complexity of the project all the source code must be available in a single easily accessible location. The versioning requirement means that one must invest in a proper source control system. All the artifacts needed to run the application should, ideally, be located in the source control repository. This would allow the build process to obtain all the resources needed to build the project from a single location.
  2. Automate the build process so that anyone can use a single command to build the system from the sources
    Automated builds are essential to create a repeatable process that can be run on demand. This prevents the occurrence of human error in typically complex systems where in addition to building the source code one must set configuration value, etc in order to produce a deployable application. For complicated projects building the source code itself can be a complicated process involving multiple projects and dependencies. Most major software platforms have build tools that help make these tasks simple.
  3. Automate the testing so that you can run a good suite of tests on the system at any time with a single command. – make your build self testing.
    Traditionally building involves compiling, linking, etc – all the stuff required to make your program run. However simply because your program loads does not mean that it is working correctly. One very effective way to catch bugs is to run a test suite against your program. These test suites should be built so that they can run automatically against the latest build of the software.
  4. Make sure anyone can get a current executable which you are confident is the best executable so far.
    This can be achieved by getting everyone to commit their code to the build often (every day) and ensuring that these commits trigger an automated build every time. This helps ensure that anyone can get the latest workable version of the code at all times – one that passes all the tests. This allows one to be more confident about the code that one is developing will work when merged back in. It also allows testing of the code to be done on the latest version of the code ensuring that bugs being tested are not due to version conflicts or integration issues. It helps testers focus on the changes to the code and identify issues faster as a result. Overall the confidence in the quality of the code is improved.

While CI is a great process – it is like any process only as good as its implementation. There is a abundance of tools out there that do CI or have it as part of their feature set. I will list some that I have dabbled in and heard nice things about –

  • CruiseControl .NET This is a open source tool from ThoughtsWorks .
  • CruiseControl This is the original java version of CruiseControl.NET
  • CI Factory Based in CruiseControl.NET but with a lot of the other agile tools also integrated as well as templates on how to set up your repository, etc :-)
  • Hudson Java tool I have seen nice things written about it’s simplicity.

A good book to read is Continuous Integration: Improving Software Quality and Reducing Risk

Update: A Stack Overflow user was asking about Continuous Integration tools today and I pointed him here – I found another useful link while going through all the answers.

ThoughtsWorks have created a feature matrix for CI tools that seems to have all of the major tools covered – link