the journey towards continuous integration
DESCRIPTION
Over the past two years we’ve been pushing to improve our automated testing practices within Plusnet and to win full support for it within the company across the spectrum of fellow developers, project managers and upper management. It took a while to agree on software we want to use, and standards we want to follow, but now all new code is being continuously built and tested and the results of that are visible business-wide. We use PHP_CodeSniffer to verify that we follow our coding standards, PHPDocumentor to generate automated API documentation, PHPUnit to run test suites and phpUnderControl to run all these tools regulary, at least once a day and to generate aggregated reports. Finally, Sonar allows us to create and publish reports visible to everybody and more importantly reports that everybody can understand. Setting it all up can be a tough exercise, but if you prepare to it upfront you might actually find it quite exciting! So, you strongly believe this is the way you should be developing your code, but you don’t really know where to start? Let me show you how our journey began. You don’t know how to convince your fellow developers to follow you? I’ll tell you how to establish a strong team that will follow you. Your managers seem to be more interested in delivering your project on time and don’t really see a point in spending additional time on unit testing and documenting your code? Maybe you haven’t shown them the benefits of continuous integration in a way they can understand. I’ll show you what worked for us.TRANSCRIPT
![Page 1: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/1.jpg)
PHP North West 2010PHP North West 2010
Sebastian Marek, Senior Software Engineer
The Journey Towards Continuous Integration
![Page 2: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/2.jpg)
@proofek
a Pole living in Sheffield nearly 10 years PHP
experience co-author of 2 PHP books big fan of process
automation TDD and CI wants to be a knight
![Page 3: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/3.jpg)
One Morning Long Ago
![Page 4: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/4.jpg)
New experience
Alpha-box set up New development processes Staging platform and QA team Deployment procedures Fixing problems Working on projects
![Page 5: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/5.jpg)
At the Foot of Mount Doom
increased maintenance time
growing problem numbers
code harder to understand and follow
complex and time consuming testing
![Page 6: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/6.jpg)
Looking for help!
![Page 7: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/7.jpg)
First frustrations
ad hoc builds mixture of php3 and php4 learn as you go no standards
![Page 8: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/8.jpg)
Forming up the fellowship
Stuart Grimshaw Simon Westcott Ben Selby Sebastian Marek Rowan Merewood Ben Longden
![Page 9: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/9.jpg)
Calling the council
Who? managers developers
What? threats opportunities planning implementation
http://www.flickr.com/photos/pedromourapinheiro/3272323691/in/photostream/
![Page 10: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/10.jpg)
It's always about the money
Design debt Late fees Interests
http://www.flickr.com/photos/your_teacher/1040476355/in/photostream/
![Page 11: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/11.jpg)
Finding the best way
VS.
![Page 12: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/12.jpg)
Support & roadmap
http://www.flickr.com/photos/jannem/3312115991/in/photostream/
![Page 13: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/13.jpg)
Metrics and reports
http://www.flickr.com/photos/aussiegall/286709039/in/photostream/
![Page 14: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/14.jpg)
Joining more powerful allies
![Page 15: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/15.jpg)
Automation
http://www.flickr.com/photos/matthileo/3552898254/in/photostream/
![Page 16: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/16.jpg)
East front
![Page 17: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/17.jpg)
Automated builds
Cruicecontrol addon PHPUnit integration phpDocumentor
integration code metrics generation code coverage reports checkstyle report
integration PHP Depend integration PHPMD support and many more
![Page 18: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/18.jpg)
PHPUnit
Industry recognised xUnit testing framework for PHP, supporting: mock objects database testing code coverage analysis
integrating selenium RC continuous integration platforms like CruiseControl,
Hudson, Bamboo
![Page 19: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/19.jpg)
phpDocumentor
automated documentation for PHP
supports different formats: HTML, PDF, CHM, XML
web and cli interface easily configurable
![Page 20: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/20.jpg)
PHP_Codesniffer
Based on defined coding standards Detects coding standards violation Extendable and configurable Codebrowser
![Page 21: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/21.jpg)
Code coverage report
Be always on top of your tests Code coverage ratio Configurable thresholds Clover format Html format
![Page 22: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/22.jpg)
Software metrics - PHP Depend
Code measures Cyclomatic Complexity NPath Complexity CodeRank Lines Of Code
![Page 23: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/23.jpg)
PHP Mess Detector
Intelligent code analyser Possible bugs Suboptimal code Overcomplicated
expressions Unused parameters,
methods, properties
![Page 24: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/24.jpg)
Buildbox maintenance
New modules added Increasing build time Often crashes Stability problems Hardware issues
![Page 25: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/25.jpg)
phpUnderControl
![Page 26: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/26.jpg)
Upgrades needed
![Page 27: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/27.jpg)
Hudson – next generation
easy installation easy configuration plugin support distributed builds multi-language support dependency tracking
![Page 28: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/28.jpg)
Hudson
![Page 29: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/29.jpg)
More automation
git - distributed version control system AIE – alpha integrated environment capistrano
automated deployment build script management
![Page 30: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/30.jpg)
Selenium
Automated web apps testing
Regression testing Headless builds
![Page 31: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/31.jpg)
One ring to rule them all
http://www.flickr.com/photos/cosmic_bandita/2218419160/in/photostream/
![Page 32: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/32.jpg)
West front
![Page 33: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/33.jpg)
Sonar
quality management platform
continuous analysis easily extendable and
configurable
![Page 34: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/34.jpg)
Sonar
![Page 35: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/35.jpg)
Business wide visibility
Meaningful reports Responsibility and ownership KPI Goals
![Page 36: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/36.jpg)
Radiator view
![Page 37: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/37.jpg)
Reports
![Page 38: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/38.jpg)
The army needs to follow the leader
Lead by example firm, but friendly and helpful never forget about training clear and simple rules praise vs. punishment
![Page 39: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/39.jpg)
You broke the build!
![Page 40: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/40.jpg)
Where's the build?
![Page 41: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/41.jpg)
Works on my machine?!
![Page 42: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/42.jpg)
It's your time now
![Page 43: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/43.jpg)
Quick guide
1. Investigate
2. Trial
3. Form a team
4. Small steps
5. Be visible
6. Automate
![Page 44: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/44.jpg)
Resources
PHPUnit - http://www.phpunit.de/ phpUnderControl - http://phpundercontrol.org/ Hudson - http://hudson-ci.org/ Sonar - http://www.sonarsource.org/ phpDocumentor - http://www.phpdoc.org/ PHP_CodeSniffer -
http://pear.php.net/package/PHP_CodeSniffer/ PHP Depend - http://pdepend.org/ PHP Mess Detector - http://phpmd.org/ Selenium - http://seleniumhq.org/ xDebug - http://www.xdebug.org/
![Page 45: The Journey towards Continuous Integration](https://reader034.vdocument.in/reader034/viewer/2022051513/5457f428b1af9f37608b521c/html5/thumbnails/45.jpg)
Q & A
Any questions?
http://joind.in/2052