Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jordine/se3sose2022vorlesung
  • jr125/se3sose2022vorlesung
  • lb189/se3sose2022vorlesung
  • mb345/se3sose2022vorlesung
4 results
Show changes
Showing
with 455 additions and 0 deletions
website/img/git-doku-cleancode/git-tdd.png

61 KiB

website/img/schnittstellen/message_broker.png

272 KiB

website/img/softwarearchitektur/big_ball_of_mud.png

3.92 KiB

website/img/softwarearchitektur/saturn_v_collage.jpg

290 KiB

website/img/sql-nosql/sql-nosql.png

97.8 KiB

website/img/vorlesung/20220523/miniuml.jpg

84.1 KiB

website/img/vorlesung/20220523/rpc.jpg

171 KiB

website/img/vorlesung/20220523/schnittstellenarten.jpg

216 KiB

website/img/vorlesung/20220530/rest.jpg

88.4 KiB

......@@ -12,29 +12,67 @@
<ul>
<li><a href="einfuehrung.html" target="_blank">Einführung</a></li>
<li><a href="anforderungsanalyse.html" target="_blank">Anforderungsanalyse</a></li>
<li><a href="softwarearchitektur.html" target="_blank">Softwarearchitektur</a></li>
<li><a href="clean-code_doku_git.html" target="_blank">git, Dokumentation, Clean Code</a></li>
<li><a href="maven-testing.html" target="_blank">Maven & Testing</a></li>
<li><a href="container-ci-cd.html" target="_blank">Container & CI/CD</a></li>
<li><a href="sql-nosql.html" target="_blank">SQL, NoSQL</a></li>
<li><a href="schnittstellen.html" target="_blank">Schnittstellen</a></li>
<li><a href="concurrency.html" target="_blank">Parallele Programmierung</a></li>
</ul>
<h3>Vorlesungnotizen</h3>
<ul>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220321.md" target="_blank">Vorlesungsnotizen - 21.03.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220328.md" target="_blank">Vorlesungsnotizen - 28.03.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220404.md" target="_blank">Vorlesungsnotizen - 04.04.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220411.md" target="_blank">Vorlesungsnotizen - 11.04.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220509.md" target="_blank">Vorlesungsnotizen - 09.05.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220516.md" target="_blank">Vorlesungsnotizen - 16.05.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220523.md" target="_blank">Vorlesungsnotizen - 23.05.2022</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/lecturenotes/20220523.md" target="_blank">Vorlesungsnotizen - 13.06.2022</a></li>
</ul>
<h3>Projekt</h3>
<ul>
<li><a href="https://docs.google.com/spreadsheets/d/1Iwfx41h3UNQ87pJJ5_lxpH2IBgm7GHFrbDZJYDxG-0s/edit?usp=sharing" target="_blank">Projekt Mitglieder und Beschreibung</a> </li>
<li><a href="projektideen.html" target="_blank">Projektideen/ Vorschläge</a></li>
<li><a href="assignments/bewertungsbogen.xlsx" target="_blank">Bewertungsbogen (work in progress, wird regelmäßig aktualisiert)</a></li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Projektbeschreibung.md" target="_blank">Projektbeschreibung</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/MVP-Infos.md" target="_blank">Informationen zur MVP-Vorstellung am 25.04.2022</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Anforderungsanalyse.md" target="_blank">Übung: Anforderungsanalyse</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Softwarearchitektur.md" target="_blank">Übung: Softwarearchitektur</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/git-Doku-CleanCode.md" target="_blank">Übung: git, Dokumentation, Clean Code</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Maven-Testing.md" target="_blank">Übung: Build Management & Testing</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Container-CI_CD.md" target="_blank">Übung: Container & CI/CD</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/sql-nosql.md" target="_blank">Übung: SQL, NoSQL</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Schnittstellen.md" target="_blank">Übung: Schnittstellen</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung/-/blob/main/website/assignments/Schnittstellen.md" target="_blank">Übung: Parallele Programmierung</a> </li>
</ul>
<h3>Organisatorisches</h3>
<ul>
<li><a href="https://e-learning.hdm-stuttgart.de/moodle/course/view.php?id=3828" target="_blank">Moodle-Kurs</a> </li>
<li><a href="https://konferenz1.hdm-stuttgart.de/b/jor-hzf-odu-rxi" target="_blank">BBB zur Vorlesung</a> </li>
<li><a href="https://konferenz1.hdm-stuttgart.de/b/jor-r4x-ias-ytk" target="_blank">BBB zu den Übungen</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022vorlesung" target="_blank">GitLab: Vorlesungsdemos</a> </li>
<li><a href="https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022projekt" target="_blank">GitLab: Vorlesungsprojekt</a> </li>
</ul>
<h4>Tafelbilder</h4>
<h5>23.05.2022: SQL, NoSQL, Schnittstellen</h5>
<ul>
<li><a href="img/vorlesung/20220523/schnittstellenarten.jpg">Schnittstellenarten</a></li>
<li><a href="img/vorlesung/20220523/rpc.jpg">RPC/RMI</a></li>
<li><a href="img/vorlesung/20220523/miniuml.jpg">Mini-UML: Audiotrack -> Album</a></li>
</ul>
<h5>30.05.2022: Schnittstellen</h5>
<ul>
<li><a href="img/vorlesung/20220530/rest.jpg">REST-Schnittstelle</a></li>
</ul>
<h3>QR-Code zu dieser Seite</h3>
<img src="img/common/qr.png" /><br><br><br>
......
# Vorlesungsnotizen - 28.03.2022
## Anpassungen
* AudioTrack verallgemeinern und austauschbar machen
* MusicManager abstrahieren, damit die Persistenz gekapselt ist
* Aufteilung in Packages
* Factory mit unterschiedlichen Parametern
# Vorlesungsnotizen - 04.04.2022
\ No newline at end of file
# Vorlesungsnotizen - 11.04.2022
## Maven
## Testing
\ No newline at end of file
# Vorlesungsnotizen - 09.05.2022
## Container
## CI/CD
\ No newline at end of file
# Vorlesungsnotizen - 16.05.2022
## CI/CD
## SQL
## (NoSQL)
\ No newline at end of file
# Vorlesungsnotizen - 23.05.2022
## SQL
* Migration bzw. Erweiterung von DB-Schemas bei Bestandsdaten
### Vorgehensvorschlag
1. Entwicklung der Änderungen
2. Dokumentation der Änderungen
3. Deploy auf dem Testsystem
4. Durchführen der (Integrations-)Tests
5. Einrichten eines Wartungsfensters/Downtime
6. Sichern der Datenbank vor der Migration
```bash
# Gilt für MariaDB/MySQL
# Mehr Infos: https://mariadb.com/kb/en/making-backups-with-mysqldump/
mysqldump --user=admin_backup --password --lock-tables --all-databases > /data/backup/dbs.sql
```
7. Ausführen der `ALTER TABLE`-Migrations-Skripte
8. Deploy der neuen Softwareversion
9. Durchführen eines Smoketests
10. Beenden des Wartungsfensters/Downtime
11. Beobachten der Logs
## NoSQL
## Schnittstellen
# Vorlesungsnotizen - 13.06.2022
## Parallele Programmierung
<!DOCTYPE html>
<html>
<head>
<title>Maven, Testing</title>
<meta charset="utf-8">
<link href="css/hdm.css" rel="stylesheet"></link>
<style>
/* yanone-kaffeesatz-regular - latin */
@font-face {
font-family: 'Yanone Kaffeesatz';
font-style: normal;
font-weight: 400;
src: url('fonts/yanone-kaffeesatz-v22-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('fonts/yanone-kaffeesatz-v22-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/yanone-kaffeesatz-v22-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/yanone-kaffeesatz-v22-latin-regular.woff') format('woff'), /* Modern Browsers */
url('fonts/yanone-kaffeesatz-v22-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/yanone-kaffeesatz-v22-latin-regular.svg#YanoneKaffeesatz') format('svg'); /* Legacy iOS */
}
/* noto-serif-regular - latin */
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: 400;
src: url('fonts/noto-serif-v20-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('fonts/noto-serif-v20-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/noto-serif-v20-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/noto-serif-v20-latin-regular.woff') format('woff'), /* Modern Browsers */
url('fonts/noto-serif-v20-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/noto-serif-v20-latin-regular.svg#NotoSerif') format('svg'); /* Legacy iOS */
}
/* ubuntu-mono-regular - latin */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 400;
src: url('fonts/ubuntu-mono-v14-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('fonts/ubuntu-mono-v14-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/ubuntu-mono-v14-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-regular.woff') format('woff'), /* Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/ubuntu-mono-v14-latin-regular.svg#UbuntuMono') format('svg'); /* Legacy iOS */
}
/* ubuntu-mono-italic - latin */
@font-face {
font-family: 'Ubuntu Mono';
font-style: italic;
font-weight: 400;
src: url('fonts/ubuntu-mono-v14-latin-italic.eot'); /* IE9 Compat Modes */
src: local(''),
url('fonts/ubuntu-mono-v14-latin-italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/ubuntu-mono-v14-latin-italic.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-italic.woff') format('woff'), /* Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/ubuntu-mono-v14-latin-italic.svg#UbuntuMono') format('svg'); /* Legacy iOS */
}
/* ubuntu-mono-700 - latin */
@font-face {
font-family: 'Ubuntu Mono';
font-style: normal;
font-weight: 700;
src: url('fonts/ubuntu-mono-v14-latin-700.eot'); /* IE9 Compat Modes */
src: local(''),
url('fonts/ubuntu-mono-v14-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/ubuntu-mono-v14-latin-700.woff2') format('woff2'), /* Super Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-700.woff') format('woff'), /* Modern Browsers */
url('fonts/ubuntu-mono-v14-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('fonts/ubuntu-mono-v14-latin-700.svg#UbuntuMono') format('svg'); /* Legacy iOS */
}
body { font-family: 'Noto Serif'; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
</style>
</head>
<body>
<textarea id="source">
class: center, middle, first
# Software-Entwicklung 3
## Maven & Testing
---
# Agenda
1. Recap
2. Build Management mit Maven
3. Testing mit JUnit
---
# Recap: Was haben wir letzte Woche besprochen?
* Versionierung mit `git`
* Dokumentation
* Clean Code
> Blick ins [Repository](https://gitlab.mi.hdm-stuttgart.de/jordine/se3sose2022projekt)
---
class: center, middle
# Was muss bis zur Ausführung eine Java-Programms getan werden?
???
* Code schreiben
* Externen Code/Libraries einbinden
* Compilieren - `classpath`!
* Testen
* Verpacken
* Zur Verfügung stellen
---
# Build Management Tools
* Unterstützung bei Projekterstellung
* Standardisierung: Reproduzierbare Builds
* Automatisierung
* Verwaltung von Abhängigkeiten
* Durchführen von Tests
* Bündeln der Software
* Bereitstellung
> Unterstützung des Entwicklungszyklus
---
# Beispiele
* Java: Maven, Gradle
* NodeJS: `npm`, `yarn` (Packagemanager)
* Unix: `make`
* Python: `pip` (Packagemanger), PyBuilder
* ...
---
# Build Management Tool: Maven
* Grundprinzipien: Phasenmodell/Build Lifecycle & Konvention über Konfiguration & DRY
* Template-basierte (Java-)Projekterstellung mit **Archetypes**
* Dependeny Management
* Erweiterbar durch Plugins
* Unterstützung durch IDEs
## Standardverzeichnisstruktur
```bash
. project-root
├── pom.xml # Projektkonfiguration
├── src # Source Code
│ ├── main
│ │ ├── java # Java Code und Packages
│ │ └── resources # Dateien, die zur Laufzeit benötigt werden
│ └── test # Test Code
│ └── java
└── target
```
---
# Maven: Build Lifecycle
Werden bis zur angegebenen Phase durchgeführt.
1. `validate`: Überprüfen, ob alle Informationen vorhanden sind.
2. `compile`: Kompilieren der in `src` vorhandenen Dateien
3. `test`: Durchführen der in `test` vorhandenen Tests
4. `package`: Erstellen von z.B. `jar`-Dateien
5. `verify`: Nutzbar z.B. für statische Codeanalyse
6. `install`: Kopieren der `jar` nach `~/.m2/repository`
7. `deploy`: Veröffentlichen der `jar` in ein öffentliches Repo
Beispielaufruf: `mvn package`
Weitere Informationen: [Maven Build Lifecycle](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
---
# `pom.xml` Beispiel - General
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hdm.jordine</groupId>
<artifactId>musicmanager</artifactId>
<version>0.1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
```
---
# `pom.xml` Beispiel - Dependencies
```xml
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.2</version>
</dependency>
</dependencies>
```
---
# `pom.xml` Beispiel - Plugins
```xml
<build>
<plugins>
<plugin>
<!-- https://stackoverflow.com/a/27168770 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>de.hdm.jordine.musicmanager.app.MusicManagerApp</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
```
---
class: center, middle
# Warum ist Testing wichtig?
---
class: center, middle
# Welche Testarten kennen Sie?
---
# Testarten
* Usabilitytests
* **Softwaretests**
* Hardwaretests
* Securitytests
* ...
---
# Testebenen
* **Unittests**: Test einzelner Funktionen und Methoden
* **Integrationtests**: Test des Zusammenspiels mehrerer Module
* **Funktionstests**: Überprüfen der Geschäftslogik
* **End-to-End-Tests**: Testen echter Benutzungsszenarien (bspw. von UI bis DB)
* **Leistungstests**: Überprüfung der Performance
* **Reggressionstests**: Sicherstellung nach Änderungen, dass Bestandsfunktionen weiterhin funktionieren
* **Smoketests**: Grundlegende Funktionsüberprüfung, z.B. nach Release
_nach: https://www.atlassian.com/de/continuous-delivery/software-testing/types-of-software-testing_
---
# Testprinzip F.I.R.S.T
* **F**ast: Tests sollen schnell durchlaufen, damit diese häufig durchgeführt werden.
* **I**solated: Jeder Test sollte unabhängig sein und sein eigenes Enviroment mitbringen.
* **R**epeatable: Auch nach mehrfachen Durchläufen soll das Ergebnis identisch sein.
* **S**elf-validating: Automatische Überprüfung, ob Test erfolgreich war.
* **T**imely: Test sollte beim Entwickeln der Funktionalität geschrieben werden.
> Blick auf Demo-Projekt
---
# Unittests mit JUnit
* Nutzen der `assert`-Methoden, zum Überprüfen von erwarteten und tatsächlichen Werten
* Nutzen der Test-Annotations, z.B.
* `@Test`
* [`@RepeatedTest`](https://junit.org/junit5/docs/current/user-guide/#writing-tests-repeated-tests)
* [`@ParameterizedTest`](https://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests)
* `@BeforeEach`/`@AfterEach`
* `@BeforeAll`/`@AfterAll`
* [`@DisplayName`](https://junit.org/junit5/docs/current/user-guide/#writing-tests-display-names)
* Integration in CI/CD-Prozesse
Dokumentation: https://junit.org/junit5/docs/current/user-guide/
---
# Was sollte getestet werden?
* "Happy path" - der einfachste Fall
* Randbedingungen
* Fehlerfälle
---
# Testing: Begrifflichkeiten
## Mock
* Objekt, dass ein bestimmtes Verhalten simuliert
* Erlaubt schnelleres Testen -> **F**.I.R.S.T
* Framework-Beispiel: [Mockito](https://site.mockito.org)
## Code coverage
* Gibt an, wieviel Prozent des Codes durch Tests abgedeckt sind
* Je höher der Wert, umso besser
---
# Testdriven Development (TDD)
* Entwicklungsmethode
* Tests werden vor dem eigentlichen Code entwickelt
* Mögliches Vorgehen (_nach: [it-agile.de](https://www.it-agile.de/agiles-wissen/agile-entwicklung/was-ist-testgetriebene-entwicklung/)):
* **Test "rot"**: Test erstellen, der auf einfachste Art und Weise die gewünschte Funktionalität erfüllt. Da kein Code besteht, der die Funktion abdeckt, schlagen die Tests fehl.
* Einfachste Umsetzung der Funktionalität bis der **Test "grün"** wird.
* **Refactoring** des Codes. Tests werden weiterhin regelmäßig durchgeführt und müssen grün bleiben.
---
# Projektdemo
</textarea>
<script src="js/remark.min.js">
</script>
<script>
var slideshow = remark.create();
</script>
</body>
</html>
\ No newline at end of file
User-Agent: *
Disallow: /