Post on 13-May-2015
description
transcript
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
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
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
TOWARDS A BETTER BUILD PROCESS USING AGILE TOOLS
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Build is often a hard process
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.
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
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 ...
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
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Build Tool
• Collect input
• Process inputs
• Generate final outputs
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
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
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
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
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.
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
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
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
CONTINUOUS INTEGRATIONPRINCIPLES AND TOOLS
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Continuous Integration (CI) scenario
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
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
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
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
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
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
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 …
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)
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
JASFORGE © PROJECT AND HUDSON CI TOOL
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
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
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
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, ...
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
List of projects
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Browse workspaces
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
FindBugs integration
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Tracking changes
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)
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
JASFORGE © HUDSON TOOLS
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
Improving your software development | © 2011 by K. DJAAFAR ; made available under the EPL v1.0
Simple scenarios:
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 ?
info@jasmineconseil.com
Thank you for your Attention