Continous integration-leon-kehl-2010

600 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
600
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Continous integration-leon-kehl-2010

  1. 1. Waterloo Agile Lean P2P Group Continuous Integration If it is so great why can't we make it work here? Leon Kehl February 16, 2010 Waterloo Ontario
  2. 2. Agenda <ul><li>What is Continuous Integration and its History? </li></ul><ul><li>Demonstration of Continuous Integration Technology </li></ul><ul><li>Continuous Integration & Lean Production </li></ul><ul><li>People and the Laws of Physics </li></ul><ul><li>Continuous Integration Case Study </li></ul>
  3. 3. Martin Fowler's Definition <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 (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly. </li></ul>
  4. 4. History <ul><li>May date to the 60's when the IBM 360 team rebuilt the code base four times a day. </li></ul><ul><li>Continuous integration was one of the practises of the C3 team which included Kent Beck in 1996 that introduced Extreme Programming. </li></ul><ul><li>Martin Fowler wrote an article in 2000 which included the following: “The tests are integrated into a continuous integration and build process which yields a highly stable platform for future development.” </li></ul><ul><li>CruiseControl 1.0 was released in March 2001. </li></ul>
  5. 5. Recommended practices <ul><li>Maintain a code repository </li></ul><ul><li>Automate the build </li></ul><ul><li>Make the build self-testing </li></ul><ul><li>Everyone commits every day </li></ul><ul><li>Every commit (to mainline) should be built </li></ul><ul><li>Keep the build fast </li></ul><ul><li>Test in a clone of the production environment </li></ul><ul><li>Make it easy to get the latest deliverables </li></ul><ul><li>Everyone can see the results of the latest build </li></ul><ul><li>Automate deployment </li></ul>
  6. 6. Today <ul><li>Wikipedia lists 35+ applications. </li></ul><ul><li>Originally written in Java, Cruisecontrol has been ported to .NET and Ruby and there is now a commercial version. </li></ul><ul><li>Most are open source like Cruise Control but a number of commercial versions exist. </li></ul><ul><li>CruiseControl driven primarily by a config.xml file, others more graphical </li></ul>
  7. 7. Quick Demonstration of CruiseControl <ul><li>Downloaded from http://cruisecontrol.sourceforge.net/download.html </li></ul><ul><li>Bundled with versions of Jetty and Ant </li></ul><ul><li>Just unzip and run </li></ul><ul><li>Controlled through config.xml file </li></ul><ul><li>Granddaddy of tools, but easy to install and maintain. Newer applications easier to configure with more bells and whistles </li></ul>
  8. 10. Features <ul><li>Monitors source repository for changes </li></ul><ul><li>Builds based on changes or time based </li></ul><ul><li>Automated build and test </li></ul><ul><li>Emails success/failure </li></ul><ul><li>Maintains history of builds </li></ul><ul><li>Provides web interface to system </li></ul>
  9. 11. <ul><li>Advantages </li></ul><ul><li>Easy to revert if bug encountered </li></ul><ul><li>Detecting integration problems </li></ul><ul><li>Early warning for broken code </li></ul><ul><li>Immediate unit testing </li></ul><ul><li>Working version constantly available </li></ul><ul><li>Focus developers on developing functional, quality code </li></ul><ul><li>Disadvantages </li></ul><ul><li>Initial setup time required </li></ul><ul><li>Well-developed test-suite required for best utility </li></ul>
  10. 12. So what's the problem?
  11. 13. What are the goals of a typical software build process?
  12. 14. What are the goals of a typical software build process? <ul><li>Deliver a controlled build of the product to the user or testers </li></ul><ul><li>Identify changes from previous versions for updates </li></ul><ul><li>Traceability back to source code versions </li></ul><ul><li>May include regular nightly builds to ensure product can be delivered </li></ul>
  13. 15. What are the goals of a typical software build process? <ul><li>Deliver a controlled build of the product to the user or testers </li></ul><ul><li>Identify changes from previous versions for updates </li></ul><ul><li>Traceability back to source code versions </li></ul><ul><li>May include regular nightly builds to ensure product can be delivered </li></ul><ul><li>Focus is typically on delivering final build to customer, not on supporting the development of product or on interim quality standards </li></ul>
  14. 16. Is Continuous Integration Equivalent to Kanban?
  15. 17. What lies beneath the water?
  16. 18. Software - Laws of Physics <ul><li>Inertia is the resistance of any physical object to a change in its state of motion. </li></ul><ul><li>For software systems; as a system is modified, its disorder, or entropy, always increases. This is known as software entropy </li></ul>
  17. 19. Example application of CI <ul><li>Existing legacy check processing application ported to Windows “combined” with another legacy application </li></ul><ul><li>“ Unit tests” meant updating a 100 page Word document with a manual test for feature </li></ul><ul><li>Testing changes involved going to test lab and running checks with physical hardware, setup could take an hour or longer </li></ul><ul><li>Severe case of Software Entropy </li></ul><ul><li>Significant problems in field, fixing issues and adding support for high speed transports </li></ul><ul><li>Similar situation to C3 project </li></ul>
  18. 20. Greenfield redevelopment <ul><li>Able to utilize Agile methodologies, part of selling redevelopment to management </li></ul><ul><li>Incorporated continuous integration from day 1 </li></ul><ul><li>Build system, unit testing etc. were never separate deliverables but part of the process. </li></ul><ul><li>Continuous integration included automated build, unit tests, integration tests and ran in under 5 minutes </li></ul><ul><li>Nightly builds included documentation, code coverage and were added midproject </li></ul>
  19. 21. Successful application of CI <ul><li>Metaphor for project was eating an elephant in this case 110,000 lines of legacy code </li></ul><ul><li>Version delivered for acceptance testing after 8 months </li></ul><ul><li>Fairly long acceptance testing and rollout </li></ul><ul><li>Approaches and techniques were applied in limited situations elsewhere </li></ul>
  20. 22. Continued support for Agile <ul><li>Senior leadership supportive of Agile, created a Build committee to improve build processes </li></ul><ul><li>Several other teams were also working on continuous integration using variety of tools </li></ul><ul><li>Support for application transitioned from contract resources to all full-time for this project </li></ul><ul><li>Agile consulting firm was engaged to analyze current processes </li></ul>
  21. 23. Manifesto for Agile Software Development <ul><li>Individuals and interactions over processes and tools </li></ul><ul><li>Working software over comprehensive documentation </li></ul><ul><li>Customer collaboration over contract negotiation </li></ul><ul><li>Responding to change over following a plan </li></ul>
  22. 24. Manifesto for Agile Software Development <ul><li>Individuals and interactions over processes and tools </li></ul><ul><li>Working software over comprehensive documentation </li></ul><ul><li>Customer collaboration over contract negotiation </li></ul><ul><li>Responding to change over following a plan </li></ul>
  23. 25. Software - Laws of Physics Revisited <ul><li>Inertia is the resistance of any physical object to a change in its state of motion. </li></ul><ul><li>For software systems; as a system is modified, its disorder, or entropy, always increases. This is known as software entropy </li></ul><ul><li>Iceberg Below the Surface </li></ul><ul><li>Behaviour </li></ul><ul><li>Mindsets </li></ul><ul><li>Assumptions </li></ul><ul><li>Habits </li></ul><ul><li>Unwritten rules </li></ul><ul><li>Culture </li></ul>
  24. 26. Trivial Pursuit <ul><li>Who knows what happened to the original C3 project at Chrysler? </li></ul>
  25. 27. Trivial Pursuit <ul><li>The plan was to roll out the system to different payroll 'populations' in stages, but C3 never managed to make another release despite two more years' development. The C3 system only ever paid 10,000 people (target was 85,000) </li></ul><ul><li>Chrysler was bought out by Daimler-Benz in 1998. DaimlerChrysler stopped the C3 project on 1 February 2000. </li></ul><ul><li>Frank Gerhardt, a manager at the company, announced to the XP conference in 2000 that DaimlerChrysler had de facto banned XP after shutting down C3; however, some time later DaimlerChrysler resumed the use of XP. </li></ul>
  26. 28. Law of Inertia <ul><li>Build committee struggled to get traction, focused on hardware, software tools </li></ul><ul><li>Senior management to kickstart process engaged consulting resources. $19K ant script was result </li></ul><ul><li>Senior leader driving change left and new leader with different priorities took over </li></ul><ul><li>Within a year project team was no longer using continuous integration or maintaining unit tests </li></ul>
  27. 29. Progress is not a straight line <ul><li>People from the C3 team spread out their knowledge, liking spreading seeds </li></ul><ul><li>Other teams start to pick up aspects of continuous integration </li></ul><ul><li>Continuous integration recreated to successfully deliver next version </li></ul><ul><li>Stories and the processes spread like we are doing today </li></ul>
  28. 30. Continious integration for brownfield projects <ul><li>More normal situation is trying to inject continuous integration into existing process or project, rather than greenfield </li></ul><ul><li>Goal is to look for simple defensible approaches to move towards the goal </li></ul><ul><li>No cookie cutter solutions, rather look for opportunities, points of leverage, allies, problems that CI would help with </li></ul><ul><li>Use skunkworks if necessary, get creative </li></ul>
  29. 31. Behaviour modification example <ul><li>Team with 20 plus developers, half contract </li></ul><ul><li>Large rewrite project, used existing build processes with addition of Cruisecontrol </li></ul><ul><li>Build process typically was an hour plus, with no unit tests </li></ul><ul><li>Integrations typically took weeks, build was typically broken for days </li></ul>
  30. 32. The solution <ul><li>Lava lamps </li></ul><ul><li>Optimizing integration build to match developer build </li></ul><ul><li>Impact of Change </li></ul><ul><ul><li>Dropped build times to 20 minutes </li></ul></ul><ul><ul><li>Eliminated build problems </li></ul></ul><ul><ul><li>Broken builds became rare occurrences </li></ul></ul>
  31. 33. Your turn <ul><li>Break up into small groups for case study </li></ul><ul><li>Ten minutes to talk about tactics or approaches to move towards integration </li></ul><ul><li>Five minutes sharing results </li></ul><ul><li>Case study is intended to give you only the surface details. Feel free to ask questions for additional details </li></ul>
  32. 34. Concluding Remarks <ul><li>Agile and Continuous are people centric so success depends on them. Seek out allies! </li></ul><ul><li>Don't rely on management to make things happen or enforce team norms </li></ul><ul><li>Skunkworks if necessary </li></ul><ul><li>What you measure counts so make visible to the team and management what you want changed </li></ul><ul><li>Tools are necessary but won't determine success. Hockey stick is required to play but doesn't mean your team will win </li></ul><ul><li>Failure leads to success. Progress is never linear </li></ul>
  33. 35. In conclusion <ul><li>The significant problems we face cannot be solved at the same level of thinking we were at when we created them </li></ul><ul><li>Things should be as simple as possible, but not simpler </li></ul><ul><li>I am neither especially clever nor especially gifted. I am only very, very curious </li></ul><ul><li>Albert Einstein </li></ul>

×