Part 2 improving your software development v1.0

1,120 views

Published on

Improving your software development process

Published in: Technology
  • Be the first to comment

Part 2 improving your software development v1.0

  1. 1. Part 2: Improving your software development process March 2011 Santa Clara Karim DJAAFAR CO of Jasmine Conseil
  2. 2. Outline <ul><li>Towards a better build process using agile tools </li></ul><ul><li>Build Managements </li></ul><ul><li>Continuous Integration, Principles and Tools </li></ul><ul><li>JasForge project </li></ul><ul><li>Using hudson in jasforge Project </li></ul><ul><li>Demos </li></ul>
  3. 3. TOWARDS A BETTER BUILD PROCESS USING AGILE TOOLS
  4. 4. Build is often a hard process
  5. 5. What Is a Build? <ul><li>A build is much more than a compile (or its dynamic language variations) </li></ul><ul><li>A build may consist of the compilation, testing, inspection, and deployment—among other things </li></ul><ul><li>A build acts as the process for putting source code together and verifying that the software works as a cohesive unit. </li></ul>
  6. 6. The Integrate button Source : Continuous Integration by Paul M. DUVALL
  7. 7. Why using Build Tools? <ul><li>Builds are messy </li></ul><ul><li>Builds are hard </li></ul><ul><li>It is hard to learn how to do them “right” - what is “right” by the way? </li></ul><ul><li>Builds are typically not well documented </li></ul><ul><li>Trial and error </li></ul><ul><li>... and you often run out of bamboo ... </li></ul>
  8. 8. Build Tools Automation in a agile scenario CI Build Server Automated testing Automated code quality Build Tool
  9. 9. Build Tool <ul><li>Collect input </li></ul><ul><li>Process inputs </li></ul><ul><li>Generate final outputs </li></ul>
  10. 10. Build Tool - Inputs <ul><li>Source code </li></ul><ul><ul><li>Java, SQL </li></ul></ul><ul><li>Resources </li></ul><ul><ul><li>Properties, XML </li></ul></ul><ul><li>Dependencies </li></ul><ul><ul><li>Libraries, components, frameworks </li></ul></ul>
  11. 11. Build Tool - Processing <ul><li>Compile </li></ul><ul><li>Run tests </li></ul><ul><li>Copy files </li></ul><ul><li>Replace keywords </li></ul><ul><li>Package </li></ul><ul><li>Install / deploy </li></ul>
  12. 12. Build Tool - Outputs <ul><li>JAR / WAR / EAR files </li></ul><ul><li>Zip files </li></ul><ul><li>Reports </li></ul>
  13. 13. What is the primary build tool and release management you typically use ? Source: Eclipse community Survey
  14. 14. Maven <ul><li>Project and artifact-based build platform </li></ul><ul><li>Uses repositories to manage artifacts and third party libraries </li></ul><ul><li>Customized by modifying the behavior of the life-cycle via plugins. </li></ul>
  15. 15. Maven and the Development Build Process <ul><li>Maven the source build management tool for enterprise Java projects </li></ul><ul><li>Use declarative approche rather then the task-based approach used in Ant or in traditional Make files or shell scripts </li></ul><ul><li>Promotes the use of standard directory </li></ul><ul><li>structures and a well-defined build lifecycle </li></ul><ul><li>Support quality metric reporting and </li></ul><ul><li>documentation generation tool throw the use </li></ul><ul><li>of plugins </li></ul>
  16. 16. Phases: build life cycle <ul><li>The standard goals for building: </li></ul><ul><ul><li>compile & test - compile and test the code </li></ul></ul><ul><ul><li>package – build and test the artifact </li></ul></ul><ul><ul><li>install – package the artifact and install to local repository </li></ul></ul><ul><ul><li>deploy – package the artifact and copy to the remote repository (release time) </li></ul></ul><ul><li>Release management </li></ul>
  17. 17. Common way to build applications MOJO – Maven 2 Plugins Project http://mojo.codehaus.org/ plugins user e.g. mvn install M2 generate- sources compile test install deploy package integration- test Well-known phases mojo mojo mojo mojo mojo bindings
  18. 18. CONTINUOUS INTEGRATION PRINCIPLES AND TOOLS
  19. 19. What is CI (Continuous Integration) ? <ul><li>“ Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (includingtest) to detect integration errors as quickly as possible.” </li></ul><ul><li>Martin Fowler. </li></ul>
  20. 20. Continuous Integration (CI) scenario
  21. 21. <ul><li>A CI scenario starts with the developer committing source code to the repository. </li></ul><ul><li>On a typical project, people in many project roles may commit changes that trigger a CI cycle: </li></ul><ul><ul><li>Developers change source code, </li></ul></ul><ul><ul><li>database administrators (DBAs) change table definitions, </li></ul></ul><ul><ul><li>build and deployment teams change configuration files, </li></ul></ul><ul><ul><li>interface teams change DTD/XSD specifications, </li></ul></ul><ul><ul><li>and so on… </li></ul></ul>Continuous Integration (CI) scenario
  22. 22. Why do we need CI ? <ul><li>Replace big (and long) integration phases with small and frequent ones </li></ul><ul><ul><li>Ideally instantaneous </li></ul></ul><ul><ul><li>Think of « incremental compilation » in Eclipse </li></ul></ul><ul><li>Minimize integration effort </li></ul><ul><ul><li>Keep the development process running … </li></ul></ul><ul><li>CI was introduced with XP principles and by Martin Fowler </li></ul>
  23. 23. The components of a CI system Commit changes Compile Source Code, Integrate Database, Run Tests, Run Inspections, Deploy Software Feedback Mechanism Generate feedback SCM Server (Svn, Git, …) CI Server
  24. 24. Workflow <ul><li>Checkout from SCM </li></ul><ul><li>Code a new feature </li></ul><ul><li>Run automated build on my machine </li></ul><ul><ul><li>Repeat 2 and 3 until test pass ! </li></ul></ul><ul><li>Merge with latest changes from SCM </li></ul><ul><ul><li>Fix and rebuild until test pass </li></ul></ul><ul><li>Commit </li></ul><ul><li>Run a build on a clean machine </li></ul><ul><ul><li>Immediately fix bugs and integration issues </li></ul></ul>
  25. 25. Version Control Repository <ul><li>Simply put, you must use a version control repository in order to perform CI </li></ul><ul><li>Even if you don’t use CI, a version control repository should be standard for your project </li></ul><ul><li>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 </li></ul><ul><li>There are different types of version control systems you can use too </li></ul><ul><li>We use Subversion for most of the examples in this seminar </li></ul>
  26. 26. Continuous Integration not exist without TDD ! <ul><li>A software development practice where members of a team integrate their work frequently usually each person integrates at least daily (Martin Fowler) </li></ul><ul><li>CI leads to significantly reduced integration problems and allow a team to develop cohesive software more rapidly and reduce risk </li></ul><ul><li>To complete this definition </li></ul><ul><ul><li>Automated, self-testing and fast builds </li></ul></ul><ul><ul><li>Make it easy for everyone to get the last executable </li></ul></ul><ul><ul><li>Automate deployment </li></ul></ul><ul><ul><li>Everyone can see what’s happening progress, statistics on code coverage tests, etc … </li></ul></ul><ul><ul><li>Reduced risks </li></ul></ul>
  27. 27. Continuous Integration <ul><li>Major tools </li></ul><ul><ul><li>Hudson </li></ul></ul><ul><ul><ul><li>No install required put a war in a web container) </li></ul></ul></ul><ul><ul><li>Cruise Control </li></ul></ul><ul><ul><li>Continuum </li></ul></ul><ul><ul><ul><li>Java and Ant/Maven based </li></ul></ul></ul><ul><ul><ul><li>Open Source </li></ul></ul></ul><ul><ul><ul><li>… </li></ul></ul></ul>
  28. 28. Every commit much triggers a build ! <ul><li>Commit at least daily… </li></ul><ul><ul><li>As soon as you have completed an independent functionnality </li></ul></ul><ul><li>A full build on another empty machine </li></ul><ul><ul><li>Not on your own ! </li></ul></ul><ul><li>With hudson </li></ul><ul><ul><li>SCM polling </li></ul></ul><ul><ul><li>Cron-like scheduller </li></ul></ul><ul><ul><li>Trigger with http request (from maven or svn commit hook) </li></ul></ul>
  29. 29. JASFORGE © PROJECT AND HUDSON CI TOOL
  30. 30. Managing all the agile tool is a complex process <ul><li>Today, managing and taking control of your software process is a major challenge for maintaining is capacity to be innovative and competitive </li></ul><ul><li>Ho can we manage efficiently all these toolls in an unified way ? </li></ul><ul><li>We must manage the quality of our software development en meet the requirements and delays in a predictive mode </li></ul><ul><li>This is the aim of JasForge © Project ( http://www.jasforge.com ) : Taking the control of your development process using an “agile “ approache </li></ul>
  31. 31. What is JasForge ? <ul><li>Jasforge is an Open Source project to build a scalable Team collaboration platform for Integrating work across the phases of the development lifecycle </li></ul><ul><li>Available: </li></ul><ul><ul><li>Community Edition (Eclipse Public License) </li></ul></ul><ul><ul><li>Enterprise Edition </li></ul></ul><ul><li>Exemple of tools : hudson </li></ul>
  32. 32. Hudson ? <ul><li>Open-source CI server </li></ul><ul><ul><ul><li>Writen in java ( https://hudson.dev.java.net/ ) </li></ul></ul></ul><ul><li>Extensibility </li></ul><ul><ul><li>230+ community-developed public plugins </li></ul></ul><ul><ul><li>By 230+ contributors </li></ul></ul><ul><li>Estimated 13,000 installations </li></ul>
  33. 33. Basic Feature Set <ul><li>Hudson notices that there is a code change </li></ul><ul><li>Checks out the source code </li></ul><ul><ul><li>CVS, Subversion, ClearCase, Mercurial, Accurev, </li></ul></ul><ul><li>Perforce, Git, StarTeam, … </li></ul><ul><li>Builds Ant, Maven, shell script, NAnt, … </li></ul><ul><li>Record and publish results </li></ul><ul><li>Tool Integration </li></ul><ul><li>Findbugs, Corbertura, ... </li></ul>
  34. 34.  List of projects
  35. 35.  Browse workspaces
  36. 36.  FindBugs integration
  37. 37.  Tracking changes
  38. 38. Provides Feedback <ul><li>RSS feeds </li></ul><ul><li>Email/IM notification </li></ul><ul><li>Tray application to notify developers </li></ul><ul><li>Linux/Windows (Toolbar), Mac (Growl) </li></ul>
  39. 39. JASFORGE © HUDSON TOOLS
  40. 40. Full CI support with Hudson Tool using SOAP/REST Support Notice is managed by LDAP Authentification inside Hudson Page  XML/RPC Hudson <ul><li>SOAP/REST </li></ul><ul><li>createBuildService </li></ul><ul><li>…… </li></ul>HTTP
  41. 41. <ul><li>Simple scenarios: </li></ul>
  42. 42. Thank you for your Attention Jasforge: A Jasmine Conseil concept http://www.jasmineconseil.com Need More information ? [email_address]

×