continuous integration for se group meeting

Post on 12-May-2015

326 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CONTINUOUS INTEGRATION

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

3

WHAT IS CONTINUOUS INTEGRATION?

Widely used software

engineering practice

Approach helping to

reduce risks

development process automation technique

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

5

PREREQUISITES FOR CONTINUOUS INTEGRATION

Not everything

integrate continuously

you can

6

PREREQUISITES FOR CONTINUOUS INTEGRATION

VCS system

Build automatio

n

Self-testing

app (unit-tests)

Separate server

(usually)

CI tool

7

GENERAL CI WORKFLOW

Committing latest

changes

Update by scheduler

(on CI server)

Build (compilation,

unit-testing, db integration,

etc)

Application is ready

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

11

CI TOOLS

CruiseControl

CruiseControl.NET

CruiseControl.rb

JetBrains TeamCity

Apache Hudson

Apache Continuum

Atlassian Bamboo

FinalBuilder

phpUnderControl

XInc

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

13

CONTINUOUS INTEGRATION – PART OF SDLC

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

14

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

Basic continuous integration

CONTINUOUS INTEGRATION – PART OF SDLC

15

InitiationRequirements

development & management

Design

ImplementationIntegrationTesting

Deployment Maintenance & support Utilization

Basic continuous integration

Extended build management

CONTINUOUS INTEGRATION – PART OF SDLC

16

BUILD TOOLS

Ant

NAnt

MSBuild

Maven

Make

Phing

Rake

17

UNIT TESTING TOOLS

Junit

NUnit

CppUnit

PHPUnit

SimpleTest

JSUnit

J3Unit

18

INSPECTIONS TOOLS.TEST COVERAGE

Cobertura Atlassian Clover jTest JCoverage CodeCover EMMA Parasoft Insure+

+ Ncover Xdebug Coverage.py

19

INSPECTIONS TOOLS.TEST COVERAGE

C++C#

PHPPython

Java

Cobertura Atlassian Clover jTest JCoverage CodeCover EMMA Parasoft Insure+

+ Ncover Xdebug Coverage.py

20

INSPECTIONS TOOLS.STATIC ANALYSIS

PMDFindBugsJLint FxCopCheckstyleReSharperPHP_CodeSnifferYascaNDepend

21

INSPECTIONS TOOLS.COPY/PASTE DETECTORS

CPD (Copy paste detector)CheckstyleSimianJplagAtomiqClone diggerPBA

22

DOCUMENTATION GENERATIONTOOLS

Doxygen

JavaDoc

NDoc

CppDoc

phpDocumentor

pyDoc

RDoc

23

OTHER TOOLS

Source code

metrics (loc)

Dead code detectors

Profiling …

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

25

BENEFITS OF USING CI FOR RESEARCH

Reproducible results of research

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.

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).

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

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 …

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?

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

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”)

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.

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. …

35

RECOMMENDED READING

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

36

RECOMMENDED READING

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

37

RECOMMENDED READING

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

38

RECOMMENDED READING

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

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

top related