Merlin A Continuous Integration Tool for VisualWorks



Similar documents
Software Construction

Online Backup by Mozy. Common Questions

Jenkins on Windows with StreamBase

On premise upgrade guide (to 3.3) XperiDo for Microsoft Dynamics CRM

Apptix Online Backup by Mozy

Preparing your Domain to transfer from Go Daddy

Online Backup and Recovery Manager Setup for Microsoft Windows.

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

Exchange ActiveSync (EAS)

Hudson configuration manual

Jetico Central Manager. Administrator Guide

Connecting to LRDC Fileserver Remotely Using Windows Vista/7 & SRemote VPN

Sophos SafeGuard Native Device Encryption for Mac Administrator help. Product version: 7

Continuous integration for databases using

Specops Command. Installation Guide

Making the Right Choice

Pcounter Web Report 3.x Installation Guide - v Pcounter Web Report Installation Guide Version 3.4

Enterprise Remote Control 5.6 Manual

DiskPulse DISK CHANGE MONITOR

HPOM 8.1 High Availability Utilizing Microsoft SQL Server Log Shipping

Installation Guide. . All right reserved. For more information about Specops Inventory and other Specops products, visit

User Guide. Active Online Backup - Secure, automatic protection

MyNetFone Virtual Fax. Virtual Fax Installation

Effective unit testing with JUnit

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

The following pages describe the installation and configuration process of GPmicro s dinkum Backup Software.

Installation Documentation Smartsite ixperion 1.3

Deploying the BIG-IP LTM system and Microsoft Windows Server 2003 Terminal Services

PUBLIC Password Manager for SAP Single Sign-On Implementation Guide

Creating a Domain Tree

PRODUCT WHITE PAPER LABEL ARCHIVE. Adding and Configuring Active Directory Users in LABEL ARCHIVE

Delivering Quality Software with Continuous Integration

ios How to Back Up from icloud

VPN Configuration Guide. Dell SonicWALL

Perceived Performance Test Toolkit

Oracle Enterprise Manager. Description. Versions Supported

High Availability for Internet Information Server Using Double-Take 4.x

White Paper. CCRM Services on Cloud Benefits of Private Cloud for CCRM Services. Abstract. - Krishna Vaddadi

DAZZLE INTEGRATED DATA BACKUP FEATURE.

Virto Password Reset Web Part for SharePoint. Release Installation and User Guide

Kevin Lee Technical Consultant As part of a normal software build and release process

Oracle Enterprise Manager. Description. Versions Supported

Active Interest Media File Transfer Server Initial Client Install Documentation

How do I enroll in the password portal?

2. In the Search programs and files field, enter mmc and hit the enter key

Upgrade Guide BES12. Version 12.1

Oracle Enterprise Manager

Content. Development Tools 2(63)

Zoom Plug-ins for Adobe

Installation and Troubleshooting Guide for SSL-VPN CONNECTIONS Access

Creating and Managing Shared Folders

NHSmail mobile configuration guide Android mobile devices

Apple Remote Desktop User Guide

MICROSOFT OUTLOOK 2010 GETTING STARTED

Configuration for Microsoft Windows 7 Enterprise Edition

Title: SharePoint Advanced Training

NetWrix Account Lockout Examiner Version 4.0 Administrator Guide

VMware vcenter Support Assistant 5.1.1

Silect Software s MP Author

Step-by-Step Guide to Securing Windows XP Professional with Service Pack 2 in Small and Medium Businesses

Install MS SQL Server 2012 Express Edition

How to install and use the File Sharing Outlook Plugin

How To Test In Bluej

EMC ApplicationXtender Server

GO!Enterprise MDM Device Application User Guide Installation and Configuration for BlackBerry

How to remotely access your Virtual Desktop from outside the college using VMware View Client. How to guide

EMC ApplicationXtender Server

Oracle Enterprise Manager

1. Do I need to upgrade my Broadband at Home modem firmware?

MICROSOFT BITLOCKER ADMINISTRATION AND MONITORING (MBAM)

How To Use The Nvcc

Remote Access in Windows XP

mystanwell.com Installing Citrix Client Software Information and Business Systems

External Data Connector (EMC Networker)

Time Stamp. Instruction Booklet

Sophos Mobile Control Administrator guide. Product version: 3.6

ManageEngine ADSelfService Plus. Evaluator s Guide

Funeral Home Software Instruction Manual

Team Foundation Server 2012 Installation Guide

- Help Documents

5 barriers to database source control and how you can get around them

Project Backup And Transfer

Access Control Software Manual

How To Backup An Exchange Server With 25Gb And More On A Microsoft Smartfiler With A Backup From A Backup To A Backup Point Set On A Flash Drive On A Pc Or Macbook Or Ipad On A Cheap Computer (For A

Server Installation: ServerTools

Windows 7 Hard Disk Recovery

VX Search File Search Solution. VX Search FILE SEARCH SOLUTION. User Manual. Version 8.2. Jan Flexense Ltd.

Kaseya 2. Quick Start Guide. for Network Monitor 4.1

Hudson Continous Integration Server. Stefan Saasen,

Using the IPMI interface

Backup Assistant. User Guide. NEC NEC Unified Solutions, Inc. March 2008 NDA-30282, Revision 6

McAfee Solidcore Change Reconciliation and Ticket-based Enforcement

Norman Secure Backup. SQL Backup Training Guide. Author: Arne Stieghorst Layout: Eva Langballe

NETWRIX ACCOUNT LOCKOUT EXAMINER

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with Oracle Application Server 10g

Installing and Configuring Microsoft Dynamics Outlook Plugin to Use with ipipeline MS CRM

Transcription:

Merlin A Continuous Integration Tool for VisualWorks Michael Meyer November 23, 2005 1

Contents Contents 1. Continuous Integration 3 1.1. Definition.................................... 3 1.2. The benefit................................... 3 1.3. History..................................... 3 1.4. Extensions.................................... 4 2. Merlin 4 2.1. Buildloop.................................... 4 2.2. Reports..................................... 4 2.2.1. SUnit.................................. 4 2.2.2. Developer Statistics.......................... 5 2.3. Design...................................... 5 2.3.1. Data storage.............................. 5 2.3.2. Server.................................. 8 2.3.3. Plugins................................. 8 2.4. Limitations................................... 8 A. Implementation of doexecute:build: 10 B. Installation 10 B.1. Environment.................................. 10 B.2. Setup the server................................ 10 B.3. Install the web frontend............................ 11 B.4. Initial build................................... 11 C. Commands 11 C.1. MerlinServer class............................... 11 C.2. MerlinRegistry class.............................. 12 D. Additional information 12 D.1. Restoring the build hisotry.......................... 12 D.2. For some classes the auxiliary information like username or timestamp is missing..................................... 13 2

1. Continuous Integration A common problem in Software development is that changes made by one person break the code of an other. These bugs are difficult to find because the problem doesn t belong to one persons area, it s in the interaction of the two components. These kind of bugs can stay undetected for weeks or months and the later they are detected the more difficult it becomes to fix them. With Continuous Integration these kind of bugs can often be detected on the same day that they manifest. This makes fixing the bug a lot easier since the developers know where to look for the bug and they still know why they introduced the changes that lead to the bug. The target of Merlin is to provide a slim Continuous Integration tool for Smalltalk. Merlin was designed to be extendable with custom plugins. The author is of the opinion that a Continous Integration tool only offers a real surplus if all repetitive and mostly cumbersome tasks of the development process can be handled by the tool. 1. Continuous Integration This chapter contains a short introduction to the idea and history of Continuous Integration. 1.1. Definition When talking about Continuous Integration one usually means a background service that is coupled with a Source Code Management System. The service loads a project from the Source Code Management System on a regular basis, compiles the code and runs all unit tests. These tasks should be executed as often as possible. Martin Fowler states [2] that running the tests once a day is the absolute minimum. While this may not be feasible for large projects it s definitely true for small and medium sized projects. 1.2. The benefit A problem that often occurs when several people work on the same project, is that the changes that one developer introduces, break the code someone else has written. With increasing project size and modular design it gets more and more difficult to detect this kind of interaction problems. For this it is necessary to have regular builds of the whole project and not just of the part you re working on. 1.3. History The idea of Continuous Integration has been around for a long time. Steve McConnell [3] recommends it as a Best practice and it is known that Microsoft has been using Continuous Integration as part of there development process for quite a while. 3

2. Merlin Continuous Integration is also an essential part of the Extreme Programming [1] development process. But what really made Continuous Integration interesting, especially for low budget projects, was the fact that ThoughtWorks opensourced their Continuous Integration tool (CruiseControl). 1.4. Extensions Most programming languages have a build tool. Among the more popular ones are Ant and Maven for Java and Make for C / C++. Such a tool combined with a Continuous Integration tool lets the user personalise the entire build process. Possible extensions are the creation of a documentation on the fly based on information in the source code, checking if the coding conventions have been violated and metrics calculation. It is important that these kind of tasks can be easily hooked into the build loop. If the domain of the build loop is to small the effort of installing and maintaining the build loop will be bigger than the gain. 2. Merlin Merlin is a Continuous Integration tool for VisualWorks. This chapter gives a short overview over the build loop and the available reports. 2.1. Buildloop The core of Merlin is a build loop that looks for updates of a bundle at regular intervals. If Merlin finds new code in Store it will load the code into the image. A basic Merlin installation won t do more than just that. Additional tasks can be added through a plugin mechanism. 2.2. Reports At the moment there are two reports that can be hooked into Merlin. The SUnit report for running tests and the Developer Statistics report that groups the results of the SUnit report by developers. 2.2.1. SUnit The SUnit extension collects all tests in a bundle and runs them. The developer can look at the results in a web browser. The model and the view have been separated. Figure 1 shows a screenshot of the web frontend. The first line (MooseDevelopment) is the name of the bundle under study. On the left hand side there is a box named 4

2. Merlin Builds, that contains links and informations to all previous builds. The first box on the right hand side ( Overview ) contains information about the selected build. The other boxes on the right hand side represent the test results on a class level. Figure 1: SUnit report for the MooseDevelopment bundle (Version 3.0.25.girba.12) 2.2.2. Developer Statistics The Developer Statistics report is based on the SUnit report. This report groups the results of the SUnit report by developers. Figure 2 gives an overview over the test results on a per user basis. The y - axes shows the number of tests and the x - axes contains all users who modified or wrote a test. There are three bars for every user. The green bar indicates the number of tests that have passed, the orange bar indicates the number of tests that have failed and the red bar indicates the number of tests that threw an unexpected exception. The report also creates a pie chart for every user. Figure 3 shows the results for the user girba. The values are equal to the values in figure 2. This report is useful to check who s tests have been broken by the modifications that a developer introduced. Like this the blamable developer can get in touch with the owner of the broken tests and they can discuss how they will proceed. 2.3. Design In this section we will give a short overview over Merlin s design. Figure 4 shows an UML model of the most important Merlin classes. 2.3.1. Data storage The most important class of Merlin is the class MerlinRegistry. The registry exists independently from the build loop and the frontend and contains all data that the plugins produce. The frontend (Seaside) knows the location of the registry and will collect all needed data from there. 5

2. Merlin Figure 2: The chart shows for every developer the absolute number of broken, failed and passed tests. The green bar shows the number of passed tests, the orange bar the number of failed tests and the red bar shows the number of tests that threw an unexpected exception. Figure 3: A chart like this is generated for every user. This chart shows the number of broken, failed and passed tests for the user girba. 6

2. Merlin Figure 4: This UML diagram gives an overview on how the registry, the build loop, the reports and the Seaside frontend fit together. 7

2. Merlin 2.3.2. Server The class MerlinServer is responsible for loading the latest code from the Source Code Management System and running the plugins. 2.3.3. Plugins Figure 5 gives an overview over the plugin design. There is an abstract base class called MerlinPlugin that handles basic things like registering with the server and handing out copies of the data. A subclass needs to implement the method doexecute:build: on the instance side. This method contains the functionality that the plugin should have. Appendix A contains the implementation of the doexecute:build: method for the Statistics plugin. On the class side the methods namespace and buildclass are important. The method namespace returns a string that indicates where the results of this plugin should be stored in the registry. This makes it easy for other plugins or the web frontend to find the build results for a plugin. The method buildclass returns the name of a class. The build results for a plugin will be instances of this class. An instance of this class will be handed to the method doexecute:build:. Figure 5: A plugin needs to implement the three methods doexecute:atimestamp build: abuild, namespace and buildclass. 2.4. Limitations All though Merlin aims to be an automated build tool manual interaction is still needed at times. The reason for this is that Store can t be scripted entirely. At the moment there is no solution for preventing Store from popping up a message box if something unexpected happens. 8

References References [1] Beck, K. : Extreme Programming Explained: Embrace Change. Addison Wesley, 2000. ISBN 201616416 [2] Fowler, M.. Continuous Integration. http://www.martinfowler.com/articles/ continuousintegration.html [3] McConnell, S. : Rapid Development. ISBN 1556159005 9

A. Implementation of doexecute:build: A. Implementation of doexecute:build: This is the implementation of the doexecute:build: method for the Statistics plugin. Basically we get the build result for the SUnit plugin from the registry and iterate over all classes and all selectors. doexecute: timestamp build: astatisticsbuild "Creates a user statistic from the results of the SUnitPlugin" asunitbuild asunitbuild := (self registry resolve: SUnitPlugin namespace) getbuild: timestamp. asunitbuild classdescriptions do: [:aclassdescription aclassdescription selectors do: [:amethoddescription auserstatistic auserstatistic := astatisticsbuild userstatistics: amethoddescription username. amethoddescription ispassed iftrue: [auserstatistic incrementpassedcount]. amethoddescription isfailure iftrue: [auserstatistic incrementfailurecount]. amethoddescription iserror iftrue: [auserstatistic incrementerrorcount]]]. "Store the build result" astatisticsbuild postinit. B. Installation In this section we will talk about setting up Merlin for one of your projects. Merlin consists of two parts: A domain model and a frontend based on Seaside. B.1. Environment First you need to load the bundle MerlinDevelopment from store. The bundle will automatically load all other prerequisites. During the load process Seaside will ask for a username and password for the management console. On all other dialog messages you should either click on OK or on Yes. Next you need to load the latest version of the bundle that should be monitored. For example MooseDevelopment. B.2. Setup the server You need to execute the following code in order to prepare the server: server registry Transcript clear. 10

C. Commands registry := MerlinRegistry instance. registry reset. StoreProvider initializeforproduction. server := MerlinServer registry: registry bundle: MooseDevelopment. server delay: 60. server registerplugin: SUnitPlugin new. server registerplugin: StatisticsPlugin new. server inspect. server start. Your Continuous Integration server is now up and running and will check for updates every 60 seconds. B.3. Install the web frontend The installation of the frontend is simple. Just execute the following peace of code: WAMerlin install: Moose This will give access to the server under the following address: http://localhost:8008/seaside/go/moose B.4. Initial build Since the bundle you re monitoring is up to date you need to start the first build by hand. For the initial build you can go the web application and click the Start build link. C. Commands There are some commands that are important while working with Merlin. This chapter gives an overview over the most important administration commands. You have already seen some of the commands in section B.2 while setting up your build loop. C.1. MerlinServer class This is a list with commands that can be invoked for every day administration. Command delay: numberofseconds registerplugin: aplugin execute start stop Description Sets the interval for the build loop Use this command to add a plugin to the build loop Starts a new (unscheduled) build Start the build loop Stop the build loop (You don t lose any data) 11

D. Additional information If a build throws an exception there is a chance that a deadlock occurs since the failing process won t release the semaphore. To release a semaphore one can send the message signal to a semaphore. For example: self executelock signal The class MerlinServer uses the following semaphores: Lock executelock pluginlock timestamplock delaylock Description This look is likely to fail in case of an exception This look protects the plugins This look protects the timestamps This look protects the delay setting. It is unlikely that this one will fail C.2. MerlinRegistry class As explained in section 2.3.1 this class is responsible for data storage. method that is important for data recovery. There is one Command load Description This tries to restore the build history from a binary backup file Since this class needs to be thread safe there is a chance that a deadlock occurs. As with the MerlinServer class the semaphore can be unlocked by hand. Lock lock Description This look protects the build history D. Additional information D.1. Restoring the build hisotry Before Merlin starts a build Merlin always creates a backup of the registry in a binary format. The backup can be restored with the following procedure: 1. Start a new VisualWorks image 2. Follow the instructions from section B.1 3. Execute the following code: MerlinRegistry instance load. 4. Follow the instructions from the sections B.2 and B.3 12

D. Additional information D.2. For some classes the auxiliary information like username or timestamp is missing This happens if the name method for the particular class has been overwritten. 13