Skip to content
Snippets Groups Projects
Commit 9c7d357a authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

Merge branch 'lectures2021'

parents 30f6732a 8b62038c
Branches
Tags
No related merge requests found
Pipeline #138258 passed
Showing
with 1701 additions and 442 deletions
# Materiale laget med asciidoctor
Mappa **asciidoctor** inneholder tekstlig materiale, mens **revealjs**-mappa
inneholder lysarkene.
## Hvordan bygge
Bygging av både dokumentasjon og lysark skjer med gradle.
Bruk `gradle asciidoctor` for å generere HTML for det tekstlige og `gradle asciidoctorRevealJs` for lysarkene.
Konvertering kan også gjøres med den generelle `gradle build`.
plugins {
id 'org.asciidoctor.jvm.convert' version '3.0.0-alpha.3'
id 'org.asciidoctor.jvm.revealjs' version '3.0.0-alpha.3'
id 'org.asciidoctor.jvm.convert' version '3.2.0'
id 'org.asciidoctor.jvm.revealjs' version '3.2.0'
}
repositories {
......@@ -14,7 +14,7 @@ repositories {
}
dependencies {
asciidoctorGems 'rubygems:asciidoctor-revealjs:2.0.0'
asciidoctorGems 'rubygems:asciidoctor-revealjs:4.0.1' // asciidoctorGems 'rubygems:asciidoctor-revealjs:2.0.0'
}
asciidoctor {
......
= IT1901
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Course Introduction
:LECTURE_NO: 1st lecture
include::{includedir}header.adoc[]
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
[.smaller-80]
- Velkommen til IT1901 Informatikk prosjektarbeid 1
- Welcome to IT1901 Informatics, Project 1
Høst 2019 / Fall 2019
Høst 2021 / Fall 2021
== Agenda
......@@ -41,6 +43,7 @@ Smidig og moderne praksis og konstruksjon
** mobil
** web
== IT1901 Goals
[.smaller-80]
......@@ -56,15 +59,18 @@ Smidig og moderne praksis og konstruksjon
** documentation
** code quality
== Group work
== Individual and Group work
- there are 3 group deliverables and one individual deliverable
- there will be several individual assignments
- there are 3 group deliverables
- one individual report
- students will work in groups of 4
- fill in the form that will be announced shortly on Blackboard to be assigned to a group
== Deliverables and tasks
- go through the available materials
- work on individual assignments (you need to have all assignments approved to get a grade)
- until you are assigned to a group you must
** set up your development environment
** checkout, build and run the simple example
......@@ -77,13 +83,12 @@ The first task for the group is to select the domain.
[.smaller-80]
[%step]
- week 2 - domain description, first user stories
- week 3 - Deliverable 1 (10% / group) (Desktop JavaFX application)
- week 4 - week 7 - move to REST API backend, modularization, additional feature, ci
- week 8 - Deliverable 2 (10% / group) (modular application, REST based backend)
- week 9 - week 11 - choose between web client or Android client and implement the new architecture for same domain
- week 12 - Deliverable 3 (50% / group) (final technical)
- week 13 - Deliverable 4 (30% / individual) Reflection
- week 35 - 1st individual assignment, git++
- week 36 - 2nd individual assignment, establish groups and start group work
- week 38 - Deliverable 1 (10% / group) (monolitic desktop JavaFX application)
- week 41 - Deliverable 2 (10% / group) (modular application)
- week 47 - Deliverable 3 (50% / group) (final technical)
- week 47 - Deliverable 4 (30% / individual) Reflection report
== Evaluation and feedback
......@@ -98,12 +103,20 @@ The first task for the group is to select the domain.
- point is to learn by implementing these using the required architectures
- we are not looking for quantity but for quality, so just few core features will suffice
== About domain selection (2)
- the chosen app needs to be suitable for a cloud based service
- there must therefore be some dynamic data per user managed by the server.
- eg. a (currency) calculation will NOT fit such a project.
- one good starting point are the cases from the HCI course (MMI)
== Referansegruppe
- Trenger 3-5 medlemmer til referansegruppe i faget
- Mulighet til å påvirke kurset og forbedre kurset for de som skal ta det senere år
- 3 møter; uke 5, uke 9 og etter kursslutt
- Ca. en time per møte - over lunch i kantina
- Ca. en time per møte
- Meld deg i pausen om du er interessert!
- If until next week there are no volunteers we will randomly select 5 students
......@@ -124,49 +137,11 @@ Gruppekontrakt skal godkjennes av studentassistent, signeres av alle gruppemedle
== Group registration form
[.left]
https://bit.ly/2HdMRQi
[.right]
image::../images/lecture01/qrcode-group-registration.svg[width=400]
- The form will be announced shortly on Blackboard.
== !
image::../images/lecture01/teamwork.png[canvas, size=contain]
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 </span>
<span class="element">| Course Introduction </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.jpg" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
include::{includedir}footer.adoc[]
\ No newline at end of file
= Software Development
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Software Development
:LECTURE_NO: 3rd Lecture
include::{includedir}header.adoc[]
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
[.smaller-80][.center-paragraph]
IT1901 Fall 2019 - 2nd Lecture
IT1901 Fall 2020 - 3rd Lecture
[background-color = "#124990"]
[color = "#fff6d5"]
......@@ -23,62 +25,44 @@ IT1901 Fall 2019 - 2nd Lecture
[color = "#fff6d5"]
== Administrative issues
== Feedback
[.left]
Go to: +
app.one2act.no +
Session: +
RIBOO +
[.right]
image::../images/lecture02/qr-app-one2act-no.svg[width=400]
== Example code on gitlab
Have you managed to build and run the example?
- A) Yes
- B) No
== Group registration form
- About half of you filled in the form
- deadline to fill in the form is Wednesday, August 26
== Example code on gitlab (2)
https://s.ntnu.no/it1901groups
What IDE are you using ?
== Individual Assignment 1
- A) Eclipse
- B) IntelliJ
- Requires that you get access to the it1901/studenter-2020 group
** in gitlab (request access)
** gets approved within the day / next day
** only about half of you did that
- the exercise is mandatory to get a grade in the course
== Individual Assignment 1 (cont.)
== Example code on gitlab (3)
- deadline August 27th
- on BB post the link to the repo
- the main deliverable is the repo itself
Are there any issues encountered ?
== Provided materials
- A) no issues
- B) could not clone the project
- C) could not build the project
- D) could not run the project
- E) other issue
== !
image::../images/lecture02/groups-padding.png[canvas, size=contain]
- very few students did watch the materials
- they contain important information for assignments
- relevant materials for 1st assignment
** gitpod episodes
** git course
** introduction to gitlab
== Reference Group
- Tommy Chan
- Vivi Cecilie Galschiødt Svendsen
- Johan Ludvig Holst
- Aksel Kirknes
- Aksel Saugestad
- Lars-Olav Vågene
== Deliverable 1
- Trenger 3-5 medlemmer til referansegruppe i faget
- Mulighet til å påvirke kurset og forbedre kurset for de som skal ta det senere år
- 3 møter / Ca. en time per møte
- Meld deg om du er interessert! (email / chat / group registration form)
- If there are not enough volunteers we will randomly select the rest
- each student group has assigned a group (folder) in gitlab gr19xx
- in the folder there is a repository with name gr19xx which will be used for delivering the code
- deadline September 9th, 2019
- group contract has deadline on September 3rd, 2019
[background-color = "#124990"]
......@@ -109,15 +93,6 @@ Engineering refers to the practice of organizing the design and construction of
[.smaller-60]
Rogers, G.F.C. (1983)
== Exercise
[.smaller-60]
Engineering refers to the practice of organizing the design and construction of any artifice which transforms the physical world around us to meet some recognized need. Rogers, G.F.C. (1983)
- Discuss with a colleague sitting next to you. Look at Rogers’ definition of engineering. How would you relate elements of that definition to your understanding of software development?
[.smaller-40]
Adapted from _An introduction to software development (Open University)_
[background-color = "#124990"]
......@@ -181,20 +156,6 @@ https://www.visual-paradigm.com/scrum/what-is-sprint-in-scrum/
Software quality is the degree to which a software solution meets the design requirements and the user needs and expectations.
== Feedback
[.left]
Go to: +
app.one2act.no +
Session: +
RIBOO +
[.right]
image::../images/lecture02/qr-app-one2act-no.svg[width=400]
== Exercise
- Discuss with the colleague next to you about what properties influence software quality.
- Type 3-5 keywords that you consider to be most important.
== Quality attributes
......@@ -283,13 +244,6 @@ image::../images/git-repo-commands.png[width="500px"]
* `git pull` - henter andres endringer, i tilfelle konflikt
* `git push` - deler endringer med andre via serveren
== Exercise
- Go to your group repository
- https://gitlab.stud.idi.ntnu.no/it1901/gr19xx
- add any members that might not have access
- modify the readme and add your name in a list
== Forgreining (branching)
[.smaller-60]
......@@ -441,39 +395,5 @@ Automatisering av alt som fremmer kvalitet, men som tar tid, f.eks.
image::../images/lecture02/doad.jpg[canvas, size=contain]
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 2nd lecture </span>
<span class="element">| Software Development </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
include::{includedir}footer.adoc[]
\ No newline at end of file
= Software Development
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Software development
:LECTURE_NO: 3rd lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - 3rd Lecture
include::{includedir}dev_content.adoc[]
include::{includedir}footer.adoc[]
\ No newline at end of file
= SCM - Git demo
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Git demo
:LECTURE_NO: 4th lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Git demo
== Installing and setting up git
- Go to https://git-scm.com/downloads
- Download and install the right version for your OS
- git commands are now available
[.grid-left-right-50-50]
== Typical sequence (share project)
[.area-left]
- starting a project and sharing it on Gitlab for team collaboration
** `git init`
** `git status`
[.area-right]
** `git add ...`
** `git commit ...`
** `git remote ...`
** `git push`
== Commit messages
image::../images/git_commit_2x.png[size=75%]
[.smaller-40]
https://xkcd.com/1296/
== Commit messages (seriously)
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
[.grid-left-right-50-50]
== Typical sequence (simple collaboration)
[.area-left]
- working with a shared project
** `git clone`
** `git pull`
[.area-right]
** `git status`
** `git add ...`
** `git commit ...`
** `git push`
== Conflicts (1)
** when same files (lines) are changed by different devs
** automatic merge is not possible
** we need to solve that to be able to push our changes
== Conflicts (2) - Setup
- `git config merge.tool vimdiff`
- `git config merge.conflictstyle diff3`
- `git config mergetool.prompt false`
== Conflicts (3) - Solving
- `git mergetool`
- `:wqa` save and exit from vi
- `git commit -m "message"`
- `git clean` remove file (might remove other untracked files)
== Typical sequence (with branching)
- working with branches
** `git pull`
** `git checkout -b <branch_name>`
** `git status` + `git add ...` + `git commit ...`
** `git checkout master`
** `git merge <branch_name>`
include::{includedir}footer.adoc[]
\ No newline at end of file
= Administrative Issues
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_NO: 5th lecture
:LECTURE_TOPIC: Admin issues
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative Issues
- Reference group
- Groups
- Deadlines
== Reference group
[.smaller-60]
[%header,cols=3*]
|===
|Name
|Email
|Specialization
|Kamomilla Godlund
|kamomilla.godlund@gmail.com
|Datateknologi
|Ruben Kobbeltvedt
|ruben.kobbeltvedt@gmail.com
|Informatikk
|Jan Ming Lam
|janmla@stud.ntnu.no
|Informatikk
|Una Onsrud
|una.onsrud@gmail.com
|Datateknologi
|Idun Syvertsen
|id.syver@outlook.com
|Datateknologi
|===
== Reference group (2)
- Special thanks to the reference group volunteers for their interest in the course.
- Please relay your proposals for improvements and general feedback related to the course to the reference group members.
== Groups
- most groups are formed on BB, some more work needed
- for issues with the groups contact
** Sondre (sondrhel@stud.ntnu.no) or
** Anh-Kha (akvo@stud.ntnu.no)
- will soon start adding members to Gitlab groups
== Groups (2)
- contact your team mates and start working on the group contract
- start working on finding a suitable project
== Gruppekontrakt
- Minimumskrav til avtale:
** Tilstedeværelse
** Tidsbruk
** Forventninger til den enkeltes bidrag
** Hva som skjer ved avvik eller uenigheter
Gruppekontrakt skal godkjennes av studentassistent, signeres av alle gruppemedlemmer - og leveres sammen med første innlevering
== About domain selection
- choose an app / service that you know well and select a couple of features to implement during the semester
- point is to learn by implementing these using the required architectures
- we are not looking for quantity but for quality, so just few core features will suffice
== About domain selection (2)
- the chosen app needs to be suitable for a cloud based service
- there must therefore be some dynamic data per user managed by the server.
- eg. a (currency) calculation will NOT fit such a project.
- one good starting point are the cases from the HCI course (MMI)
== Coming Deadlines
- today (at 18:00) is the deadline for submitting the first assignment
** push you last changes to your repository on Gitlab
** post the link to the repository on BB
- Thursday (at 23:59) is the deadline for the second assignment
include::{includedir}footer.adoc[]
\ No newline at end of file
= Build tools. Introduction to testing
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Build tools. Introduction to testing
:LECTURE_NO: 6th Lecture
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2019 - 3rd Lecture
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Overview
[.smaller-80]
- Feedback from last lecture
- Administrative issues
- Build tools
- Gradle
- Testing
- JUnit
- TestFX
- Mockito
- Jacoco
[background-color = "#124990"]
[color = "#fff6d5"]
== Feedback from last lecture
== !
[.center-paragraph]
image::../images/lecture03/q1.png[width=700]
== !
[.center-paragraph]
image::../images/lecture03/q2.png[width=700]
== !
[.center-paragraph]
image::../images/lecture03/q3.png[width=700]
== Administrative issues
== Individual assignment 1
== Feedback
[.left]
Go to: +
app.one2act.no +
Session: +
KIPAT +
* delivered project must be in the master branch
* project needs to be named "valutakalkulator" and the packages, build files and module information need to be named consistently and reference "valutakalkulator"
* project must build successfully and run - check that before delivering
* .gitpod.dockerfile and .gitpod.yml - are required for gitpod support
[.right]
image::../images/lecture02/qr-app-one2act-no.svg[width=400]
== Individual assignment 1 (cont.)
== Example code on gitlab
* gitpod label in readme.md to point to your project
* project name must be the same with the NTNU username
* project must be created inside https://gitlab.stud.idi.ntnu.no/it1901/students-2020
Have you managed to build and run the example?
== Groups
- A) Yes
- B) No
* groups will be finalized today
* TAs assigned to groups will be announced on Blackboard
* work on the contract
* choose project (domain)
* supervision and meetings use A4-100 (Wednesdays and Fridays)
== Deliverable 1
Have you selected the domain for your project?
== Group Deliverable 1
- A) Yes
- B) No
=== Deliverable 1
programmering av en enkel app, bruk av gradle til bygging, og git og gitlab til kodehåndtering
programmering av en enkel app, bruk av maven til bygging, og git og gitlab til kodehåndtering
Krav til innleveringen:
- Kodingsprosjektet skal ligge i repoet på gitlab
- Prosjektet skal være konfigurert til å bygge med gradle
- Prosjektet skal være konfigurert til å bygge med maven
=== Deliverable 1
== Group Deliverable 1
- En README.md-fil på rotnivå i repoet skal beskrive repo-innholdet, spesielt hvilken mappe inni repoet som utgjør kodingsprosjektet.
- En README.md-fil (evt. en fil som README.md lenker til) inni prosjektet skal beskrive hva appen handler om og er ment å gjøre (når den er mer eller mindre ferdig). Ha med et illustrerende skjermbilde, så det er lettere å forstå. Det må også være minst én brukerhistorie for funksjonaliteten dere starter med.
=== Deliverable 1
== Group Deliverable 1
- Det må ligge inne (i gitlab) utviklingsoppgaver (issues) tilsvarende brukerhistorien, hvor hver utviklingsoppgave må være egnet til å utføres som en egen enhet. De som er påbegynt må være tilordnet det gruppemedlemmet som har ansvaret.
=== Deliverable 1
== Group Deliverable 1
- Vi stiller ikke krav om at dere er kommet så langt, men det må i hvert fall være noe i hvert av de tre arkitekturlagene, domenelogikk, brukergrensesnitt (JavaFX-GUI) og persistens (fillagring, men ikke nødvendigvis JSON), slik at appen kan kjøres og vise frem "noe". For at det skal være overkommelig, er det viktig at domenet er veldig enkelt i første omgang. Det er viktigere at det som er kodet er ordentlig gjort. Koden som er sjekket inn bør være knyttet til tilsvarende utviklingsoppgave.
=== Deliverable 1
- Gradle skal være konfigurert så en kan kjøre app-en vha. gradle-oppgaven run.
- Det må finnes minst én test som kan kjøres med gradle. Bygget skal være rigget til å rapportere testdekningsgrad, som derfor skal være over 0%.
== Group Deliverable 1
- Maven skal være konfigurert så en kan kjøre app-en vha. gradle-oppgaven run.
- Det må finnes minst én test som kan kjøres med maven. Bygget skal være rigget til å rapportere testdekningsgrad, som derfor skal være over 0%.
- Prosjektet skal være konfigurert for gitpod og kan åpnes i gitpod vha. gitpod-merkelappen.
- Bruk simpleexample-prosjektet som inspirasjon, men ikke kopier kode direkte.
== What is the biggest impediment preventing you to move forward with the project?
Write keywords or a short sentence. use "none" if you have no impediments.
[background-color = "#124990"]
[color = "#fff6d5"]
== Build tools
......@@ -212,24 +181,40 @@ image::../images/lecture03/gradle-tree.png[width=700]
[.smaller-40]
https://guides.gradle.org/creating-new-gradle-builds/
[background-color = "#124990"]
[color = "#fff6d5"]
== More on Maven
== Exercise
== Maven (3)
Work with the colleague next to you.
Go to gradle.org and create a "hello world" gradle build using the available documentation.
Time 15'
* manages builds, dependencies, versions
* configuration file is `pom.xml`
* has good IDE support
* central repository(ies) for dependencies
== Exercise feedback
== Maven - pom.xml
Have you succeeded to create the required gradle build?
* modelVersion (4.0.0) config file format version
* groupId - ID of group owning the project
* artifactId - name of the final output
* version - version of the created artifact
- A) Yes
- B) No
== Maven - pom.xml (cont.)
* dependencies - list of artifacts we depend upon
* packaging - e.g. .jar (Java archive)
* description
[background-color = "#124990"]
[color = "#fff6d5"]
== Gradle demo
https://maven.apache.org/pom.html#Quick_Overview
== Maven dependencies
* list of dependencies
* each dependecy has specified
** groupId
** artifactId
** version (optional, good to have)
** scope (default is `compile`)
[background-color = "#124990"]
......@@ -379,39 +364,4 @@ https://www.jacoco.org/
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 3rd lecture </span>
<span class="element">| Build tools. Introduction to testing </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
include::{includedir}footer.adoc[]
\ No newline at end of file
= User stories. Gitlab for agile development
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_NO: 7th lecture
:LECTURE_TOPIC: User stories. Gitlab for agile development
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== User stories. Gitlab for agile development
- Administrative Issues
- User stories
- Gitlab for agile
== Groups
* Groups are finalized
* TAs for groups are announced on BlackBoard
* GitLab groups https://gitlab.stud.idi.ntnu.no/it1901/groups-2020
* gr20xx
* for issues with the groups contact
** Sondre (sondrhel@stud.ntnu.no) or
** Anh-Kha (akvo@stud.ntnu.no)
== Group contract (1)
- Minimum requirements for agreement:
** Presence
** Time spent
** Expectations for the individual contribution
** What happens in the event of deviations or disagreements
== Group contract (2)
* must be approved by the TA for the group
* signed by all group members
* and delivered together with the first group deliverable
== Group contract (3)
- more recommeded items:
** handling differences in motivation level and ambition
** what quality is expected, how defines the group something to be "done"
** distribution of time between meetings / group work / individual work
** what happens if course work needs more time than expected
== Group contract (4)
- more recommeded items:
** delays, sickness, absence - how does the group handle these
** meeting routines both for physical and virtual (agreement for time, agenda, meeting minutes etc)
** general communication tools (email, phone, im etc) and response time
** dealing as a group with deliverables and deadlines
== Group contract (5)
- more recommeded items:
** roles
** giving feedback to the others
** dealing with conflicts and disagreements
** dealing with breach of contract
** procedure to follow if the group is not able to solve conflicts / disagreements internally
== Next Deadline
- 17th of September at midnight
** push you last changes to the group repository on Gitlab
** post the signed group contract on BB
== About domain selection
- choose an app / service that you know well and select a couple of features to implement during the semester
- point is to learn by implementing these using the required architectures
- we are not looking for quantity but for quality, so just few core features will suffice
== About domain selection (2)
- the chosen app needs to be suitable for a cloud based service
- there must therefore be some dynamic data per user managed by the server.
- eg. a (currency) calculation will NOT fit such a project.
- one good starting point are the cases from the HCI course (MMI)
== User stories
- slides from 1st lecture
- video on user stories
== Gitlab for agile
* Issues
* Milestones
* Task lists
* Labels
* Boards
* Quick actions
include::{includedir}footer.adoc[]
\ No newline at end of file
= Workflow Example
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Workflow example
:LECTURE_NO: 8th lecture
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2019 - 8th Lecture
IT1901 Fall 2019 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
......@@ -59,39 +59,4 @@ https://gitlab.stud.idi.ntnu.no/it1901/course-material/issues
link:scm.html[Source code management (SCM)]
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 8th lecture </span>
<span class="element">| Workflow example </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
include::{includedir}footer.adoc[]
= Documentation
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Documentation
:LECTURE_NO: 9th lecture
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2019 - 7th Lecture
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
......@@ -17,6 +18,7 @@ IT1901 Fall 2019 - 7th Lecture
- Documentation
- Markdown
- Gitlab Flavoured Markdown (GFM)
- PlantUML
[background-color = "#124990"]
......@@ -145,39 +147,28 @@ https://gitlab.stud.idi.ntnu.no/help/user/markdown
- it can be versioned same way as the code
- holding documentation in the repository and updating it will allow consulting the repository contents with the correct documentation for that snapshot in time
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 7th lecture </span>
<span class="element">| Documentation </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
== Plant UML
- open source tool for UML diagrams
- it takes a textual description and produces a diagram
- supported within markdown in GitLab
- uses Graphviz to lay out the diagrams
== Adding diagrams to markdown
[source, role="stretch"]
----
```plantuml
class LatLong {
double latitude
double longitude
}
class LatLongs
LatLongs *--> "*" LatLong: "latLongs"
class MetaData
LatLong *--> "1" MetaData: "metaData"
```
----
include::{includedir}footer.adoc[]
\ No newline at end of file
= Unit testing
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Unit testing
:LECTURE_NO: 10th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Testing
== Testing
[%step]
- is an important part of software development
- a way to ensure software quality
- automated testing allows to develop new features with a minimal effort to check if the software still works as expected
- testing frameworks
== Testing (2)
[%step]
- design
- implement
- write automated tests
- run tests
- we do not test just for know, we write tests to keep running them during project life cycle
== Testing (3)
[%step]
- design tests
- implement the test
- provide inputs
- run the tests
- provide expected outputs
- check if the result we get matches what we expect
- produce a manageable output that the developer can consult
== Testing (3)
- design tests
- implement the test
- provide inputs
- *run the tests*
- provide expected outputs
- *check if the result we get matches what we expect*
- *produce a manageable output that the developer can consult*
[background-color = "#124990"]
[color = "#fff6d5"]
== JUnit
== JUnit
- Is a Java unit testing framework.
- provides the means to automate test
- allows to eliminate redundant testing tasks
== JUnit 4
``` java
import org.junit.*;
public class FoobarTest {
@BeforeClass
public static void setUpClass() throws Exception {
// Code executed before the first test method
}
@Before
public void setUp() throws Exception {
// Code executed before each test
}
@Test
public void testOneThing() {
// Code that tests one thing
}
@Test
public void testAnotherThing() {
// Code that tests another thing
}
@Test
public void testSomethingElse() {
// Code that tests something else
}
@After
public void tearDown() throws Exception {
// Code executed after each test
}
@AfterClass
public static void tearDownClass() throws Exception {
// Code executed after the last test method
}
}
```
[.smaller-40]
https://en.wikipedia.org/wiki/JUnit
== JUnit 5
``` java
import org.junit.jupiter.api.*;
public class FoobarTest {
@BeforeAll
public static void setUpClass() throws Exception {
// Code executed before the first test method
}
@BeforeEach
public void setUp() throws Exception {
// Code executed before each test
}
@Test
public void testOneThing() {
// Code that tests one thing
}
@Test
public void testAnotherThing() {
// Code that tests another thing
}
@Test
public void testSomethingElse() {
// Code that tests something else
}
@AfterEach
public void tearDown() throws Exception {
// Code executed after each test
}
@AfterAll
public static void tearDownClass() throws Exception {
// Code executed after the last test method
}
}
```
== JUnit 4 vs JUnit 5
[.smaller-60]
[%header,cols=3*]
|===
|Element
|JUnit 4
|JUnit 5
|package
|org.junit.*
|org.junit.jupiter.api.*
|code before first test
|@BeforeClass
|@BeforeAll
|code before each test
|@Before
|@BeforeEach
|test
|@Test
|@Test
|code after each test
|@After
|@AfterEach
|code after last test
|@AfterClass
|@AfterAll
|===
== JUnit 4 vs JUnit 5 (2)
[.smaller-60]
[%header,cols=3*]
|===
|Element
|JUnit 4
|JUnit 5
|ignoring test
|@Ignore
|@Disabled
|assertions *statically* accessed with
|`Assert.assert`...
|`Assertions.assert`...
|assertion messsage position
|in the beginning of argument list
|in the end of argument list
|===
[background-color = "#124990"]
[color = "#fff6d5"]
== Testing in simpleexample1
[background-color = "#124990"]
[color = "#fff6d5"]
== Testing in todo-list example
include::{includedir}footer.adoc[]
\ No newline at end of file
= Code quality
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Code quality
:LECTURE_NO: 11th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[background-color = "#124990"]
[color = "#fff6d5"]
== Code quality
== Code quality
- automated tests
- coding standards and consistent formatting
- check for higher level types of errors (bug patterns)
== Tools for automatic code checking
- Checkstyle (https://checkstyle.sourceforge.io/index.html)
- Spotbugs (https://spotbugs.readthedocs.io/en/latest/index.html)
- Pmd (https://pmd.github.io)
- Sonarcube (https://www.sonarqube.org/)
- ...
== Checkstyle
- static analysis
- finds errors like
** references to variables with undefined value
** variables that are never used
** syntax and coding standards violations
** dead code blocks
== Checkstyle (2)
- naming conventions
- line length
- whitespace
- Javadoc comments
- annotations
== Checkstyle (3)
- can be configured to use a certain set of checks
- extendable - one can write own checks
- plugins for IDEs
[background-color = "#124990"]
[color = "#fff6d5"]
== Checkstyle examples
== Spotbugs
- checks bytecode and not the source
- looks for "bug patterns"
- example:
```
An apparent infinite loop (IL_INFINITE_LOOP)
This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception).
```
== Spotbugs (2)
- extendable
- plugins for Maven Gradle Ant
- Eclipse IDE integration
[background-color = "#124990"]
[color = "#fff6d5"]
== Spotbugs examples
include::{includedir}footer.adoc[]
\ No newline at end of file
= Modular software
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Modular software
:LECTURE_NO: 12th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
== Overview
- Group deliverable 2
- Architectural styles
- Modular projects with Maven
== Group deliverable 2
- modularisering
** kodingsprosjektet skal deles opp i egnede moduler med avhengigheter mellom (og til andre, relevante moduler)
** bygging styres (fortsatt) av maven og hver modul har hensiktmessig konfigurasjon
[.smaller-80]
== Group deliverable 2 (cont.)
- arkitektur (full tre-lags arkitektur)
** kjernelogikken og ui-et skal skilles fra hverandre (domenelaget + brukergrensesnittlaget )
** persistens med JSON og Jackson evt. alternativt bibliotek (persistenslaget)
*** definere filformat for brukerdata og evt. innstillinger
*** reflektere over og velge mellom dokumentmetafor (desktop) og implisitt lagring (app)
** alle tre lagene spiller sammen
== Group deliverable 2 (cont.)
- kodekvalitet
** tester skal skrives for all modulene
** testdekningsgrad (Jacoco) og (annen) kodekvalitet skal sjekkes av egne tillegg ( for eksempel Checkstyle og Spotbugs som plugins)
** rimelig god testdekning av alle lagene
== Group deliverable 2 (cont.)
- dokumentasjon
** dokumentasjon (readme filer og kommentarer) må oppdateres
** dokumentere arkitektur med minst et diagram (bruk PlantUML) i tillegg til teksten i readme
[.smaller-80]
== Group deliverable 2 (cont.)
- arbeidsvaner
** kodingsoppgaver skal være utgangspunktet for alt arbeid (Issues for alle ting som skal gjøres)
** greiner (branch) samler arbeid for hver kodingsoppgave
** bruk milepæl (milestones) knyttet til innleveringen
** dere jobber i par og bytter på å kode
[.smaller-80]
== Group deliverable 2 (cont.)
- leverer på gitlab
** prosjektet må være gitpod-klart, så vi kan åpne det i gitpod fra en merkelapp i repoet
** maven skal brukes til kjøring av applikasjonen, testene og av kodekvalitet sjekker
** kode for vurdering må leveres i mastergreina av standard repo for gruppen (https://gitlab.stud.idi.ntnu.no/it1901/groups-2020/gr20nn/gr20nn)
- På Blackboard leverer dere en enkel tekst som nevner at repo-et er klart for vurdering.
- Hvis dere leverer etter fristen, informerer du lærerassistenten.
== Architectural styles
An architectural style is a conceptual specification of how a certain
system will be structured and function.
== Architectural styles
- monolithic applications
- 3-tier applications
- REST
== layers vs tiers
- sometimes the terms are used interchangeably
- there is a difference
** layers - logical separation
** tiers - physical separation
[background-color = "#124990"]
[color = "#fff6d5"]
== monolithic applications
== monolithic applications (1)
- All the functionality is packed in a single software unit
** presentation
** logic
** data
- designed without modularity
- also called single-tiered application
== !
image::../images/lecture12/1tier.png[canvas, size=contain]
[background-color = "#124990"]
[color = "#fff6d5"]
== 3-tier applications
== !
image::../images/lecture12/3tier.png[canvas, size=contain]
== 3-tier applications (2)
- application where the various functions are separated
** presentation tier (UI / frontend)
** logic tier (business tier)
** data tier (data storage + data access)
- also called 3-layer
- application is modular
== 3-tier applications (3)
- ability to update / replace just parts of the application
- ability to independently scale the layers
- ability to re-use layers
[background-color = "#124990"]
[color = "#fff6d5"]
== REST
[.smaller-80]
== REST
- Representational state transfer (REST)
- architectural style involving use of Web Services
- set of constraints are applied
** client server
** statelessness (no client context is stored on the server side)
** cacheability (responses state if they can be cached or not)
** uniform interface
** layered system (adding layers like proxy or load balancer)
== REST (cont.)
- Web services that implement REST are called RESTful APIs
- a base URI, example: https://gitlab.stud.idi.ntnu.no/api/v4
- standard HTTP methods (e.g., GET, POST, PUT, PATCH and DELETE);
- data formats for requests and responses (json, xml, etc)
== !
image::../images/lecture12/itodo.png[canvas, size=contain]
== !
image::../images/lecture12/mtodo.png[canvas, size=contain]
== !
image::../images/lecture12/rtodo.png[canvas, size=contain]
[background-color = "#124990"]
[color = "#fff6d5"]
== Modular projects with Maven
== Modular projects with Maven
- use of inheritance
- parent `pom` has configuration that is inherited by modules' `pom`
- the descendent `pom` can override inherited configuration elements
- descendant `pom` inherits most elements with the exception of things like artifactid, name which are used to identify the parent `pom`
== Modular projects with Maven (2)
- reduce complexity and size of individual build files
- reliably use consistent versions for dependencies and plugins
== Parent pom example
```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>it1901.todolist</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
...
</dependency>
...
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
...
</plugin>
...
</plugins>
</pluginManagement>
</build>
<modules>
<module>core</module>
<module>fxui</module>
</modules>
</project>
```
== Descendant pom example
```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>
<parent>
<groupId>it1901.todolist</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>fxui</artifactId>
<dependencies>
<dependency>
...
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
...
</plugin>
...
</plugins>
</build>
</project>
```
include::{includedir}footer.adoc[]
\ No newline at end of file
= Object oriented design principles
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: OOP SOLID + UML
:LECTURE_NO: 12th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[.smaller-30]
Partially based on slides from Torgeir Dingsøyr and Hallvard Trætteberg
== Overview
- OOD - SOLID, DRY
- UML Diagrams
[background-color = "#124990"]
[color = "#fff6d5"]
== Object Oriented Design
== Object Oriented Design
“An object-oriented system is made up of interacting objects that
maintain their own local state and provide operations on that state.
The representation of the state is private and cannot be accessed directly
from outside the object. Object-oriented design processes involve
designing object classes and the relationships between these classes.”
(Sommerville: p 198)
== Object Oriented Principles
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
== Common issues OOD
- External dependencies:
** New requirements can produce changes in many places
- Internal dependencies:
** changes in a part of the code affect other parts
** difficult to re-use code
[background-color = "#124990"]
[color = "#fff6d5"]
== SOLID principles
== SOLID principles
- **S**ingle responsibility principle
- **O**pen–closed principle
- **L**iskov substitution principle
- **I**nterface segregation principle
- **D**ependency inversion principle
[background-color = "#124990"]
[color = "#fff6d5"]
== Single responsibility principle
== Single responsibility principle
- A class should only have a single responsibility
- A class should have one, and only one reason to change
- Examples:
** simpleexample2: JSON-serialization
*** Latlong serializer
*** Latlong deserializer
== Single responsibility principle
Applying this principle has as effects:
- Smaller sized classes
- Classes that are easier to:
** understand
** test
** maintain
[background-color = "#124990"]
[color = "#fff6d5"]
== Open–closed principle
== Open–closed principle
- Software entities should be open for extension, but closed for modification.
- Example: JavaFX classes
[background-color = "#124990"]
[color = "#fff6d5"]
== Liskov substitution principle
== Liskov substitution principle
- Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
[background-color = "#124990"]
[color = "#fff6d5"]
== Interface segregation principle
== Interface segregation principle
- Many client-specific interfaces are better than one general-purpose interface.
[background-color = "#124990"]
[color = "#fff6d5"]
== Dependency inversion principle
== Dependency inversion principle
- One should depend upon abstractions, not concretions.
- e.g. Data access layer in between controler and domain layer
[background-color = "#124990"]
[color = "#fff6d5"]
== DRY Principle
== Don't Repeat Yourself (DRY)
"Every piece of knowledge or logic must have a single, unambiguous representation within a system."
[.smalled-40]
https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[background-color = "#124990"]
[color = "#fff6d5"]
== KISS Principle
== Keep It Simple, Stupid (KISS)
- write simple code
- if classes / methods become lengthy and complicated you need to consider refactoring
** extracting code in separate classes methods
** eliminate redundant code
[background-color = "#124990"]
[color = "#fff6d5"]
== UML
[.smaller-80]
== UML - Unified Modelling Language
- 13 diagrams that show various perspectives on the system
- purpose:
** Stimulate and focus discussion about an existing or a new system
** Document an existing system
** Detailed description to generate a system
- informal use of UML:
** “I do not find UML to be useful during the design process itself and prefer informal notations that are quicker to write and that can be easily drawn on a whiteboard.” (Sommerville, s. 175)
== !
image::../images/lecture13/uml-diagrams.png[canvas, size=contain]
[.smaller-20]
[.left-30]
Fowler, Martin., (2003). UML distilled: a brief guide to the standard object modeling language. Pearson Education
[background-color = "#124990"]
[color = "#fff6d5"]
== Package diagram
[.smaller-80]
== Package diagram
- Gir en oversikt over avhengigheter mellom moduler av et system
- Viser “pakker” - typisk grupper av klasser
- Viser avhengigheter mellom pakker/moduler
- Hver klasse er kun medlem av en “pakke”
- Pakker representerer et hierarkisk navnerom, så hver klasse innen en pakke må ha et unikt navn
- En pakke skal ikke kunne være medlem av flere moduler
[.smaller-30]
Fowler, Martin., (2003). UML distilled: a brief guide to the standard object modeling language. Pearson Education.
== !
image::../images/lecture13/package-diagram.png[canvas, size=contain]
[background-color = "#124990"]
[color = "#fff6d5"]
== Class diagram
== Class diagram
- Viser typer objekter i systemet og statiske relasjoner mellom dem
- Enkleste form: Klassenavn i bokser
- Viser egenskaper (attributter, assosiasjoner) og operasjoner (metoder) for en klasse
[.smaller-30]
Sommerville: Software Engineering, Pearson, 2016. 10th Edition, page 149.
== !
image::../images/lecture13/class-diagram-1.png[canvas, size=contain]
[.smaller-30]
[.left-30]
Kilde: Yngve Lindsjørn, Universitetet i Oslo: IN2000: Kravhåndtering, modellering & design.
== !
image::../images/lecture13/class-diagram-2.png[canvas, size=contain]
[.smaller-30]
[.left-30]
Kilde: Yngve Lindsjørn, Universitetet i Oslo: IN2000: Kravhåndtering, modellering & design.
[background-color = "#124990"]
[color = "#fff6d5"]
== Sequence diagram
[.smaller-80]
== Sequence diagram
- Brukes for å analysere samarbeid mellom objekter
- Modellerer interaksjoner mellom aktører og objekter i et system og interaksjon mellom objekter i et scenarie
- Aktører og objekter finnes øverst i diagrammet
- Tidsakse nedover i diagram
- Piler indikerer interaksjon mellom objekter
- Annoterte piler indikerer metodekall
- Kan vise alternative sekvenser
[.smaller-30]
Sommerville: Software Engineering, Pearson, 2016. 10th Edition, page 146.
== !
image::../images/lecture13/sequence.png[canvas, size=contain]
== !
```puml
actor User
User -> "~#newTodoItemButton: Button" as newTodoItemButton: click
newTodoItemButton -> TodoController: handleNewTodoItemAction
TodoController -> "~#newTodoItemText: TextField" as newTodoItemText: getText
TodoController -> TodoList: addTodoItem
TodoList -> TodoList: fireTodoListChanged
TodoList -> TodoListListener: todoListChanged
TodoListListener -> TodoController: autoSaveTodoList
TodoListListener -> TodoController: updateTodoListView
```
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
= Git and GitLab
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Git and GitLab
:LECTURE_NO: 14th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[.smaller-80]
== Overview
- Git
** basic workflow recap
** working with branches
** code review
- GitLab
** Issues
** Milestones
** Merge requests
** Issues / MR Templates
== Basic workflow
- work on main branch (master)
- could be usable for individual / very small teams
- prone to conflicts
[.grid-left-right-50-50]
== Typical sequence (basic)
[.area-left]
- working with a shared project
** `git clone`
** `git pull`
[.area-right]
** `git status`
** `git add ...`
** `git commit ...`
** `git push`
== Conflicts (1)
** when same files (lines) are changed by different devs
** automatic merge is not possible
** we need to solve that to be able to push our changes
== Conflicts (2) - Setup
- `git config merge.tool vimdiff`
- `git config merge.conflictstyle diff3`
- `git config mergetool.prompt false`
== Conflicts (3) - Solving
- `git mergetool`
- `:wqa` save and exit from vi
- `git commit -m "message"`
- `git clean` remove file (might remove other untracked files)
== Conflicts (4)
- one can plan ahead what issues should be worked on in parralel to minimize the chance of conflicts
- when working on a feature branch, keeping up to date with relevant branches (master or other branch we depend upon) can reduce the risk of getting conflicts
== Improved workflow
- keep master only for finished work
- uses branches for development work
- when a feature branch is done it is merged into master
[.grid-left-right-50-50]
== Typical sequence (branches)
[.area-left]
** `git clone`
** `git pull`
** `git checkout -b <branch_name>`
[.area-right]
** `git status` + `git add ...` + `git commit ...`
** `git checkout master`
** `git merge <branch_name>`
** `git push`
== Improved workflow (code review)
- keep master only for finished work
- uses branches for development work
- when a feature branch is done a merge request is created
- code review takes place and more commits happen to address the comments
- the branch is finally merged into master
== Gitlab specific push options
- push options
```bash
-o merge_request.create
-o merge_request.target=my-target-branch
-o merge_request.label="Label with spaces"
```
== Advanced workflow (git flow)
- https://nvie.com/posts/a-successful-git-branching-model/
- uses 2 long lived main branches - `master` and `develop`
- shorter lived branches for `features`, `releases` and `hotfixes`
== Gitlab for agile
* Issues
* Milestones
* Task lists
* Labels
* Boards
* Quick actions
== Using templates
* Issue templates
* Merge request templates
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
= REST APIs
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: REST APIs
:LECTURE_NO: 17th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[.smaller-80]
== Overview
- REST APIs
** HTTP requests
** Methods
** APIs
** REST Recap
== HTTP requests
- **H**yper**t**ext **T**ransfer **P**rotocol (HTTP)
- clients (e.g. browser) send requests
- servers (web site / service) send responses
== HTTP Request message
- a request line `GET / HTTP/1.1`
- request headers - `User-Agent`, `Accept`, `Content-Type` etc.
- an empty line (containing only a `carriage return` and a `line feed`)
- an optional message body
== HTTP Methods
- HTTP specification defines `methods` to indicate what action is expected from the server
** GET, HEAD, OPTIONS
** POST, PUT, PATCH
** DELETE
== APIs
- **A**pplication **P**rogramming **I**nterface
- "Glue" that makes possible different pieces of software to interoperate
- It is meant to be machine readable / usable
- APIs are everywhere - at different levels - software libraries, operating system, applications, web services etc.
== APIs (2)
- typically a set of calls or requests, expected call format, expected response format, data structures
- separate the implementation from the interface
- allow programs in one language to use functionality written in some other language
- cater to modular software
[background-color = "#124990"]
[color = "#fff6d5"]
== REST
[.smaller-80]
== REST
- **RE**presentational **S**tate **T**ransfer (REST)
- architectural style involving use of Web Services
- set of constraints are applied
** client server
** statelessness (no client context is stored on the server side)
** cacheability (responses state if they can be cached or not)
** uniform interface
** layered system (adding layers like proxy or load balancer)
== REST (cont.)
- Web services that implement REST are called RESTful APIs
- a base URI, example: https://gitlab.stud.idi.ntnu.no/api/v4
- set of exposed web resources
- standard HTTP methods (e.g., GET, POST, PUT, PATCH and DELETE);
- data formats for requests and responses (json, xml, etc)
== !
image::../images/lecture12/rtodo.png[canvas, size=contain]
== Security considerations
- CORS (Cross-Origin Resource Sharing)
** headers `Access-Control-Allow-Origin`
- Authentication (Basic Auth, OAuth etc)
- HTTPS (HTTP over TLS)
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
= Common issues
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Common issues
:LECTURE_NO: 19th Lecture
include::{includedir}header.adoc[]
[.smaller-80][.center-paragraph]
IT1901 Fall 2020 - {LECTURE_NO}
[.smaller-80]
== Overview
- Planer vs. implementasjon
- Uheldig programmeringspraksis
- Testing
- Sjekk av kodekvalitet
- Utviklingsoppgaver
- Merge requests
- Diverse
== Planer vs. implementasjon
- Litt vel stor forskjell mellom ambisjoner som beskrevet i planer,
skjermbildeskisser og faktisk innlevering.
- Det er lurt å tenke at innlevering 2 og 3 er noe brukere kunne prøvd ut.
- Mange strekker seg litt langt, på bekostning av kvalitet.
== Uheldig programmeringspraksis
- En del kjernekode er rene data-klasser uten noen særlig logikk, heller ikke validering.
- Innkapsling brytes ved at interne lister returneres direkte
- Variabler og felt types til implementasjonsklasser heller enn grensesnitt (ArrayList<> vs. List<>)
[.notes]
--
* Innkapsling brytes ved at interne lister returneres direkte. Når slike lister returneres, er det et heller ikke mye vits i å implementere Iterable, fordi den har til hensikt å støtte iterasjon uten tilgang til underliggende liste.
--
[.smaller-80]
== Testing
- Testing er ment å øke tilliten til koden
- Ikke test kode som er like triviell som testen; det er viktigere å teste metoder med logikk
- Det er ikke vits i å teste toString(), når den kun er ment å bli brukt til debugging
- En del bruker try/catch og fail() galt når det ikke trengs
[.notes]
--
* En del tester av triviell kode, som gettere og settere som kunne vært generert, er helt unødvendige. Det er viktigere å teste metoder med logikk , f.eks. filtrering, oppdatering av data osv.
* Det er ikke vits i a test toString() når det ikke regnes som api for andre klasser.
* En del bruker try/catch og fail() galt, det er f.eks. ikke vits i å ha try { ... } catch (Exception e) { fail(); }, for testformål er det bedre å bare la koden kræsje.
--
[.smaller-80]
== Sjekk av kodekvalitet
- Mange tar ikke hensyn til checkstyle-anmerkninger, og en del har ikke engang koblet det inn.
- Noen prøver å lure spotbugs...
```java
// We need to implement this to make spotbugs shut up.
// Technically, we are supposed to make equals and compareTo
// agree, but we specifically want events to be sorted
// chronologically. The right way is probably to implement
// a comparator instead of overriding compareTo, and sorting
// with that.
@Override
@Deprecated
public boolean equals(Object o) {
// We can check quilcky by comparing pointers
if (this == o) {
return true;
}
return false;
}
```
== Utviklingsoppgaver
- Mange utviklingsoppgaver mangler detaljer og/eller diskusjoner
- Noen knytter ikke oppgaver til "assignee" og/eller milepæler
- Verktøyene er ment å hjelpe på samarbeidet og brukes ikke bare for syns skyld
== Merge forespørsler
- noen grupper bruker merge forespørsler jevnlig, og det er bra!
- men det er få kommentarer eller diskusjoner for forbedring av koden...
[.smaller-80]
== Diverse
- For mange er opptatt av registrering/innlogging
- Oppdeling i flere kontrollere kan være vanskelig å gjøre ryddig
- Ikke bruk toString() til visning i UI-et
- Mange legger til filer i repoet som burde vært ignorert (i .gitignore)
[.notes]
--
* For mange er opptatt av registrering/innlogging, men det kan ikke sies å være viktig å få feedback på fra brukere, selv om det selvagt vil være nødvendig.
* Oppdeling i flere kontrollere er ofte riktig, men kan være vanskelig å gjøre ryddig, f.eks. navigering mellom ulike Scene.
* Ikke bruk toString() til visning i UI-et, selv om det er en billig måte å f.eks. vise elementer i lister.
* Many add to the repository files that should be ignored (settings from IDE, files generated by OS, build folders etc) - use .gitignore
--
[background-color = "#124990"]
[color = "#fff6d5"]
== Summary
include::{includedir}footer.adoc[]
\ No newline at end of file
= Smidig praksis og verktøy
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Agile tools
:LECTURE_NO:
include::{includedir}header.adoc[]
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
== Smidig praksis og verktøy
......@@ -131,39 +133,4 @@ link:scm.html[Source code management (SCM)]
link:ci.html[Continuous Integration (CI)]
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 2nd lecture </span>
<span class="element">| Agile tools </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
include::{includedir}footer.adoc[]
\ No newline at end of file
= Kontinuerlig integrasjon
:customcss: slides.css
:icons: font
:includedir: revealjs/includes/
:LECTURE_TOPIC: Continuous Integration
:LECTURE_NO:
++++
<img id="main-logo" class="main-logo" src="images/template/main_logo_eng_no_text.png" width="300" alt="ntnu logo"/>
++++
include::{includedir}header.adoc[]
== Kontinuerlig integrasjon (CI)
......@@ -214,39 +215,4 @@ image::../images/gradle-views.png[width=300]
* så utføres byggeinstruksjoner iht. innstillinger
++++
<div id="footer" class="footer">
<div style="display:table-row;">
<span class="element" style="width:150px;">
<a href="https://www.ntnu.no" target="_blank">
<img id="footer-logo" class="footer-logo"
src="images/template/logo_ntnu.png"
alt="ntnu logo" height="28"/>
</a>
</span>
<span class="element" style="width:300px;">| IT1901 - 2nd lecture </span>
<span class="element">| Continuous Integration </span>
<span class="element">&nbsp;&nbsp;&nbsp;&nbsp;</span>
</div>
</div>
<div id="vertical-ntnu-name" class="vertical-ntnu-name">
<span class="helper"></span>
<img src="images/template/vertical-ntnu-name.png" alt="Norwegian University of Science and Technology" />
</div>
<script type="text/javascript">
window.addEventListener("load", function() {
revealDiv = document.querySelector("body div.reveal")
footer = document.getElementById("footer");
revealDiv.appendChild(footer);
titleSlideDiv = document.querySelector("div.slides section.title")
mainLogo = document.getElementById("main-logo");
titleSlideDiv.prepend(mainLogo);
vertName = document.getElementById("vertical-ntnu-name");
revealDiv.appendChild(vertName);
} );
</script>
++++
\ No newline at end of file
include::{includedir}footer.adoc[]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment