continuous integration for se group meeting

38
CONTINUOUS INTEGRATION

Upload: sergii-shmarkatiuk

Post on 12-May-2015

326 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Continuous integration for se group meeting

CONTINUOUS INTEGRATION

Page 2: Continuous integration for se group meeting

2

PRESENTATION PLAN

1. State of the practice1. What is continuous integration?2. Why do development teams need continuous integration?3. Prerequisites for continuous integration process4. General CI workflow5. How does continuous integration affect development

process?6. When CI is not effective?7. Short tools overview8. Benefits of using CI

2. Problems with current state of the practice

3. Research ideas

4. Future of CI

5. CI and COPE

6. Recommended readings

Page 3: Continuous integration for se group meeting

3

WHAT IS CONTINUOUS INTEGRATION?

Widely used software

engineering practice

Approach helping to

reduce risks

development process automation technique

Page 4: Continuous integration for se group meeting

4

WHY DO TEAMS NEED CONTINUOUS INTEGRATION?

Martin Fowler:

… team integrate their work frequently,… leading to multiple integrations per day. … this approach leads to significantly reduced integration problems and allows a team to

develop cohesive software more rapidly.

CI is the one of the XP practicesAllows team to get fresh latest

build regularly

Page 5: Continuous integration for se group meeting

5

PREREQUISITES FOR CONTINUOUS INTEGRATION

Not everything

integrate continuously

you can

Page 6: Continuous integration for se group meeting

6

PREREQUISITES FOR CONTINUOUS INTEGRATION

VCS system

Build automatio

n

Self-testing

app (unit-tests)

Separate server

(usually)

CI tool

Page 7: Continuous integration for se group meeting

7

GENERAL CI WORKFLOW

Committing latest

changes

Update by scheduler

(on CI server)

Build (compilation,

unit-testing, db integration,

etc)

Application is ready

Page 9: Continuous integration for se group meeting

10

TOOLS CLASSIFICATION

CI tools

Build management tools

Unit testing tools

Inspection tools• Code coverage analysis• Static analysis (syntax check, code

dependencies)• Copy/paste detectorsDocumentation generation tools

Page 10: Continuous integration for se group meeting

11

CI TOOLS

CruiseControl

CruiseControl.NET

CruiseControl.rb

JetBrains TeamCity

Apache Hudson

Apache Continuum

Atlassian Bamboo

FinalBuilder

phpUnderControl

XInc

Page 11: Continuous integration for se group meeting

12

CI TOOLS

Too many tools All are great All have the same principle But each has specific features

Diagrams, metrics, reporting

Integration with SCM

toolsNotification

Interface, usability

Distributed builds

Different ALM

approaches

Page 12: Continuous integration for se group meeting

13

CONTINUOUS INTEGRATION – PART OF SDLC

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

Page 13: Continuous integration for se group meeting

14

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

Basic continuous integration

CONTINUOUS INTEGRATION – PART OF SDLC

Page 14: Continuous integration for se group meeting

15

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

Basic continuous integration

Extended build management

CONTINUOUS INTEGRATION – PART OF SDLC

Page 15: Continuous integration for se group meeting

16

BUILD TOOLS

Ant

NAnt

MSBuild

Maven

Make

Phing

Rake

Page 16: Continuous integration for se group meeting

17

UNIT TESTING TOOLS

Junit

NUnit

CppUnit

PHPUnit

SimpleTest

JSUnit

J3Unit

Page 17: Continuous integration for se group meeting

18

INSPECTIONS TOOLS.TEST COVERAGE

Cobertura Atlassian Clover jTest JCoverage CodeCover EMMA Parasoft Insure+

+ Ncover Xdebug Coverage.py

Page 18: Continuous integration for se group meeting

19

INSPECTIONS TOOLS.TEST COVERAGE

C++C#

PHPPython

Java

Cobertura Atlassian Clover jTest JCoverage CodeCover EMMA Parasoft Insure+

+ Ncover Xdebug Coverage.py

Page 19: Continuous integration for se group meeting

20

INSPECTIONS TOOLS.STATIC ANALYSIS

PMDFindBugsJLint FxCopCheckstyleReSharperPHP_CodeSnifferYascaNDepend

Page 20: Continuous integration for se group meeting

21

INSPECTIONS TOOLS.COPY/PASTE DETECTORS

CPD (Copy paste detector)CheckstyleSimianJplagAtomiqClone diggerPBA

Page 21: Continuous integration for se group meeting

22

DOCUMENTATION GENERATIONTOOLS

Doxygen

JavaDoc

NDoc

CppDoc

phpDocumentor

pyDoc

RDoc

Page 22: Continuous integration for se group meeting

23

OTHER TOOLS

Source code

metrics (loc)

Dead code detectors

Profiling …

Page 23: Continuous integration for se group meeting

24

BENEFITS OF USING CI Reduces risks of problems with source code integration by

stimulating team members to perform integration early and often.

Provides automated reports about code quality. Increases visibility of current project status and project

progress by providing shared reports available to all team members.

Provides historical data on source code quality and metrics.

Always contains last fresh build that could be used for deployment, testing or other purposes.

Reduces number of routine repetitive activities by automating part of development lifecycle.

Runs costly inspections on the server (in contrast to inspections available in modern IDEs)

Stimulates developers to write better source code

Page 24: Continuous integration for se group meeting

25

BENEFITS OF USING CI FOR RESEARCH

Reproducible results of research

Page 25: Continuous integration for se group meeting

26

PROBLEMS “Don’t break the build” obsession.

This rule undermines cooperation, transparency and trust between team members

Root cause of the problem is failure to draw apply different CI practices for different SDLC stages (development and release)

Necessity to instantiate CI build plan for separate branch/codebase Some branches require instantiation of CI build plan,

some don’t Usually there is no rule specifying whether branch

should have its own CI build plan configuration Benefits of CI are different for different SDLC stages Necessity to write and support build scripts

Very often it happens that activity of supporting build scripts is not a priority.

Page 26: Continuous integration for se group meeting

27

PROBLEMS

Even though builds run automatically, somebody needs to support and configure CI server if project grows in size.

Continuous deployment and continuous release seem to be a good idea, but do not usually occur in practice due to lack of flexibility and configuration complexity.

Teams that use CI are forced to make some premature commitments that are difficult to change later (project structure, deployments configuration, etc).

Page 27: Continuous integration for se group meeting

28

WHEN CI IS NOT EFFECTIVE?

Pure DVCS (without central repo) Experimental development Small projects Interpreted languages without unit-tests When database is being changed too

often Types of projects

Documentation (BA, etc)DBSupport & maintenance

Page 28: Continuous integration for se group meeting

29

WHY SHOULD WE USE CI IF IDES ALREADY HAS EVERYTHING WE NEED?

Modern IDEs already have: embedded build systems unit-tests static inspections dynamic inspections code coverage metrics documentation generation …

Page 29: Continuous integration for se group meeting

30

Think about continuous integration as part of your IDE running in the cloud

Therefore, it is assumed that list of CI advantages, disadvantages would be applicable to online IDEs running in the cloud

WHY SHOULD WE USE CI IF IDE ALREADY HAS EVERYTHING WE NEED?

Page 30: Continuous integration for se group meeting

31

POTENTIAL AREAS OF RESEARCH Smart CI

suggestion of the most important code quality issues prioritization of code quality report items

Inclusion of refactorings suggestion into CI builds API refactorings Automatic migration to next versions of libraries

Increase adaptability of CI tools automatic configuration of inspections detect when it is optimal to perform incremental

build and when it is optimal to perform full build Detect when separate branch should be created

to configure separate CI build plan. “Refactor” CI practices for better scalability

Page 31: Continuous integration for se group meeting

32

MOST IMPORTANT RESEARCH PROBLEM What is the problem?

Too much time and effort spent on "optimal configuration“ of CI builds.

Even though there is a high chance that optimal configuration exists, development teams are usually far from optimal solution.

As a result, every team invents its own configuration, which in vast majority of cases is not optimal enough for future scaling.

Even though CI is good at saving effort and reducing risk for teams of medium size, large projects have certain threshold after which support of CI tools becomes too complex and ambiguous.

After reaching certain project size CI does not scale anymore (“Tailspin effect”)

Page 32: Continuous integration for se group meeting

33

MOST IMPORTANT RESEARCH PROBLEM

Why is it important? Software become inherently complex Software projects grow in size But there is a certain cap for large projects when

development process cannot be effectively automated. Therefore, more time, effort and resources are spent on

ambiguous routine activities causing problems with software quality.

As projects grow in size, spending on software development and support increase when project size reaches certain threshold.

Page 33: Continuous integration for se group meeting

34

MOST IMPORTANT RESEARCH PROBLEM

Possible solutions: Development of common rules and practices for effective

scalability and embedding those practices into CI tools. “Refactoring” of existing CI practices to common practice

that makes project scalable. …

Page 34: Continuous integration for se group meeting

35

RECOMMENDED READING

1. Continuous Integration: Improving Software Quality and Reducing Risk by Paul M. Duvall, Steve Matyas, Andrew Glover

Page 35: Continuous integration for se group meeting

36

RECOMMENDED READING

2. Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation by By Jez Humble, David Farley

Page 36: Continuous integration for se group meeting

37

RECOMMENDED READING

3. Release It!: Design and Deploy Production-Ready Software by Michael T. Nygard

Page 37: Continuous integration for se group meeting

38

RECOMMENDED READING

4. Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Applications by Mark Clark

Page 38: Continuous integration for se group meeting

39

USEFUL LINKS

http://martinfowler.com/articles/continuousIntegration.html - the main article about CI from Martin Fowler

http://www.infoq.com/news/2009/03/Continuous-Deployment - Beyond Continuous Integration: Continuous Deployment

http://radar.oreilly.com/2009/03/continuous-deployment-5-eas.html - Continuous Deployment in 5 easy steps

http://www.proudlyserving.com/archives/2007/10/fear_of_a_broke.html - ‘fear of the broken build’ effect

http://www.youbrokethebuild.com/ - great posters created with the purpose of motivation people avoid breaking the build