continuous integration

13
Pooja Mantri SCIT

Upload: mantripooja

Post on 31-Oct-2014

4 views

Category:

Technology


1 download

DESCRIPTION

This presentation Describes Continuous Integration, Its benifits and best practices, and also tells how it is different from Nightly Builds

TRANSCRIPT

Page 1: Continuous Integration

Pooja MantriSCIT

Page 2: Continuous Integration

What is Integration?

Definition: “the act of combining into an integral whole”

In software development, integration includes… Combining source files Combining software and environment Combining software and data Combining software and requirements

(tests) Combining developers

2Pooja Mantri Continuous Integration

Page 3: Continuous Integration

Integration Testing in SDLC Combine the application’s components into

working software.

Historically done near the end of the project.

Very risky! Software modules don’t always work together as expected

Best case: Time to fix, time to retest that module Worst case: Time to determine why, time to

redesign, time to fix, time to test all of the modules affected by the redesign.

3Pooja Mantri

Continuous Integration

Page 4: Continuous Integration

Nightly Builds

Practice became popular in the late 90s after Microsoft published its development practices

Integrate all of the software on a nightly basis.

Smoke Test – run the application and conduct a minimal set of tests to see if it “catches fire”.

4Pooja Mantri

Continuous Integration

Page 5: Continuous Integration

Take it to the Extreme

Extreme Programming says… if testing is good, test all the time if integration testing is important,

integrate and test all the time if short iterations are good, make the

iterations really, really short (minutes and hours, not weeks and months)

Continuous Integration is born.

5Pooja Mantri

Continuous Integration

Page 6: Continuous Integration

What is Continuous Integration? It describes a set of software engineering

practices that speed up the delivery of software by decreasing integration times.

Integrates source code and runs tests after each commit of code to the source repository.

Near-immediate feedback to the developer from the authoritative source, the system itself.

6Pooja Mantri

Continuous Integration

Page 7: Continuous Integration

Example: Development of a Small Feature

Assumption: We have to do something which can be competed in few hours. The actual task doesn’t matter.

Development checks out current coy of the integrated source code.

He performs his task, tests it and commits the changes to the repository.

7Pooja Mantri

Continuous Integration

Page 8: Continuous Integration

The builder than merges the copy to the mainline. If any conflicts found they are fixed by the developer.

If no merge conflicts, builder builds the project on integration machine based on mainline code.

If compilation error, developer fixes it and repeats the process until builder can build a working copy which is properly synchronized with the mainline.

8Pooja Mantri

Continuous Integration

Page 9: Continuous Integration

Task is completed on if after a successful build.

If a clash between two developers exist, it is caught either when Second developer commits his local copy or Integration build fails

Thus error is detected rapidly

In continuous integration a failed integration build should never remain failed for long.

9Pooja Mantri

Continuous Integration

Page 10: Continuous Integration

Practices of continuous Integration Maintain a single source repository

Automate the build Make your build self-testing Everyone commits frequently Every commit should build the mainline

on an integration machine Keep the build fast Make it easy for anyone to get the latest

executable Everyone can see what’s happening Automate deployment

10Pooja Mantri

Continuous Integration

Page 11: Continuous Integration

Nightly vs. Continuous Builds Nightly builds generate deliverables. They result in

something tangible: something for QA to test something for product managers to review something to reassure team members that they are in fact

building a product.

Because of the external audience, the nightly build is a formal event, a mini-milestone that your team should hit without fail. Breaking the nightly build is something that generates blame and often consequences, such as becoming the build mother or being awarded a dunce cap.

Continuous Integration builds don’t need durable build products to be beneficial. They are a way for a developer to have a conversation with the system to gain reassurance that they have done their part.

Both must be used

11Pooja Mantri

Continuous Integration

Page 12: Continuous Integration

Benefits of Continuous Integration It minimizes integration risk.

It supports easier defect diagnosis.

Frequent Deployment

It saves time creating releases.

Encourages good testing habits

It enables other good development practices…

12Pooja Mantri

Continuous Integration

Page 13: Continuous Integration

C.I. Enables other Practices Test Driven Development

Fewer bugs, less time debuggingConfidence to refactorExecutable DocumentationValidation that you are complete

Release ManagementBuilds are centralizedBuilds are repeatable/re-creatableModifications are clearly mapped to releasesIssues are clearly mapped to releases and thus to modificationsReleases are only created with committed codeDigitally signed code

Enforcement of Company Development PolicyAutomate policy tests with CheckstyleManual code reviews can focus on design not syntax

13Pooja Mantri

Continuous Integration