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


Published on

This training material describes basics of Continuous Integration practice

Published in: Technology
  • Be the first to comment

Continuous Integration

  1. 1. Continuous IntegrationStanislav Tyurikov
  2. 2. Business GoalProfit increasingTotal Profit = Project Profit [1] + … + Project Profit [N]Project Profit = Project Revenue – Project CostsIncrease projectcountIncrease projectpriceDecrease projectcosts
  3. 3. Lean Software Development: Wastes• Defects• Overproduction• Transportation• Waiting• Inventory• Motion• Extra processing
  4. 4. Cost of changeRequarements Design Coding Testing ProductionCostofchangeProject phase
  5. 5. What Continuous Integration is?Continuous integration (CI) implements continuous processes ofapplying quality control - small pieces of effort, appliedfrequently. Continuous integration aims to improve the quality ofsoftware, and to reduce the time taken to deliver it, by replacingthe traditional practice of applying quality control aftercompleting all development.©
  6. 6. FeedbackMechanismcommit changes(1)VersionControl SystemContinuousIntegration SystemBuild ScriptDevelopersPoll (2)Report (4)Execute (3)Compile Source CodeRun InspectionsRun DB ScriptsRun TestsDeploy SoftwareLook (5)CI Scenario
  7. 7. • Write Automated Developer Tests• Run Private Builds• All Tests and Inspections Must Pass• Don’t Commit Broken Code• Fix Broken Builds Immediately• Commit Code Frequently• Avoid Getting Broken Code• Run Manual Integration Builds (optional)Developer
  8. 8. • Separate Build Scripts from Your IDE• Automate Builds• Perform Single Command Builds• Build for Any Environment• Fail Builds FastBuild Script
  9. 9. • Centralize Software Assets• Create a Consistent Directory StructureVersion Control System
  10. 10. • CI Server always available• Use a Dedicated Integration Build Machine• Stage BuildsCI Server
  11. 11. • Getting the right information to the right people atthe right time and in the right way—CI is the besttool for making this feedback automated, targeted,and real-time (continuous).• Email, IM, SMS an other feedback mechanisms canbe used.Feedback Mechanism
  12. 12. • Reduce Code Complexity• Perform Design Reviews Continuously• Maintain Organizational Standards with Code Audits• Reduce Duplicate Code• Assess Test Code Coverage (after test execution)Continuous InspectionCompilation Inspection Testing DeploymentContinuous Integration
  13. 13. What Continuous Testing is?• Is a part of continuous integration process• Test are created on development phase• All test are automated• Tests are frequently executedContinuous IntegrationCompilation Inspection Testing Deployment
  14. 14. Continuous Test Types• Unit Tests• Component (Integration) Tests• System Tests• Functional (Acceptance, Story) TestsDBAPIUI
  15. 15. Automate Unit TestUnit Test verifies the behavior of small elements in a softwaresystem, which are most often a single class or method. Every UTmust have several characteristics (F.I.R.S.T.):• Fasttakes a little time to execute (less than 0,01 sec).• Isolateddoes not interact with over parts of a system, failure reasons become obvious.• Repeatablerun repeatedly in any order, any time.• Self-Checkingno manual evaluation required.• Timelywritten before the code.DBAPIUI
  16. 16. Automate Component Tests• Component or subsystem tests verify portions of asystem and may require a fully installed system orsome external dependencies, such as databases, filesystems, or network endpoints, to name a few.• Tend to run longer than UT.DBAPIUI
  17. 17. Automate System Tests• System tests exercise a complete software systemand therefore require a fully installed system, suchas a servlet container and associated database.• Tend to run longer than CT.• Use system API to perform testing.DBAPIUI
  18. 18. Automate Functional Tests• Functional tests, as the name implies, test thefunctionality of an application from the viewpoint ofa client, which means the tests themselves mimicclients (for example, using Silenium).• Tend to run longer than ST.DBAPIUI
  19. 19. Functional TestsSystem TestsTest ScopesData AccessObjectBusinessLogic ServiceWeb ServiceDBWeb PageUnit TestsIntegrationTests
  20. 20. Run Faster Test FirstUnit Test Component Test System Test Functional TestAlso known as Integration TestAcceptance/StoryTestDepends onExecution Time ms sec min hourDescriptionCheck class,methodTest componentintegrity, DBqueries.System API (WS,JNDI, etc), externalclient interactionCustomer oriented.Use UI controls,pages, links, etc.execution orderEach kind of test has its own area of responsibility, setup efforts, and accordingly,different execution time.
  21. 21. • Set of test works like safety net. Once a new test is added, it will alwayscover target functionality.• If defect has been found, you can create additional test case for it (defect-driven development). This makes your safety net much effective to preventdefect reappearance.add new test cases to makethe safety net much effectiveSafety Net & Defect-Driven Development
  22. 22. • Release Working Software Any Time, Any Place• Label a Repository’s Assets• Produce a Clean Environment• Label Each Build• Run All Tests• Create Build Feedback Reports• Possess Capability to Roll Back ReleaseContinuous DeploymentCompilation Inspection Testing DeploymentContinuous Integration
  23. 23. The most typical problems which CI solves:• “It Works on My Machine”• “The Missing Click“• “Did You Get the Memo?”• Regression Testing• Inability to Visualize Software• Coding Standard Adherence• Code DuplicationTypical problems
  24. 24. Without Continuous Testing:With Continuous Testing:timetimeWithout CT lots of efforts and time are spent to find bugs and apply CR. CTs makethese activities more painless, but we have to create and support test as well.Automated Tests:1) Increase coding time.2) Decrease bug searching/debugging time.3) Decrease functionality modification time.Coding Bug Fixing Functionality ModificationCoding Bug Fixing Functionality ModificationTime Saving Hypothesis
  25. 25. Additional InformationBooks & articles:• Continuous Integration: Improving Software Quality and Reducing Risk.• Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation.• Implementing Lean Software Development: From Concept to Cash.• The Art of Lean Software Development.• Continuous Integration by Martin Fowler.Google it! =)