Introduction
script>
Rational Unified Process (RUP), Extreme Programming (XP), and Agile methodologies trumpet the benefits of incremental development:. Software, like everything else, is easier to build in small steps than one big bang Building an application daily is an iterative development best practice that helps expose bugs more quickly, raises clients' confidence and paces developers. But when daily build is put in place, a structured approach is required to promote the build and make it available to testers and end users. If not, the daily build quickly becomes unmanageable. This paper describes a build promotion process that we in the Capgemini Technology Consulting group have successfully implemented in a number of large J2EE and .NET software developments. It shows how we have structured our daily build process and structured the build promotion from Development to Production Servers. It Also Addresses The Issues That Arise When Building Daily, And How We Managed THEM. THIS Paper is Organized AS follows. The daily build is first introduced, then a discussion of its positive effects on developers, testers and users is followed by a examination of the issues related to promoting and managing daily builds. Finally, the paper shows how difficult it can be to fix bugs and build databases when building daily. The Daily Build A build refers to the required steps to create a fully functional and executable version of a software application from its basic components (code, database, configuration files, etc.). A good build process MUST:
Be automated and repeatable ie never require human intervention to complete its work. Automation is essential to reap the benefits of the daily build. Be portable to different computers and environments Report the results of its operation to humans that validate the results. Typically this takes the form of e-mails sent to the "build master" Other communication mediums such as Short Message Service (SMS) can also be leveraged Perform multiple operations including but not restricted to:.. Extracting / tagging most recent copy of the code from source control Generate a change log file (useful for identifying who introduced the latest defect) Generate version file identifying date of build and incorporate it in the executable Building the application and its peripherals (documentation, etc.) Packaging the application for deployment Deploying and installing the application To target environments Running Regression Tests Reporting Build Results, Including Success / Failure But Also Build Metri cs Breaking the build is a capital offense Developers who break the build must be identified and, at a minimum, fix the build Authors have devised different incentives to keep the build running:.. have the developer who broke the build wake up at 5AM daily to smoke test the build, have them wear a funny hat, or have them contribute money to the office pool. Use one that works for your team but never tolerate broken builds. The reference section provides additional references on the daily build process. The Positive Impacts of building Daily buildings Your Application Daily HAS NUMEROUS POSITIVE SIDE EFFECTS.
Reduced integration work: developers are encouraged to commit their code as soon as it has been tested This way their code does not get out of sync with the main development branch Developers are also encouraged to get a fresh copy of the source code tree on.. a daily basis, or at least before starting each new feature Quick spotting of defects: new commits in the code repository are included in the next daily build - which occurs at 5AM every morning - and then smoke tested Defects are spotted before developers forget.. . about the code changes they made Furthermore, since the build process also generates a changelog file, it is relatively easy to identify which commit introduced the defect and who is to blame Application quality improvement:. since the whole software is tested on a daily basis Daily Builds Reduce the Risk That New Defects Will Go Unnoticed. Defects Are Spotted and Fixed on a Daily Basis. This prevents defects from account place in the software to the point where A SIG nificant effort would have to be expanded in order to fix them all Progress visibility enhancements:. since the software is built daily, it is easy for the project manager to see which features are there and which ones are not Clients have visibility into the process. and be reassured that milestones will be met Team morale booster:.. seeing the software working provides a good morale boost to the troops This benefit in itself is enough to justify the adoption of this best practice High impact, low maintenance.:
the set-up of an automated daily build process takes time. Once automated, few minutes are needed for the configuration manager to read the e-mail sent by the build script and verify that the build is good. This process is very low maintenance and Does Not Eat Away Valuable Time From The Team'S Busy Schedule.The Build Promotion Process
As we have seen, building daily goes beyond providing a sanity check on coding software. It brings new features or bug fixes that users and testers need to do their work. Once you start to build daily, requests will flow from all around to get the Daily Build Into Their Server. Expect this Behavior Not Only from test button
However, it is clear that you can not push a build every day onto any server. Testers, end users, and support personnel need to have "predictable" behavior from their application, which the daily build can not provide. At the same time, they would LIKE TO HAVE The LATEST BUG FIXES AND New Features That The Daily Build Process Exposes. Having a daily build required
The Diagram Below Summarizes The Build Promotion Process We Have Put in Place.
Figure 1 - the build promotion process
. Build promotion refers to the act of transferring a build from one server to another Promoting a build means copying it to the target server; the build must not be rebuilt but rather simply copied, thus the need to identify and archive builds as they are created .....................................
Daily Build Tips, Tricks, and Traps
Continuous buildsFor large projects or projects where building takes a long time (hours), it is important to build continuously throughout the day. Typically this is done on a dedicated server that reports results and archives builds as it runs. This allows developers to quickly validate if their changes build properly without having to wait for the next daily build or consume their workstation CPU cycles for a long period of time.Development Team SynchronizationWhen using the daily build process, it is essential to make sure the development team members are synchronized to avoid breaking the build. If developers are not synchronized, it is possible for one developer to check in code that builds properly on his workstation but still breaks the build if someone else checked in incompatible code.
To Avoid this Problem, You Must Define During The Day Certain Periods:
Safe check in: during that period anyone can check in code into the version control system This is the default period during the day Safe check out:.. During this period, developers must update their code to match the version control This period typically occurs just after the daily build has been smoke tested and shown not to be broken and lasts 1-2 hours No developer is allowed to check in code during that period No check in or check out:.. during this period no check in or check out is . This is the best.
Managing change: creating patchesWe recommend that builds be promoted at regular intervals, thus continuing the rhythm put in place by the daily build The build promotion process table suggests daily, weekly, monthly and quarterly promotions for daily, QA, staging, and production servers. .Sometimes however, the promotion process can not be as straightforward as the table suggests. For instance, builds that have made it through the unit, smoke, and light integration tests do break during heavy functional testing. Sometimes the failure is major enough that it keeps testers from going any further until a new build fixes the problem. When that happens, the daily build can often fix the problem but it can not be deployed because it introduces new features that are not stable enough for QA, staging, or production servers.
The solution is to patch the build in question (branching the code in the version control database from the point where the build in question was tagged), fix the problem, then promote the patch to the server where the issue exists. For example, testers find that a new account opening feature does not work on the QA server. that bug prevents them from exercising all test cases after account opening. The daily build already has that bug fixed but it can not be promoted to QA server because other features are partially implemented . The account opening feature can be patched rapidly. A new, patched QA build is created and deployed, so as to provide testers with an updated build that lets them continue their tests while the more thorough fix finds its way in the normal build promotion process .
Building DatabasesBuilding Java or .NET applications is relatively simple. Code is stored in a central repository and everything is built together at once. Simple and (relatively) easy to automate. Databases, however, are much more complex to build automatically because the build must not only create the schema but also create data. to make matters worse, often data must be migrated from a previous schema, and this is difficult, sometimes impossible, to automate.Thus, the following must be done to properly promote databases during the build PROCESS:
Re-create the database schema from scratch using SQL or other scripts extracted from the source code control system. This implies that all database schema changes are scripted, which is often not the case. But it can be done with a bit of rigor and constraints , especially in environments where database schema can only be modified by a few database administrators. Recreate the base data from scratch using SQL or other scripts. Again, this is seldom done but can be and should be the default best practice with all teams. Convert ................. ..
As you can see, it is possible to automate the database creation and make it part of the automated daily build process. However, more often than not, you will find that databases are not built daily and are managed in an ad-hoc fashion.
However, extrame programming "lessons learned" [1] Presents a Great Solution to DB Build Issues. It is asset its That:
Three databases are created: gold, silver, and bronze Database schema changes are promoted from bronze, to silver, to gold then finally to production database (which we refer to as the "master database") Database data is migrated from production to gold. , then to silver, and then bronze databases All changes to database schema must be scripted. The sum of all scripts, when applied in sequence, allows database migration to be possible The migration and promotion processes must be automated to ensure that they can be performed Often, Rapidly, And in A Uniform Manner., Howe Too, HOWEVER, AGREE THAT MANAGING Promotion / Migration Scripts Is A Difficult Yet Essential Tasks That Must Be Followed Closely by All All INVOLVED.CONCLUSION
Adopting a daily build process is essential to any software development project. It benefits all team members, from developers to end users. The build script must be customized for each project and fine tuned to map the application's structure and dependencies. Even when available and fully automated in an unbreakable, religious, daily routine, the build process raises issues with end users wishing they could have access as fast as possible to bug fixes and new features. A build release process must be put in place to ensure that appropriate levels of testing and predictability can be ensured for all users. Finally, we have seen how the daily build process creates needs for new developer's procedures, bug fixing shortcuts and non-trivial scripting and controls to ensure database are built along with the code they support.
References
[1] XP and Databases, Extreme Programming Lessons Learned, http://www.extremeprogramming.org/stories/testdb.html[2] Rapid Development: Taming Wild Development Schedules, Steve McConnell, 1996, ISBN 1-55615-900- 5, 650 Pages [3] Using Open Source .Net Tools for Sophistated Builds, http://www.15seconds.com/issum/040621.htmspecial Thanks
THECIAL THANKS Go To Pascal Forget, And Adna Sikandar for Their Review and Comments Of this Paper.
About the Author
Farid Mheir is a Senior Technologist in the Capgemini Technology Consulting group. He has more than 20 years of experience in software development and engineering. He has significant experience in software application design and implementation, with a focus on large web-based solutions, leveraging Rational Unified Process and Unified Modeling Language to Translate Business Requirements Into Technical Specifications.
Mr. Mheir has integrated systems with existing applications and processes, recently using Web services to link remote Microsoft-Unix systems. His experience with the development and operations of 24/7 e-commerce applications has given him an understanding of performance and maintenance requirements. He is also experienced in the delivery of multiple applications via a disgument delivery model