+ All Categories
Home > Software > Improving software quality using Continuous Integration

Improving software quality using Continuous Integration

Date post: 21-Mar-2017
Category:
Upload: wouter-konecny
View: 47 times
Download: 0 times
Share this document with a friend
59
CONTINUOUS INTEGRATION IMPROVING SOFTWARE QUALITY USING
Transcript
Page 1: Improving software quality using Continuous Integration

CONTINUOUS INTEGRATIONIMPROVING SOFTWARE QUALITY USING

Page 2: Improving software quality using Continuous Integration

▸ Software Engineer / IT Consultant

▸ Sinds 2013 bij InfoSupport

▸ Nederlandse Spoorwegen

▸ Laatste game: Horizon - Zero Dawn

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

NICK HOL WOUTER KONECNY

EVEN VOORSTELLEN

Page 3: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

NICK HOL WOUTER KONECNY

EVEN VOORSTELLEN

▸ Software Engineer / IT Consultant

▸ Sinds 2013 bij InfoSupport

▸ Nederlandse Spoorwegen

▸ Laatste game: Horizon - Zero Dawn

Page 4: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

INFO SUPPORT

Page 5: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

AGENDA

▸ Doel

▸ The right tools

▸ Git

▸ Build tooling

▸ Continuous integration

▸ Pauze

▸ Sonar

▸ Continuous delivery

▸ Nexus

Page 6: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

DOEL

▸ Quick start

▸ Software Craftsmanship

Page 7: Improving software quality using Continuous Integration

THE RIGHT TOOLSIMPROVING SOFTWARE QUALITY USING

Page 8: Improving software quality using Continuous Integration

ONTWIKKELSTRAAT

Page 9: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

ONTWIKKELSTRAAT

▸ Kwaliteit

▸ Constante Feedback

▸ Snelheid

▸ Parallel

▸ Geautomatiseerde testen

▸ Minder human error

Page 10: Improving software quality using Continuous Integration

GITIMPROVING SOFTWARE QUALITY USING

Page 11: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

GIT

▸ Branching

▸ GitFlow

Page 12: Improving software quality using Continuous Integration

MAIN BRANCHES

Page 13: Improving software quality using Continuous Integration

MAIN BRANCHES

Page 14: Improving software quality using Continuous Integration

SUPPORTING BRANCHES

Page 15: Improving software quality using Continuous Integration

SUPPORTING BRANCHES

Page 16: Improving software quality using Continuous Integration

SHORT BRANCH LIFETIME

Page 17: Improving software quality using Continuous Integration

HOTFIXES

Page 18: Improving software quality using Continuous Integration

HOTFIXES

Page 19: Improving software quality using Continuous Integration

SO…

Page 20: Improving software quality using Continuous Integration

BRANCH OFTEN!

Page 21: Improving software quality using Continuous Integration

COMMIT OFTEN!

Page 22: Improving software quality using Continuous Integration

MERGE OFTEN!

Page 23: Improving software quality using Continuous Integration

HANDS-ON: GIT

Page 24: Improving software quality using Continuous Integration

HANDS-ON: GIT1. Clone

https://gitlab.rhea.infosupport.net/huprojecten/godiva-en-fff-backend.git

2. Checkout branch ‘develop’: git checkout develop

3. Maak eigen branch met naam als ‘develop-sonarcoverage-NH’ (NH als je naam ’N’ick ‘H’ol is)git branch -b develop-sonarcoverage-XX

4. Push nieuwe branch

Page 25: Improving software quality using Continuous Integration

BUILD TOOLINGIMPROVING SOFTWARE QUALITY USING

Page 26: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

BUILD TOOLING

▸ Ant

▸ Flexibel en Verbose

▸ Snel onoverzichtelijk

▸ Maven

▸ Snelle start en Makkelijk te begrijpen

▸ Door lifecycle

▸ Custom werk is lastiger

▸ Gradle

▸ Flexibel en leesbaar

▸ Eigen DSL gebaseerd op Groovy

Page 27: Improving software quality using Continuous Integration

AUTOMATE EVERYTHING

Page 28: Improving software quality using Continuous Integration

AUTOMATED TESTING

Page 29: Improving software quality using Continuous Integration

BUILD CONSISTENTLY

Page 30: Improving software quality using Continuous Integration

CONTINUOUS INTEGRATIONIMPROVING SOFTWARE QUALITY USING

Page 31: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

CONTINUOUS INTEGRATION

▸ Jenkins

▸ Bamboo

▸ teamcity

▸ Travis

▸ TFS

▸ and more…

Page 32: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

CONTINUOUS INTEGRATION

▸ Improves

▸ Quality

▸ Time to market

▸ Confidence

Page 33: Improving software quality using Continuous Integration

HANDS-ON: JENKINS

+

Page 34: Improving software quality using Continuous Integration

1. Ga naar Jenkins (https://rheabldj17.rhea.infosupport.net/)

2. Gebruik de pipeline “Godiva-en-fff-backend-workshop” https://rheabldj17.rhea.infosupport.net/job/godiva-en-fff-backend-workshop/

3. Start een build met je eigen branch

HANDS-ON: JENKINS

Page 35: Improving software quality using Continuous Integration

PAUZE

Page 36: Improving software quality using Continuous Integration

SONARIMPROVING SOFTWARE QUALITY USING

Page 37: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

SONAR

▸ Code conventions

▸ Duplicate code

▸ Good / bad practices

▸ Code coverage

▸ Potential bugs and performance issues, security issues

▸ Code complexity

▸ Documentation on methods / classes

▸ Good design and architecture (structure 101)

Page 38: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

Page 39: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

Page 40: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

Page 41: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

Page 42: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

Page 43: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

SONAR

▸ Code conventions

▸ Duplicate code

▸ Good / bad practices

▸ Code coverage

▸ Potential bugs and performance issues, security issues

▸ Code complexity

▸ Documentation on methods / classes

▸ Good design and architecture (structure 101)

Page 44: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

SONAR

Code coverage

Page 45: Improving software quality using Continuous Integration

HANDS-ON: COVERAGE

Page 46: Improving software quality using Continuous Integration

HANDS-ON: COVERAGE1. Voeg JaCoCo (Java Code Coverage) toe aan het project (in de pom.xml)

2. run ‘mvn test’ en controleer of onderstaande resultaat aanwezig is

3. Maak en commit en push deze

4. Start een build met je eigen branch

5. Controleer Coverage in Sonar https://sonar.rhea.infosupport.net/overview?id=100209

Page 47: Improving software quality using Continuous Integration

IDEALE CODE COVERAGE?

Page 48: Improving software quality using Continuous Integration

100% COVERAGE ON FUNCTIONALITY

Page 49: Improving software quality using Continuous Integration

DON'T WRITE TESTS TO HAVE TESTS

Page 50: Improving software quality using Continuous Integration

FIND AND REMOVE UNUSED CODE

Page 51: Improving software quality using Continuous Integration

FIND AND REMOVE UNUSED CODE

Page 52: Improving software quality using Continuous Integration

HANDS-ON: BUG FIXING

Page 53: Improving software quality using Continuous Integration

HANDS-ON: BUG FIXING1. Kies tussen bug fixes of coverage verhogen

2. Kies iets uit Sonar

3. Los het op!

4. Build je fix

5. Merge terug naar develop (indien groen)git merge —no-ff [branchnaam]

Page 54: Improving software quality using Continuous Integration

CONTINUOUS DELIVERYIMPROVING SOFTWARE QUALITY USING

Page 55: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

CONTINUOUS DELIVERY

▸ Develop of master branches triggered deployment

▸ Master triggers production deployment

Page 56: Improving software quality using Continuous Integration

NEXUSIMPROVING SOFTWARE QUALITY USING

Page 57: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

NEXUS

▸ Artefact repository

▸ Releases in publiceren

▸ Controleren 3rd party dependencies

Page 58: Improving software quality using Continuous Integration

VRAGEN

Page 59: Improving software quality using Continuous Integration

IMPROVING SOFTWARE QUALITY USING CONTINUOUS INTEGRATION

LINKS

▸ CI: https://www.martinfowler.com/articles/continuousIntegration.html

▸ GitFlow: http://nvie.com/posts/a-successful-git-branching-model/

▸ Deze presentatie: LINK NAAR PRESENTATIE


Recommended