3. Continuous Integration Software engineering practice, where project is build frequently Emerged in the Extreme Programming (XP) community
4. Continuous Integration Build is made by automated build tools like: make, Ant, Maven, etc. Automated tests results and software metrics are collected for each build Build process is executed and results published on CI server
5. Build CI server executes build scripts regularly: Predefined delay is used to execute build scripts. Every one hour for example CI server regularly checks SCM system and in case of changes made since last build time a new build is made
6. Build status Each build has a status: successful or failed Build is considered as successful if all build tasks were executed without errors and failed otherwise Automated tests are executed as build tasks
8. Build artifacts Each build receives unique number. Build artifacts are published with this number.
9. Build artifacts Build artifacts are different from project to project but usually they include: Binaries: installation package, application files, … Generated documentation: API, end-user documentation, … Unit test results: time taken, code coverage, … Software metrics: LOC changes, PMD, CRAP index, coding standards violations, …
10. Binary packages Binary packages produced by build process may include: Installation packages Executable binaries Etc.
11. Documentation Usually API documentation is compiled during build and is published within other artifacts End-user documentation also may be compiled and published accordingly to project needs
13. Code coverage Code coverage used to show which lines of source code has been tested with unit tests 100% code coverage is a required but not a sufficient criteria for measuring test quality
16. Coding standards violations Strict coding standards in a project help to improve reading and understanding of code and raise maintainability With help of specialized tools coding standards may be checked as part of build process
17. Software metrics A software metric is a measure of some property of a piece of software or its specifications. LOC - Lines Of Code PMD – Project Mess Detector C.R.A.P. – Change Risk Analysis and Predictions Code coverage
18. Advantages Early notification about integration errors Early warning about broken code Immediate unit testing of all changes Constant availability of build packages including: testing, demo, beta, etc. Collected software metrics focus developers on producing high quality code
19. Software A wide range of CI software is available providing different notification medias, SCM systems, build tools support and IDE integration: CruiseControl Bamboo Hudson BuildBot Etc.
20. CruiseControl CruiseControl is an extensible framework for creating continuous build process: It includes dozens of plugins for a variety of source controls, build technologies, and notifications schemes including email and instant messaging A web interface to view details and access artifacts of builds
21. CruiseControl CruiseControl is written in Java but is used on a wide variety of projects thanks to different build tools supported: Ant, NAnt, Maven, Phing, Rake, Xcode “exec” builder which can be used with any command-line tool or script
22. CruiseControl May be used with C/C++ since build tasks can be wrapped into Ant tasks CppUnit or CxxTest can be used as unit testing framework
25. phpUnderControl phpUnderControl is customization of CruiseControl that brings functionality needed for PHP projects: PHPUnit PHPDocumentor PHP_CodeSniffer …
31. peer code review Improves code quality and aids software developers professional growth
32. Code review Code review is a process of checking programming code for common mistakes, vulnerabilities, bugs and errors. Code might be reviewed by author, team members or 3rd party company providing code review service.
33. Code review Several common types of code review: Formal inspection – code is reviewed on a projector by a team of reviewers Over-the-shoulder review where author walks the reviewer though a set of code changes E-mail pass-around – whole files or changes are packed up by the author and sent to reviewers via email Tool assisted – specialized code review tools are used
34. Peer code review Systematic examination of code individually by each reviewer. Usually developers are able to review each other code in a small team, but it’s better to set rules for handling review process roles.
35. Peer code review best practices Review fewer than 200-400 lines of code at a time Take enough time for a proper, slow review, but not more than 60-90 minutes Verify that defects are actually fixed
36. Advantages Helps to identify bugs early Encourages collaboration and builds a team Helps in keeping code maintainable Improves code quality Improves cross team know-how Shares experience within a team Improves developers professional skills
40. Crucible Web based peer code review tool Simplified workflow Integrates with Fisheye and JIRA since it is ATLASSIAN’s product Pre and post commit reviews are supported Integration into Eclipse & IntelliJ IDEA
41. Crucible To start a new review Crucible allows: Selecting concrete revision, for example the most recent commit in Subversion or revision identified by number or date Selecting individual files and folders (even from different revisions)
46. Engineering environment Our engineering environment approach was specially designed for web development though some subsystems may be utilized for non-web development as well. Environment is based on dedicated server where project code is developed and tested – remote environment.
47. Environment components CI: CruiseControl + phpUnderControl Peer code review: Crucible SCM system: Subversion Development web servers Database, memcached, etc. Development toolsPhpMyAdmin, PHPUnit, PHPDocumentor
48. Environment components Each component is highly tuned to simplify it’s use and speed up development Subversion hooks are used to apply validation rules on committed code and send on-commit notifications to the team Web server components are configured accordingly to project requirements
49. Remote environment Code is developed, tested and stored on a remote dedicated server Each developer has isolated environment where he has good control over his vhosts configuration
50. Key points Environment similar to production (server OS, cron jobs, tools and software) Abstracts developers from occasional need in environment reconfiguration since this is made only once by server admin Possibility to send links to development/current/demonstration version of project
51. Key points Build automation, continuous integration Engineering tools suite: debugging tools, common frameworks and libraries, unit testing suite, build tools, database management tools Centralized backup
52. Subversion Subversion is used as Version Control System and provides following benefits: IDE integration Access over WebDav (web browser) Hooks system
54. Subversion Hooks Subversion hooks system allows to execute custom program on some repository event. With post-commit hooks we send on-commit emails notifying team about changed made in the repository. Pre-commit hooks are used to validate coding standards and apply other rules.
57. Remote development Every developer has a separate account on development server with access over SSH Remote files might be accessed via: SFTP/SCP FTP/FTPS Samba (Windows network share)
59. Private namespace (subdomains) Every developer has full control over subdomains of USERNAMENAME.dev.gface.de Subfolders in ~/vhosts/are automatically mapped to domain names:
60. Development web servers Several development web servers with different configurations and- or modules may run on dev server. With help of reverse proxy it is possible to switch between servers by simply prefixing domain name with server identificator.