Konzeption eines Qualitätsmanagement-Werkzeuges für die ... · Tempo der Softwareentwicklung...
Transcript of Konzeption eines Qualitätsmanagement-Werkzeuges für die ... · Tempo der Softwareentwicklung...
SWAR #12
Felix Hohlwegler – SS2019
Nachholtermine
Felix Hohlwegler – SS2019
Analyse
• Nachholtermine
• Vorlesung
• ??
• Übung:
Wiederholung
Felix Hohlwegler – SS2019
Tempo der Softwareentwicklung
• Desktop Anwendungen
• Office Suites, Browser, IDEs, Tools etc.
• Releases im Bereich von 0.5 – 3 Jahren
• Release Trains, fixe Release Zeitpunkte, z.B.: alle 12 Monate
• Mobile Applications
• Whatsapp, Instagram
• automatische Updates
• Release alle paar Tage (Maximal 1-3 Monate)
Felix Hohlwegler – SS2019
Tempo der Softwareentwicklung
• Release Train
Felix Hohlwegler – SS2019
Ein Software-Release-Zug ist eine
Form eines Software-Release-
Zeitplans, in dem eine Reihe
verschiedener Serien von
versionierten Software-Releases für
mehrere Produkte als eine Anzahl
verschiedener "Züge" in
regelmäßigen Abständen
veröffentlicht werden. Wikipedia
https://www.google.com/search?q=release+trains&safe=off&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjJyMmJt57iAhXC8qYKHWkpCXoQ_AUIDigB#imgrc=hZ75ys37WfHpXM:
Fehlerbehebungskosten
Felix Hohlwegler – SS2019
Anforderungen an den
SW-Entwicklungsprozess
Felix Hohlwegler – SS2019
• kleine Teams
• Agile Entwicklung
• Testgetriebene Entwicklung
• Komponentenbasierte Architektur
• passende zugrundeliegende Architektur -> Gute Architektur ;)
• wenig Abhängigkeiten
• innerhalb der Applikation
• zu 3rd Party SW/Libs/Hardware
Continuous Integration
• Was ist Continuous Integration ?
• kontinuierliches Zusammenfügen von Komponenten einer Anwendung
• kontinuierliche Integration von Softwarekomponenten in die Gesamtcode-
Basis eines Programms
• Was ist das Ziel von CI?
• Steigerung der Softwarequalität
Felix Hohlwegler – SS2019
Continuous Integration
• Typische Tätigen beim CI?
• Build Prozesse
• Linking Prozesse
• beliebige andere Prozesse
• komplettes „Bauen“ einer Applikation
• automatisierte Tests
• Softwaremetriken erfassen
Felix Hohlwegler – SS2019
Continuous Integration
• Typische
Schritte
Felix Hohlwegler – SS2019
https://www.silverstripe.org/blog/developers-how-we-use-continuous-integration-at-silverstripe/
Themenblock 11
Felix Hohlwegler – SS2019
Ziele
• Sie kennen weitere CI Tools
• Sie wissen, was Continuous Deployment ist
• Sie wissen, was Continuous Delivery ist
• Sie wissen, was ein Build Management ist
Felix Hohlwegler – SS2019
AWS CodePipeline
• CI Build Server
• AWS CodePipeline ist ein vollständig verwalteter Continuous-Delivery-Service, mit dem Sie Ihre
Veröffentlichungs-Pipelines für schnelle und zuverlässige Updates von Anwendungen und Infrastruktur
automatisieren können.
Felix Hohlwegler – SS2019
https://aws.amazon.com/de/codepipeline/
AWS CodePipeline
Felix Hohlwegler – SS2019
Continuous Deployment
Felix Hohlwegler – SS2019
Continuous Deployment
• Was ist Continuous Deployment?
• Teil der Continuous Integration
• kontinuierliche Auslieferung der Software
Felix Hohlwegler – SS2019
Continuous Deployment
• Grundlagen
• Produktivsetzung der Software auf Knopfdruck
• jede Produktivsetzung verspricht bessere Qualität als die vorherige
• Aufhebung des Phasenmodells der Softwareentwicklung
• umfassende Tests vor Go-Live
• Geschwindigkeit
Felix Hohlwegler – SS2019
Continuous Deployment
• Nachteile
• muss eingerichtet werden
• Für jedes Projekt spezifisch
• Einrichtung meist komplex
Felix Hohlwegler – SS2019
Continuous Delivery
Felix Hohlwegler – SS2019
Continuous Deployment
• Was ist Continuous Delivery?
• Techniken, Prozesse und Werkzeuge, mit deren Hilfe kurze Entwicklungszyklen
und die schnelle Auslieferung von Software-Updates oder produktiven Endsystemen
ermöglicht werden
• Menge von Validierungen, die vor Go-Live „passed“ sein müssen
Felix Hohlwegler – SS2019
Continuous Deployment
• Unterschied Continuous Deployment / Delivery
• kein Synonym
• Deployment ist mehr als Delivery
• C-Deployment => Auch Deployment auf Live-Infrastruktur
• C-Delivery nur bis ins Staging
• danach Manuelles Exponieren
Felix Hohlwegler – SS2019
Schritte zum CD
Felix Hohlwegler – SS2019
Continuous Deployment
Continuous Pipeline
Deployment Automation
Continuous Integration
Configuration Management
Automated Testing
Agile Development
Build Management
Felix Hohlwegler – SS2019
Build Management
• Kennt Ihr schon ein Build-Management-Tool?
• SBT
Felix Hohlwegler – SS2019
Build Management
• bisher wurde die Software über die IDE gebaut
• Jenkins ist unabhängig von der IDE - es wird ein Buildprozess gebraucht
• Was macht ein Buildprozess?
• Code kompilieren
• Ausführen automatischer Tests
Felix Hohlwegler – SS2019
Build Management
• Build Tools
• Shell Scripts
• Make
• Rake
• Grunt
• Gulp
• Composer
• SBT
• Ant
• Maven
• Gradle
• …. Felix Hohlwegler – SS2019
Felix Hohlwegler – SS2019
ANT
• ANT
• entwickelt von SUN als Alternative zu „make“
• für JSP/Servlet-Engine und Tomcat
• implementiert in Java
• XML für die Definition des Ablaufs und der Abhängigkeiten → build.xml
Felix Hohlwegler – SS2019
ANT
Felix Hohlwegler – SS2019
ANT
Felix Hohlwegler – SS2019
ANT
Felix Hohlwegler – SS2019
Felix Hohlwegler – SS2019
MAVEN
• MAVEN
• Software Management Tool
• Basiert auf einem Project Object Model (POM)
• XML Datei
• Beinhaltet alle Projekt und Konfigurationsdetails
• Verwaltet Project Build
• Stellt Reportings bereit
• Verwaltung der Dokumentation an einem zentralen Ort
Felix Hohlwegler – SS2019
MAVEN
• MAVEN ist mehr als ein Build Tool
• Build Prozess
• Einheitliches Build System
• Abhängigkeit Management
• Dokumentationstool
• Qualitätsinformationen
• Richtlinien für die Best Practices Entwicklung
Felix Hohlwegler – SS2019
MAVEN
• MAVEN in 5 Minutes
• Java muss installiert sein
• Maven Installieren https://maven.apache.org/download.cgi
• mvn –version
• mvn archetype:generate -DgroupId=com.mycompany.app
-DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.4 -DinteractiveMode=false
Felix Hohlwegler – SS2019
MAVEN
• MAVEN in 5 Minutes
Felix Hohlwegler – SS2019
MAVEN
• MAVEN in 5 Minutes
Felix Hohlwegler – SS2019
src -> Normal Java classes
test -> JUnit Test classes
MAVEN
• pom.xml
• Core der Projektkonfiguration
• Single Configuration File
• Kann sehr groß & komplex werden
• Es ist nicht notwendig, alle Feinheiten zu verstehen, um sie effektiv nutzen
zu können
Felix Hohlwegler – SS2019
MAVEN
• pom.xml
Felix Hohlwegler – SS2019
MAVEN
Felix Hohlwegler – SS2019
MAVEN
• 1. Sektion (Dependencies) legt alle notwendigen Libraries fest
Felix Hohlwegler – SS2019
MAVEN
• 2. Sektion: Build: Die "Tasks" werden über Plugins definiert, die selbst über die GAVParameter
eindeutig identifiziert sind.
Felix Hohlwegler – SS2019
MAVEN
• 3. Sektion: Reporting
Felix Hohlwegler – SS2019
MAVEN
• Build
• mvn package
• Maven Phasen (Standard Lebenszyklus)
• validate: validate the project is correct and all necessary information is available
• compile: compile the source code of the project
• test: test the compiled source code using a suitable unit testing framework. These tests should not
require the code be packaged or deployed
• package: take the compiled code and package it in its distributable format, such as a JAR.
• integration-test: process and deploy the package if necessary into an environment where integration
tests can be run
• verify: run any checks to verify the package is valid and meets quality criteria
Felix Hohlwegler – SS2019
MAVEN
• Maven Phasen
• install: install the package into the local repository, for use as a dependency in other projects locally
• deploy: done in an integration or release environment, copies the final package to the remote repository
for sharing with other developers and projects.
• Beispiele
mvn compile; mvn test; mvn deploy
Felix Hohlwegler – SS2019
MAVEN
• Maven Projekt über Jenkins bauen
• Create a new Project in Jenkins
• Use freestyle
• Add your Git URL to the project
• Set the path to your pom file
• Check in the Workspace of the Jenkins project
• Add Post action SonarQube
• This requires a pom.xml file
• Get it to build successfully
Felix Hohlwegler – SS2019
Felix Hohlwegler – SS2019
Gradle
Felix Hohlwegler – SS2019
• Build-Management & Automatisierungstool
• Groovy basierende Projekt Konfiguration
• Offizielles Build System für Android
• Leichte Integration und Migration
• Out of the Box Support für ANT, Maven, Ivy
• Schneller aufgrund inkrementeller Builds
Gradle
Felix Hohlwegler – SS2019
• Gradle vs. Maven
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>de.htwg.examples</groupId>
<artifactId>example</artifactId>
<version>0.1-SNAPSHOT</version>
</project>
apply plugin: 'java'
Gradle
Felix Hohlwegler – SS2019
• Dependency Management
• Voll kompatibel mit Maven und Ivy und deren Repos
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core',
version: '3.6.7.Final'
}
dependencies {
compile 'org.hibernate:hibernate-core:3.6.7.Final'
}
build.gradle
short way
Gradle
Felix Hohlwegler – SS2019
if (environment != 'production') {
println 'Production build!'
providedCompile 'javax.servlet:servlet-api:3.+'
compile('org.springframework.boot:spring-boot-starter-web:
${springBootVersion}') {
exclude module: 'spring-boot-starter-tomcat'
exclude module: 'spring-boot-starter-jetty'
}
} else {
if (embeddedserver == 'jetty') {
compile('org.springframework.boot:spring-boot-starter-web') {
exclude module: 'spring-boot-starter-tomcat'
}
compile('org.springframework.boot:spring-boot-starter-jetty')
} else {
compile('org.springframework.boot:spring-boot-starter-web:
${springBootVersion}')
}
testCompile 'junit:junit:4.12'
}
Gradle
Felix Hohlwegler – SS2019
• Plugins
• Gradle selbst ist klein und bietet nur wenige Funktionen
• Erweiterbar durch Plugins / Aufgaben
• Plugins für
• Java
• Android
• Scala
• IDEA (Intellij)
• NodeJS
• C++
• https://plugins.gradle.org/