Thursday, June 01, 2006

EDA Lessons Learned - Build and SCM

See EDA Lessons Learned for the list

Everyone's favorite topic - build and SCM ;)

SCM is a hot topic within my company right now. For whatever reason, people get very excited/emotional about this topic (myself included). After living with various SCM tools, I prefer simple ones that aren't a barrier to distributed development. I actually used to like ClearCase - a lot. But now I think that it is overly complex and is a barrier to distributed development. ClearCase absolutely must be installed on a LAN for it to work - this forces a replication model for distributed development. This results in too much complexity for my taste and makes it very difficult to truly collaborate at the code level. There are OSS and commercial SCM products that were designed from the ground up to facilitate distributed development. Pick one of them if your developers are all over the world.

These lessons learned are from a large EDA style application, but like many of my lessons learned, it is applicable to a SOA project or any large integration project. I do not (yet) have an approach for company-wide SCM for SOA/EDA. That is certainly more complicated.

I knew a lot of this stuff from previous jobs, but walked into this project as it was in full development. It took *significant* effort to reorganize and fix. Like many things, planning from the beginning would have saved a ton of effort. Here is a list:

  1. Plan the SCM repository carefully

    Don't have too many roots - don't have too few roots. Under the root, service, shared, web directories with modules beneath works well for us.

  2. Branching model

    Choose carefully - here is a good article on branching models. I prefer "branch by purpose" - it keeps it as "simple as possible, but not simpler" as my boy A. Einstein would say.

  3. Keep build simple
    • Developer should be able to run entire build locally easily
    • Developer should be able to build just required modules (i.e., shouldn’t have to run entire thing if just working on 1 service)
    • Developer should be able to make changes to the build (avoid single threading it through the build guy)
  4. Deploy beefy build box

    Buy a nice high end workstation with plenty of memory and 2 very fast processors for a build box. You don't want the build to run on the build guy's local machine. It is much easier to automate from a centralized official build box IMHO. Anyone with access should be able SSH to the build box and launch a build. At a previous job, we even had a web page that allowed developers to launch builds (way to go Sarge)

  5. Write and maintain simple instructions to get new developer’s environment setup
    Shouldn’t take more then an hour
  6. Configuration

    Either keep config files for each environment (e.g., dev, test, prod) under source control and have deploy script use appropriate configs or script the setup of each environment. You don't want to do this by hand. This can be difficult with vendor products that want to invade your entire SDLC. Ensure that your vendors have deployment friendly support

  7. Avoid Maven

    I am not up to speed on the latest version of Maven. I understand it is supposed to be better so take this with a grain of salt. At one point we had competing builds - Ant and Maven. Ant won because it is simpler and more people understand it well. We do use the Maven directory structure, however. I'll leave it at that.

  8. Don't mandate a particular IDE

    Quickest way to piss off developers is to mandate an IDE. The build should never mandate an IDE.

  9. Beware of tools that generate code

    If you must use these tools, at least either check in the results of the generated code (can be very dangerous if the code isn't just POJO style) or script the usage of the tool in the build (and watch your developers start to hate the build). And people wonder why I hate generated code ;).

2 comments:

Frederic Gos said...

U forgot one! ;)

I allways tell people that the most important things in build/scm is to automate. Even one manual step and you are toast. You should be able to have the cycle: change ANYTHING related to the product, press a button, look at the result on the deployment box....

fuzzy said...

Frederic - you are right.

Mike