We have a development process which is completely manual. No unit tests, interface tests are manual, and merging and integration are as well. How could we go from this state to implementing continuous integration with full (or at least close to full) automation of build and test? We have a pretty intense development cycle, and are not currently using agile, so switching to agile with CI in one move would be a very complicated and expensive investment. How can we take it slowly, and still moving constantly towards a CI environment?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
The approach I'd take depends on your current needs. Since you're making a process change, it sounds like there's a problem that you're trying to solve. What problem(s) you are trying to solve will change the approach that you take. Eventually, to achieve a good continuous integration environment, you'd want to address all of these issues.
Can you build easily? Your build should be executed by a single command to something like a Makefile or an Ant script or a Maven script, depending on your language and target platform. Simply executing this script should do a complete rebuild and execute any tests that you have. If you don't have this, creating one would quickly make the manual process less painful.
Is your build slow? If your build is slow, I'd look at either starting a regular (nightly?) build or improving your build time as the first step. If you check in to an integration or alpha branch at least once a day, a nightly build would be sufficient. Every night, your build starts and your quality assurance team has a fresh build to work on every morning without downtime in the day waiting for the build to be kicked off manually. If you don't check in every day, it would probably be better to check to see if there are updates before building. The other option would be to improve build performance so that manual builds take less time to execute. When you move to automation, it will allow you to see the results of the build/test cycle faster.
Is your quality poor? If you have poor quality (unstable software, defects detected after shipping), focus on improving and automating your tests first. Create unit tests that can be automatically run (once you automate your build process) and give instantaneous feedback to developers. Also work on automating integration and acceptance tests as much as possible so they can be executed and provide feedback to the developers and quality assurance teams.
There are probably other questions that you can ask, depending on your individual situation. But take it slow. Implement one aspect of a continuous integration culture at a time - automated builds, automated tests, fast builds, instantaneous feedback, visible results of build/test cycles, and automated deployment - starting with the ones that will add the most value to your team.
As you commented that you're using PHP - installing Netbeans for PHP might be a good way to go.
I suggest using Jenkins which allows you to add build scripts but also commit hooks that run on each commit. You don't need to configure your entire build on one day but you can make small steps each day.
For example, you can enhance your build script whenever you have time and you can integrate more build reports or unit testing as you go along. In the beginning Jenkins will create an automatic build on each commit and the build will be done within a second because you have not yet specified any work. This assures you that the system is working and you can then start working towards the build system that you want.
Pick one easy goal, get success and then set another goal. IMHO your first goal should be a nightly build. A long time ago we had deployment problems because of sloppy checkins, bad version numbering, unknown dependencies etc and a nightly build solved a lot of those problems. It gave us a single reliable output for testers, installers, deployment etc. Everyone could be confident that version x.y.z was the latest successful build. No more testing old builds.
Creating a nightly build may create some people problems, you will need a strong sponsor to help you. I hit lots of objections such as 'but that's not how I like to work'. Of course, but the end users don't like the bugs in your work. A good sponsor will assist you with objections.
Creating a automated build will uncover other issues like dependency problems. When you start turning over rocks be prepared to be surprised by what you find underneath. Part of the pain of getting to automation/nightly builds/CI is getting everyone onto the same dependencies/libraries. I wish we had maven back then.
Develop a pitch for an automated build process. Try to find bug reports from the deployers or end users that could have been prevented.
First of all, you don't need to be doing agile to go to a CI deploy environment.
Well, don't we all? Just bite the bullet and do it! No more procrastinating, if the team want to do it, then assign someone (or more) to do it.
If management grumble about being a man down for features for a week, come up with some stats around how much time you think moving to CI will save you. How long does it take to do a manual build? how often does a manual build not work and have to be redone? How often does a environment have to be rebuilt because of a poor manual build etc.
Once you are over those hurdles, figure out:
Start by automating your build. With PHP, this will probably be a shell script. It should do the following things:
This is a basic continuous integration script, although it doesn't do actual testing. You can run this script with
The next step is to add testing. In a perfect world, you've separated your business logic from presentation, and could write PHP scripts that load up your modules and exercise them. I'm guessing this isn't your world.
In which case your first round of tests will probably use
For completely exercising your app, you'll probably want a tool like Selenium.
However you proceed, be sure to mail all of your developers when the build fails. You don't want to leave the build broken, and the person who broke the build may not be the best person to fix it.