40
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0 Part 2: Improving your software development process March 2011 Santa Clara Karim DJAAFAR CO of Jasmine Conseil

Part 2 improving your software development v1.0

Embed Size (px)

DESCRIPTION

Improving your software development process

Citation preview

Page 1: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Part 2:Improving your software development process

March 2011

Santa Clara

Karim DJAAFAR

CO of Jasmine Conseil

Page 2: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Outline

• Towards a better build process using agile tools• Build Managements• Continuous Integration, Principles and Tools • JasForge project• Using hudson in jasforge Project• Demos

Page 3: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

TOWARDS A BETTER BUILD PROCESS USING AGILE TOOLS

Page 4: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build is often a hard process

Page 5: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

What Is a Build?

• A build is much more than a compile (or its dynamic language variations)

• A build may consist of the compilation, testing, inspection, and deployment—among other things

• A build acts as the process for putting source code together and verifying that the software works as a cohesive unit.

Page 6: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

The Integrate button

Source: Continuous Integration by Paul M. DUVALL

Page 7: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Why using Build Tools?

Builds are messy Builds are hard It is hard to learn how to do them “right” - what is “right” by

the way? Builds are typically not well documented Trial and error ...and you often run out of bamboo ...

Page 8: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build Tools Automation in a agile scenario

CI Build Server

Automated testing

Automated code quality

Build Tool

Page 9: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build Tool

• Collect input

• Process inputs

• Generate final outputs

Page 10: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build Tool - Inputs

• Source code

Java, SQL

• Resources

Properties, XML

• Dependencies

Libraries, components, frameworks

Page 11: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build Tool - Processing

• Compile

• Run tests

• Copy files

• Replace keywords

• Package

• Install / deploy

Page 12: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Build Tool - Outputs

• JAR / WAR / EAR files

• Zip files

• Reports

Page 13: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

What is the primary build tool and release management you typically use ?

Source: Eclipse community Survey

Page 14: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Maven

• Project and artifact-based build platform

• Uses repositories to manage artifacts and third party

libraries

• Customized by modifying the behavior of the life-cycle

via plugins.

Page 15: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Maven and the Development Build Process

• Maven the source build management tool for enterprise Java projects

• Use declarative approche rather then the task-based approach used in Ant or in traditional Make files or shell scripts

• Promotes the use of standard directory

structures and a well-defined build lifecycle• Support quality metric reporting and

documentation generation tool throw the use

of plugins

Page 16: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Phases: build life cycle

• The standard goals for building:

compile & test - compile and test the code

package – build and test the artifact

install – package the artifact and install to local repository

deploy – package the artifact and copy to the remote

repository (release time)

• Release management

Page 17: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

CONTINUOUS INTEGRATIONPRINCIPLES AND TOOLS

Page 18: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Continuous Integration (CI) scenario

Page 19: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

• A CI scenario starts with the developer committing source code to the repository.

• On a typical project, people in many project roles may commit changes that trigger a CI cycle:

Developers change source code,

database administrators (DBAs) change table definitions,

build and deployment teams change configuration files,

interface teams change DTD/XSD specifications,

and so on…

Continuous Integration (CI) scenario

Page 20: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Why do we need CI ?

• Replace big (and long) integration phases with small and frequent ones

Ideally instantaneous Think of « incremental compilation » in Eclipse

• Minimize integration effort Keep the development process running …

• CI was introduced with XP principles and by Martin Fowler

Page 21: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

The components of a CI system

Commit changes

Generate feedback

Compile Source Code,Integrate Database,Run Tests,Run Inspections,Deploy Software

FeedbackMechanism

SCM Server (Svn, Git, …) CI Server

Page 22: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Workflow

1. Checkout from SCM

2. Code a new feature

3. Run automated build on my machine

Repeat 2 and 3 until test pass !

4. Merge with latest changes from SCM

Fix and rebuild until test pass

5. Commit

6. Run a build on a clean machine Immediately fix bugs and integration issues

Page 23: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Version Control Repository• Simply put, you must use a version control repository in

order to perform CI

• Even if you don’t use CI, a version control repository should be standard for your project

• The purpose of a version control repository is to manage changes to source code and other software assets (such as documentation) using a controlled access repository

• There are different types of version control systems you can use too

• We use Subversion for most of the examples in this seminar

Page 24: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Continuous Integration not exist without TDD !• A software development practice where

members of a team integrate their work frequently usually each person integrates at least daily (Martin Fowler)

• CI leads to significantly reduced integration problems and allow a team to develop cohesive software more rapidly and reduce risk

• To complete this definition Automated, self-testing and fast builds Make it easy for everyone to get the last

executable Automate deployment Everyone can see what’s happening

progress, statistics on code coverage tests, etc …

Reduced risks

Page 25: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Continuous Integration

• Major tools Hudson

No install required put a war in a web container)

Cruise Control Continuum

Java and Ant/Maven based Open Source …

Page 26: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Every commit much triggers a build !

• Commit at least daily… As soon as you have completed an independent

functionnality

• A full build on another empty machine Not on your own !

• With hudson SCM polling Cron-like scheduller Trigger with http request (from maven or svn commit hook)

Page 27: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

JASFORGE © PROJECT AND HUDSON CI TOOL

Page 28: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Managing all the agile tool is a complex processToday, managing and taking control of your software

process is a major challenge for maintaining is capacity to be innovative and competitive

Ho can we manage efficiently all these toolls in an unified way ?

We must manage the quality of our software development en meet the requirements and delays in a predictive mode

This is the aim of JasForge © Project (http://www.jasforge.com) : Taking the control of your development process using an “agile “ approache

Page 29: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

What is JasForge ?

• Jasforge is an Open Source project to build a scalable Team collaboration platform for Integrating work across the phases of the development lifecycle

• Available: Community Edition (Eclipse Public License) Enterprise Edition

• Exemple of tools : hudson

Page 30: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Hudson ?

• Open-source CI server• Writen in java (https://hudson.dev.java.net/ )

• Extensibility 230+ community-developed public plugins By 230+ contributors

• Estimated 13,000 installations

Page 31: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Basic Feature Set

• Hudson notices that there is a code change• Checks out the source code

CVS, Subversion, ClearCase, Mercurial, Accurev,

• Perforce, Git, StarTeam, …• Builds Ant, Maven, shell script, NAnt, …• Record and publish results• Tool Integration• Findbugs, Corbertura, ...

Page 32: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

List of projects

Page 33: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Browse workspaces

Page 34: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

FindBugs integration

Page 35: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Tracking changes

Page 36: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Provides Feedback

• RSS feeds• Email/IM notification• Tray application to notify developers• Linux/Windows (Toolbar), Mac (Growl)

Page 37: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

JASFORGE © HUDSON TOOLS

Page 38: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Full CI support with Hudson Tool using SOAP/REST Support

HudsonHudson

No

tic

eN

oti

ce is managed by

LDAP Authentification inside Hudson

is managed by LDAP Authentification inside Hudson

Page 40

SOAP/REST-createBuildService

- ……

SOAP/REST-createBuildService

- ……

HTTP XML/RPC

Page 39: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0

Simple scenarios:

Page 40: Part 2   improving your software development v1.0

Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.042

Jasforge: A Jasmine Conseil concept

http://www.jasmineconseil.com

Need More information ?

[email protected]

Thank you for your Attention