Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Continuous integration

2,281 views

Published on

Published in: Technology
  • Be the first to comment

Continuous integration

  1. 1. Continuous Integration<br />Lior Tal<br />Automation Developer<br />
  2. 2. Continuous Integration<br />Automated Builds<br />Tools<br />DVCS (Git)<br />Agenda<br />
  3. 3. Continuous Integration<br />How good is our code?<br />I think it’s pretty good…<br />Does the code work?<br />I tested it, it seems to do what it should…<br />Does the code have bugs?<br />I hope not…<br />
  4. 4. Continuous Integration<br />Need to simplify complex integration of code<br />Need a good criteria for measuring our code quality<br />Need to have “Self-testing” code<br />
  5. 5. “a software development practice where members of a team integrate their work frequently, leading to multiple integrations per day.<br />Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. <br />Continuous Integration<br />
  6. 6. Developer checks in new code<br />An automated build is kicked off with all latest code changes<br />Unit tests and [optional] other tools are executed<br />Developer receives a notification if the build succeeded or failed<br />[optional] Failing commits are rejected from the source code repository<br />Continuous Integration<br />
  7. 7. The code should build directly from source control<br />The code should be built in a single automated command<br />This makes it easier in multiple scenarios:<br />New developer joins the team<br />Code is built automatically on a build server<br />Automated Builds<br />
  8. 8. Build script can be created using standard technologies<br />MSBuild<br />Batch file<br />Multiple build configurations should be defined<br />“Small” build that runs on every check in<br />Should be very fast<br />“Big” build that runs nightly<br />Can have a bigger scope (build MSI, run integration tests)<br />Automated Builds<br />
  9. 9. Many tools can be integrated into the build process<br />Some examples (.NET):<br />Code Coverage – Coverage (in %) by unit tests.<br />Code Duplications – find duplicated code<br />Code Analysis<br />StyleCop – Find styling errors in code<br />FXCop – Static code analysis<br />Tools<br />
  10. 10. Tools – Code Coverage<br />
  11. 11. Tools – Code Coverage<br />
  12. 12. Define a set of styling rules:<br />These can be run from the IDE or from a build script<br />Show warnings/errors when compiling:<br />Tools - StyleCop<br />
  13. 13. Many tools can be integrated into the build process<br />Some examples (.NET):<br />Code Coverage – Coverage (in %) by unit tests.<br />Code Duplications – find duplicated code<br />Code Analysis<br />StyleCop – Find styling errors in code<br />FXCop – Static code analysis<br />Tools – FXCop<br />
  14. 14. Older VCS tools are centralized (central server model)<br />Subversion, ClearCase<br />Centralized tools suffer from a few issues:<br />Network latency (server needed for most operations).<br />Submitting “half-ready” code can break other people’s work.<br />DVCS (Git)<br />
  15. 15. Many modern VCS tools are distributed<br />This means a central server is optional<br />Each developer gets a copy of the entire repository<br />A central server can still be setup<br />Used as a sync point for team members<br />DVCS (Git)<br />
  16. 16. Git offers a command line tool (comes from Linux)<br />On Windows:<br />Shell Extension<br />Visual Studio integration using plugins<br />DVCS (Git)<br />
  17. 17. Git Workflow<br />Centralized Workflow<br />
  18. 18. Git Workflow<br />Integration-Manager<br />
  19. 19. CI Implementation #1<br />CI Server<br />Source Control (Git)<br />TeamCity<br />Build Agent<br />CI Build<br />Nightly Build<br />
  20. 20. CI Implementation #1<br />What we gained:<br />Basic framework for more complicated tasks<br />Source control contains a “clean” copy of the code<br />Fast notification on build issues<br />Starting to incorporate basic unit tests<br />Installer (.MSI) creation is automatic<br />Using a modern source control system (Git)<br />
  21. 21. CI Implementation #2<br />CI Server<br />Git<br />CI Build<br />Build Agent<br />Build Agent<br />Build Agent<br />…<br />Nightly Build<br />VM Server<br />Win7 x64<br />Win7<br />Win XP<br />…<br />

×