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
Select Git revision
  • 8-add-pdf-export
  • 9-meta-informasjon-knyttet-til-latlong-objekter
  • antipatterns
  • feature/update-gitignore
  • issue-10-display-latlong-metadata-in-the-fx-ui
  • issue-11-allow-user-to-enter-and-update-metadata-about-the-latlong-points
  • issue-6-rest-api
  • issue-9-LatLong-meta-data
  • lectures2020
  • lectures2021
  • master
  • maven-setup
  • 2019_materials
  • lectures-2021
  • lectures-2024
15 results

Target

Select target project
No results found
Select Git revision
  • 8-add-pdf-export
  • feature/update-gitignore
  • issue-10-display-latlong-metadata-in-the-fx-ui
  • issue-11-allow-user-to-enter-and-update-metadata-about-the-latlong-points
  • issue-6-rest-api
  • issue-9-LatLong-meta-data
  • master
7 results
Show changes
260 files
+ 12677
9759
Compare changes
  • Side-by-side
  • Inline

Files

+3 −0
Original line number Diff line number Diff line
@@ -245,6 +245,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

### Maven ###
target/

### Gradle ###
.gradle
build/
+10 −12
Original line number Diff line number Diff line
image: gradle:jdk12

before_script:
  - export GRADLE_USER_HOME=`pwd`/.gradle

cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches
image: maven:3.9.9-eclipse-temurin-17

build:
  stage: build
  script:
    - ./gradlew -Pci=gitlab build
    - mvn "-Dci=gitlab" process-resources

pages:
  script:
    - mvn "-Dci=gitlab" process-resources
    - cp -r target/docs/* public
#  only:
#    - master
  artifacts:
    paths:
    - lectures/build/docs
    expire_in: 1 week
      - public

.gitpod.Dockerfile

0 → 100644
+10 −0
Original line number Diff line number Diff line
FROM gitpod/workspace-full-vnc
                    
USER gitpod

# Install custom tools, runtime, etc. using apt-get
# For example, the command below would install "bastet" - a command line tetris clone:
#
# RUN sudo apt-get -q update && #     sudo apt-get install -yq bastet && #     sudo rm -rf /var/lib/apt/lists/*
#
# More information: https://www.gitpod.io/docs/config-docker/

.gitpod.yml

0 → 100644
+6 −0
Original line number Diff line number Diff line
tasks:
  - init: echo "Replace me with a build script for the project."
    command: echo "Replace me with something that should run on every start, or just
      remove me entirely."
image:
  file: .gitpod.Dockerfile

.vscode/tasks.json

0 → 100644
+31 −0
Original line number Diff line number Diff line
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "gradle run",
            "type": "shell",
            "command": "gradle",
            "args": ["run"]
        },
        {
            "label": "gradle version",
            "type": "shell",
            "command": "gradle",
            "args": ["--version"]
        },
        {
            "label": "java -version",
            "type": "shell",
            "command": "java",
            "args": ["-version"]
        },
        {
            "label": "sdk use java 12.0.2-open",
            "type": "shell",
            "command": "sdk",
            "args": ["use", "java", "12.0.2-open"]
        }
    ]
}
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.idi.ntnu.no/#https://gitlab.stud.idi.ntnu.no/it1901/course-material) 

# course-material

Course material for IT1901
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
target/
.classpath
.project

antipatterns/pom.xml

0 → 100644
+47 −0
Original line number Diff line number Diff line
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  	<modelVersion>4.0.0</modelVersion>
  	<groupId>it1901</groupId>
  	<artifactId>antipatterns</artifactId>
  	<version>0.0.1-SNAPSHOT</version>
  
	<dependencies>

		<!-- Test with JUnit5 -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>5.4.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>5.4.2</version>
			<scope>test</scope>
		</dependency>		
	</dependencies>

	<build>
		<plugins>
			<!-- Compiling code -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<release>13</release>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <!-- 
                <configuration>
                    <argLine>${argLine} dash dash add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED</argLine>
                </configuration>
                 -->
			</plugin>
		</plugins>
  	</build>
</project>
 No newline at end of file
Original line number Diff line number Diff line
package antipatterns;

public class DataClassWithEffectivelyFinalFields {

  private final String name; // should be final
  private final int number; // should be final

  public DataClassWithEffectivelyFinalFields(final String name, final int number) {
    this.name = name;
    this.number = number;
  }

  public String getName() {
    return name;
  }

  public int getNumber() {
    return number;
  }
}
Original line number Diff line number Diff line
package antipatterns;

// ok, but see the test
public class DataClassWithLittleLogic {

  private String name;
  private int number;

  public DataClassWithLittleLogic(final String name, final int number) {
    this.name = name;
    this.number = number;
  }

  @Override
  public String toString() {
    return String.format("[DataClassWithLittleLogic name=%s number=%s]", name, number);
  }

  public DataClassWithLittleLogic() {
  }

  public String getName() {
    return name;
  }
  public void setName(final String name) {
    this.name = name;
  }

  public int getNumber() {
    return number;
  }
  public void setNumber(final int number) {
    this.number = number;
  }
}
Original line number Diff line number Diff line
package antipatterns;

// see DataClassWithValidationTest
public class DataClassWithValidation {

  private String name;

  public DataClassWithValidation(final String name) {
    // should use setName to ensure validation logic is run
    this.name = name;
  }

  public DataClassWithValidation() {
  }

  public String getName() {
    return name;
  }
  public void setName(final String name) {
    if (name.startsWith(" ")) {
      // should rather use trim() or strip() and check the length
      throw new IllegalArgumentException("Name cannot begin with blank");
    }
    this.name = name;
  }
}
Original line number Diff line number Diff line
package antipatterns;

import java.util.Collection;
import java.util.Iterator;

public class NonEncapsulatedList implements Iterable<String> {

  private final Collection<String> names;

  public NonEncapsulatedList(final Collection<String> names) {
    this.names = names;
  }

  public Collection<String> getNames() {
    return names;
  }

  public Iterator<String> iterator() {
    return names.iterator();
  }
}
Original line number Diff line number Diff line
package antipatterns;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class DataClassWithLittleLogicTest {

  private DataClassWithLittleLogic instance1, instance2;

  @BeforeEach
  public void setup() {
    instance1 = new DataClassWithLittleLogic();
    instance2 = new DataClassWithLittleLogic("High", 5);
  }

  @Test
  public void testConstructor() {
    Assertions.assertEquals("High", instance2.getName());
  }

  @Test
  public void testToString() {
    Assertions.assertEquals("[DataClassWithLittleLogic name=High number=5]", instance2.toString());
  }

  @Test
  public void testSetName() {
    instance1.setName("Low");
    Assertions.assertEquals("Low", instance1.getName());
  }
}
Original line number Diff line number Diff line
package antipatterns;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class DataClassWithValidationTest {

  @Test
  public void testSetName() {
    try {
      new DataClassWithValidation(" name starting with blank");
      Assertions.fail("Should throw IllegalArgumentException");
    } catch (final IllegalArgumentException iae) {
    } catch (final Exception iae) {
      Assertions.fail("Should throw IllegalArgumentException");
    }

    try {
      new DataClassWithValidation("ok name");
    } catch (final Exception iae) {
      Assertions.fail();
    }
  }

  @Test
  public void testBetterSetName_invalidName() {
    Assertions.assertThrows(IllegalArgumentException.class, () -> new DataClassWithValidation(" name starting with blank"));
  }

  @Test
  public void testBetterSetName_validName() {
    new DataClassWithValidation("ok name");
  }
}

gradlew

deleted100755 → 0
+0 −172
Original line number Diff line number Diff line
#!/usr/bin/env sh

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
    echo "$*"
}

die () {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Escape application args
save () {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"

gradlew.bat

deleted100644 → 0
+0 −84
Original line number Diff line number Diff line
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Original line number Diff line number Diff line
@@ -2,4 +2,4 @@
.gradle

# Ignore Gradle build output directory
build
build/

lectures/README.md

0 → 100644
+11 −0
Original line number Diff line number Diff line
# 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`.

lectures/asciidoc/README.adoc

deleted100644 → 0
+0 −38
Original line number Diff line number Diff line
== Multi-eksempel

Dette eksemplet viser hvordan rigger et multi-prosjekt med gradle,
med del-prosjekter for

- domenelogikk (core)
- brukergrensesnitt med JavaFX og FXML (fx)
- React-basert web-klient (react)
- web-server med JAX-RS og Jersey (jersey)

=== Bygging med Gradle

https://docs.gradle.org/current/userguide/userguide.html[Gradle] er et såkalt byggesystem, som automatiserer oppgaver knyttet til utvikling og kvalitetssikring av programvare, f.eks.
kompilering, kjørings av enhetstester og integrasjonstester, konvertering av dokumentasjon til HTML, pakking som kjørbart program, osv.
Det finnes teknisk sett ikke grenser for hva et byggesystem kan gjøre, generelt handler det om å automatisere bort alt praktisk fikkel,
som ellers hindrer en å jobbe effektivt.

Det finnes flere byggesystem, de viktigste i Java-verdenen er https://maven.apache.org[Maven] og Gradle, mens Javascript-verdenen har sine, bl.a. https://docs.npmjs.com[npm].
I dette prosjektet har vi valgt å bruke Gradle, fordi det er enklere å skrive og lese oppsettet og trigge kjøring, mer fleksiblet og
det vi ønsker å automatisere i akkurat dette prosjektet er innafor det Gradle håndterer godt. For andre Java-prosjekter https://phauer.com/2018/moving-back-from-gradle-to-maven/[kan Maven være et bedre alternativ].
Siden ett av prosjektet bruker Javascript og npm, så
bruker vi et eget Gradle-tillegg som bygger bro til npm. 

Gradle er bygget rundt tre sentrale elementer:

- oppgaver (tasks) - det som automatiseres, f.eks. kompilering, kjøring av tester, osv.
- prosjekter - enhetene som oppgaver utføres innenfor
- tillegg (plugins) - angir hvilke oppgaver som hører til et visst type prosjekt.

Oppsettet for bygging består bl.a. i å angi hvilke (del)-prosjekter som inngår i hovedprosjektet,
hvilke avhengigheter det er til eksterne moduler og mellom prosjektene, hvilke tillegg som bør aktiveres for disse prosjektene
(basert på hva slags type prosjekt det er) og hvordan hver type oppgave skal konfigureres.

NOTE: Det litt spesielle med Gradle er at filene for å sette opp et Gradle-bygg egentlig er https://docs.gradle.org/current/userguide/groovy_build_script_primer.html[kode skrevet i det Java-lignende språket Groovy].
Koden brukes primært til konfigurasjon, altså bygge opp beskrivelsen av oppgavene,  prosjektene og tilleggene og. API-et er utformet slik at koden skal se deklarativ ut.
En kan flette inn vanlig kode også, hvis en skjønner litt om hvordan API-et virker. Dette gir enorm fleksibilitet, men kan også gjøre filene vanskelige å forstå.

De to viktigste filene for å sette opp et Gradle-bygg er *settings.gradle* og *build.gradle*.
+123 −0
Original line number Diff line number Diff line
= Gitpod

link:slides/gitpod.html[Lysark]

== Problemet som gitpod løser

Rigging av alt som trengs for utvikling tar mye tid. En skal installere _språket_ (*python*, *java*, ...) og en trenger diverse _rammeverk_ (*junit*, *javafx*, ...). Kanskje skal en bruke såkalte _byggeverktøy_ (*maven*, *gradle*, ...) og det må installeres og konfigureres. På toppen av dette kommer selve _IDE-en_ (*VSCode*, *IntelliJ*, *Eclipse*, ...), som må passe til og være konfigurert for det en har installert forøvrig.

En kompliserende faktor er _versjoner_, en må ha versjoner av alt som passer sammen og ofte trenger en ulike versjoner for ulike prosjekter. Selv om det finnes verktøy som *sdkman* som hjelper en å installere og veksle mellom ulike versjoner, så er det en del manuelt arbeid.

For større prosjekter er kanskje ikke dette merarbeidet så problematisk, det må jo ikke gjøres så ofte. Men hvis en veksler mellom flere mindre prosjekter eller bare skal jobbe med små eksempler og øvinger, så kan det bli veldig tungvint.

== Gitpod = VSCode + git + Docker

Gitpod prøver å løse dette problemet ved å tilby en nettleserbasert IDE (*VSCode*), som er ferdigkonfigurert for spesifikke prosjekt. En slipper dermed å installere IDE-en. Konfigurasjonen av både IDE-en og den underliggende _virtuelle maskina_ (*Linux* i *Docker*) ligger i *git*-kodelageret sammen med prosjektfilene forøvrig. Når kodelageret med konfigurasjon og prosjekfiler først er satt opp, så slipper en dermed også å installere språk, rammeverk og verktøy, det er bare å åpne IDE-en med utgangspunkt i kodelageret.

Jobben med oppsett må jo fortsatt gjøres, men en trenger bare å gjøre det én gang. Alle som siden skal jobbe med samme prosjekt, kan bare åpne IDE-en på et kodelager og gå i gang. Dersom det er snakk om et kode-eksempel, en øving eller et standardisert prosjekt, så kan det gjøres på forhånd av fagstaben, så i hvert fall studenten slipper styret med å sette alt opp. Og for nye prosjekt kan en ofte ta utgangspunkt i tidligere prosjekter eller eksempler basert på samme språk og rammeverk.

== Gitpod @ NTNU

Gitpod har integrasjoner med skytjenester som *gitlab* og *github*, så en kan logge inn på og administrere kodelagre der. Gitpod kan også settes opp internt, og NTNU har sin egen gitpod-installasjon tilgjengelig på http://gitpod.stud.ntnu.no, som er integrert med IDI sin *gitlab*-tjeneste på http://gitlab.stud.idi.ntnu.no, så emner som bruker gitlab kan automatisk tilby gitpod som plattform for utvikling.

Alle kodelagre i IT1901 med eksempler og maler er ferdig _gitpodifisert_, se f.eks. https://gitlab.stud.idi.ntnu.no/it1901/javafx-templates[javafx-templates]. Dermed er de lette å bygge videre på, det er bare å trykke på *Gitpod*-knappen. Faktisk kan alle kodelagre på vår gitlab åpnes i gitpod for redigering av filer. Men for å kunne utvikle ordentlig, så må de altså gitpodifiseres vha. konfigurasjonsfilen *.gitpod.yml* og evt. en tilhørende *docker*-fil.

En alternativ måte å åpne gitpod på er å skrive inn nettadressen til gitpod-tjeneren (http://gitpod.stud.ntnu.no) etterfulgt av *#* og så adressen til gitlab-kodelageret som skal åpnes, f.eks. `http://gitpod.stud.ntnu.no#https://gitlab.stud.idi.ntnu.no/it1901/javafx-templates`.

== Gitpod-arkitektur

VSCode i nettleseren fungerer nokså likt VSCode lokalt, den har tilgang til et filsystem med kjørebare programmer, og en del av filsystemet utgjør arbeidsområdet til VSCode. Forskjellen er at filsystemet og programmene er inni en virtuell maskin i skyen, og maskina startes opp kun for å kjøre VSCode i nettleseren. Ved oppstart _klones_ kodelageret inn i maskina, og innholdet utgjør altså arbeidsområdet til VSCode. Konfigurasjonen av maskina og evt. oppstartsinstruksjoner leses ut av *.gitpod.yml* på toppnivå i det samme kodelageret.

image::images/gitpod-arch.png[width=800]

Den virtuelle maskina er _flyktig_, i den forstand at den forsvinner av seg selv hvis en lukker VSCode (eller fanen) eller lar være å bruke den en periode. Arbeidsområdet (og noen andre viktige filer) arkiveres imidlertid, slik at den kan startes opp igjen med i praksis samme innhold. Det blir som om en legger en bærbar i dvale og så vekker den til live igjen. Vanligvis vil en derfor fortsette med et eksisterende arbeidsområde fra hovedsiden til gitpod-tjenesten, i stedet for å starte en ny virtuell maskin med et nytt arbeidsområde fra (gitlab-nettsida for) kodelageret. Det er bare når en endrer oppsettet etter å ha redigert *.gitpod.yml* eller *docker*-fila at en må starte en helt ny maskin. 

Hvis den virtuelle maskina er riktig satt opp (se under om konfigurering med *.gitpod.yml*), så kan en faktisk kjøre grafiske apper (f.eks. skrevet i JavaFX) og få dem vist inni gitpod eller i et separat nettleservindu. Dette krever at en "slår på" en virtuell grafisk skjerm som er en del av den virtuelle maskina. Se etter tallet 6080 i statuslinja nederst og trykk på det. Da spretter det opp et panel og en kan angi at 6080 (som representerer den virtuelle grafiske skjermen) skal vises i *Preview*-panelet eller i et eget nettleser-vindu.

== Gitpod-bruk i emner

Gitpod kan brukes i emner på ulike måter. Emner som i dag distribuerer og deler innhold vha. git-kodelagre, kan gitpodifisere og få ekstra fordeler. Vi har identifisert en del scenarier for bruk av gitpod i emner, som en bør være fortrolig med.

=== Kode-eksempler

Fagstaben rigger et kode-eksempel i et prosjektoppsett som lar en kompilere og kjøre (generelt bygge). Prosjektet kan kreve verktøy og rammeverk som studentene ikke (ennå) har installert på egne maskiner. Studentene åpner kodelageret i gitpod og kan umiddelbart prøve det ut, endre på det og lære av det. Dersom en vil ta vare på eksemplet, må en opprette et eget kodelager og lagre (det endrede) innholdet der vha. *git remote* og *git push*.

=== Få veiledning

Studenten jobber med et prosjekt i et kodelager og trenger veiledning og sender lenke til en læringsassistent, som kan åpne gitpod og jobbe i samme oppsett som studenten. Hvis læringsassistenten har rettigheter til kodelageret (f.eks. fordi det ligger i en gitlab-gruppe satt opp av fagstaben), så kan hen legge tilbake endringer evt. lage et endringsforslag.

En annen mulighet er å ta et såkalt øyeblikksbilde (snapshot) som lagrer innholdet i arbeidsområdet og knytter det til en lenke. Læringsassistenten kan åpne denne lenka i gitpod og får samme innhold i sin gitpod som studenten hadde da øyeblikksbildet ble tatt. Fordelen er at en får delt innhold som det ikke naturlig å dele vha. selve kodelageret, f.eks. byggeresultater.

=== Øvingsopplegg

Fagstaben i et emne lager en gitlab-gruppe for emnet og semesteret, f.eks. *tdt4100/v2022* og inni denne opprettes et gitpodifisert kodelager for hver student som både fagstaben og studenten har tilgang til. Hver uke publiseres nye øvingsoppgaver (tekster, startpakke med kode og evt. tester) som kopieres inn i hvert slikt kodelager, slik at studentene kan jobbe med dem og (implisitt) levere i sitt eget emne-kodelager.

=== Eksamen (!)

Eksamen kan rigges omtrent som et øvingsopplegg, med et personlig kodelager pr. student, med både oppgave og (etterhvert) besvarelse i.

== Gitpod og bruk av git

Som nevnt klones kodelageret inn i den virtuelle maskina, og håndtering av kodelageret blir som ved kjøring på egen maskin, en bruker de vanlige *git*-kommandoene for å synkronisere med gitlab-tjeneren. En er ikke nødt til å lagre unna endringer i arbeidsområdet til tjeneren før den virtuelle maskina legges i dvale, hele arbeidsområdet arkiveres jo, men dersom en jobber med andre eller bruker VSCode i både gitpod og lokalt, så må en jo synkronisere filer via gitlab. Merk også at arkiverte arbeidsområder lagres ikke evig, de kastes etter noen uker uten bruk, så en må bruke git innimellom.

Å komme i gang er i grunnen mest komplisert, fordi utgangspunktet for kodelageret kan være så forskjellig.

=== Jobbe videre med andres kodelager

Hvis en skal jobbe videre med et kodelager som eies av andre, så må en lage en kopi (med eller uten kobling til originalen, med kobling så kalles det gjerne en "gaffel"). En oppretter da et nytt kodelager på gitlab f.eks. på egen bruker eller under en emne-gruppe. Navigér til egen bruker eller gruppa og velge *New project* under *+*-menyen øverst.

image::images/gitlab-new-project.png[width=800]

Lag et tomt/blankt kodelager uten README, fordi hele innholdet skal overføres fra originalen. Hvert kodelager har sin egen adresse som brukes av git. Velg *Clone*-nedtrekksmenyen og kopier *HTTPS*-adressen (se under). Den skal brukes i en git-kommando for oppsett av git inni gitpod.

image::images/gitlab-repo-url.png[width=300]

For å knytte kodelageret inni gitpod til det nye kodelageret på gitlab, skriv inn `git remote set-url origin` etterfulgt av kodelager-adressen fra forrige steg. Dermed vil alle kommandoer som opererer på git-tjeneren (en såkalt _remote_)gå mot det nye kodelageret. Kommandoen `git push -u origin master` brukes først for å overføre alt git-innhold m/historikk til det nye kodelageret sin *master*-grein, og siden kan en bare bruke `git push` for å oppdatere, evt. `git pull` for å hente ned endringer fra tjeneren.

Dersom en vil beholde knytningen til original-kodelageret, så endrer en først navnet
på den opprinnelige kobling til f.eks. upstream med `git remote rename origin upstream`. Så opprettes det en ny kobling til det nye kodelageret med `git remote add origin` etterfulgt av kodelager-adressen fra forrige steg. Da vil vanlig bruk av *git push* og *git pull* gå mot det nye kodelageret, men en kan hente ned endringer fra original-kodelageret med *git fetch upstream* og innlemme dem med *git merge upstream/master* (og være beredt til å håndtere konflikter).

=== Opprette nytt kodelager på gitlab

Dette er i grunnen det enkleste. En bruker samme skjema som over, men velger å lage en README med det samme (om en glemmer det, så kan en lage en README på nettsiden til det nye kodelageret), og etter at kodelageret er opprettet, så åpner man bare gitpod på det nye kodelageret. Merk at selv om en kan åpne gitpod, så er ikke kodelageret automatisk gitpodifisert. Det gjør en ved å opprette *.gitpod.yml* og evt. en *docker*-fil med passende innhold, overføre disse tilbake med *git push*. For at det nye gitpod-oppsettet skal få effekt må en starte gitpod på nytt fra nettsida til kodelageret.

=== Overføre lokalt kodelager til gitlab (og gitpod)

Dersom du sitter med et kodelager lokalt på maskina di (som ikke finnes på gitlab), så kan det åpnes i gitpod ved å først overføre det til et kodelager på gitlab, for så å åpne det i gitpod. Prosessen blir litt som den første varianten over, en oppretter et kodelager på gitlab og angir så at det lokale kodelageret skal knyttes til det nye på gitlab (som en _remote_). Skriv inn `git remote add origin` etterfulgt av kodelager-adressen for det nye kodelageret (tilsvarende varianten over). Dette gjøres selvsagt i terminalen lokalt, evt. inni terminal-panelet i VSCode lokalt.

Til slutt åpnes det nye kodelageret på gitlab i gitpod.

== Gitpod-konfigurasjon med .gitpod.yml og gitpod.Dockerfile (for den dristige)

Den virtuelle maskina konfigures vha. en spesiell fil med navn *.gitpod.yml* og en tilhørende *docker*-fil. Førstnevnte angir bl.a. hvilken *docker*-fil som beskriver alt som skal være ferdig installert i den virtuelle maskina. Det enkleste er å referere til en standard *docker*-fil laget for formålet f.eks. *gitpod/workspace-full-vnc*. Da får en en støtte for en rekke vanlige programmeringsspråk og kan kjøre grafiske apper på en slags virtuell skjerm som vises i gitpod eller et eget nettleser-vindu. Dersom en trenger noe ut over dette, kan en lage sin egen *docker*-fil som angir det som trengs ekstra på toppen av en standard en. Det er litt mye å dekke her, men under vises et enkelt oppsett for å bruke en nyere Java-versjon enn det som er standard i gitpod.

*.gitpod.yml* (styrer oppsettet):

....
image:
  file: .gitpod.Dockerfile

tasks:
  - init: sdk use java 16.0.1.hs-adpt
....

*.gitpod.Dockerfile* (angir innhold i virtuell maskin):

....
FROM gitpod/workspace-full-vnc

USER gitpod

RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh \
             && sdk install java 16.0.1.hs-adpt \
             && sdk default java 16.0.1.hs-adpt"
....

Det viktige her er at

- *.gitpod.yml* refererer til *.gitpod.Dockerfile*
- *.gitpod.Dockerfile* bygger på (ved å referere til) *gitpod/workspace-full-vnc*
- *.gitpod.Dockerfile* kjører en ekstra kommando(linje) som installerer java-distribusjonen *16.0.1.hs-adpt* vha. *sdk*-programmet
- *.gitpod.yml* kjører en kommando for å ta i bruk *16.0.1.hs-adpt* i gitpod-terminal

En kan installere nær sagt hva som helst ved å skrive de riktige installasjonskommandoene inn i *.gitpod.Dockerfile* og ytterligere instruksjoner i *.gitpod.yml*. Det er litt fikkel, men en kommer langt ved å søke etter relevant *docker*-filer på https://hub.docker.com/search?q=&type=image[Dockerhub] og kopiere innhold derfra.
+125 −0
Original line number Diff line number Diff line
:sourcedir: .
:toclevels: 3

= Forelesninger

== 2021

=== Introduksjon til emnet

link:slides/01-course-intro.html[Lysarkene] gir en oversikt over organiseringen av emnet

link:slides/02-git-plus-plus.html[Lysarkene] gir en oversikt over git, gitlab og gitpod

include::{sourcedir}/gitpod.adoc[leveloffset=+2]

include::{sourcedir}/ci.adoc[leveloffset=+2]

=== 4. Forelesning

link:slides/04-lecture.html[Lysarkene] gir en oversikt over SCRUM og Gitlab elementer som kan brukes i prosjektet.

=== 5. Forelesning

link:slides/05-lecture.html[Lysarkene] Q&A.

=== 6. Forelesning

link:slides/06-lecture.html[Lysarkene] Pair programming + more on Git.

=== 7. Forelesning

==== Oppsummering av øving 1

link:slides/individuell-oblig.html[Lysarkene] oppsummerer den individuelle, obligatoriske øving 1

==== Kodestank

link:slides/kodestank.html[Lysark] om såkalt "kodestank" (code smell)


== 8. Forelesning

link:slides/08-lecture.html[Lysarkene] Unit testing.

== 9. Forelesning

link:slides/09-lecture.html[Lysarkene] Documentation.

== 10. Forelesning

link:slides/12-modular.html[Lysarkene] 2nd Group assignment + Modularization.
link:slides/10-lecture-code-quality.html[Lysarkene] Code quality.




== 2020

=== Programvareutvikling

link:slides/02-software-development.html[Lysarkene]

=== Utvikling og kildekodehåndtering

link:slides/03-dev-and-scm.html[Lysarkene]

=== Git-demonstrasjon

link:slides/04-git-demo.html[Lysarkene]

=== Byggeverktøy og (litt om) testing

link:slides/06-build-tools-and-some-testing.html[Lysarkene]

=== Gitlab

link:slides/07-gitlab.html[Lysarkene]

=== Eksempel på arbeidsfly

link:slides/08-workflow-example.html[Lysarkene]

=== Dokumentasjon

link:slides/09-documentation.html[Lysarkene]

=== Enhetstesting

link:slides/10-unit-testing.html[Lysarkene]

=== Kodekvalitet

link:slides/11-code-quality.html[Lysarkene]

=== Moduler og modularitet

link:slides/12-modular.html[Lysarkene]

=== Designprinsipper og UML

link:slides/13-solid-uml.html[Lysarkene]

=== Git og gitlab

link:slides/14-git-gitlab.html[Lysarkene]

=== REST API

link:slides/17-rest-api.html[Lysarkene]

=== Generelle/felles problemer

link:slides/19-common-issues.html[Lysarkene]

=== Smidige verktøy

link:slides/agiletools.html[Lysarkene]

=== Kontinuerlig integrasjon

link:slides/ci.html[Lysarkene]

=== Kildekodehåndtering

link:slides/scm.html[Lysarkene]

lectures/build.gradle

deleted100644 → 0
+0 −115
Original line number Diff line number Diff line
plugins {
    id 'org.asciidoctor.jvm.convert' version '3.0.0-alpha.3'
    id 'org.asciidoctor.jvm.revealjs' version '3.0.0-alpha.3'
}

repositories {
    jcenter()
    maven {
        url "https://plugins.gradle.org/m2/"
    }
    maven {
    	url 'http://rubygems-proxy.torquebox.org/releases'
    }
}

dependencies {
    asciidoctorGems 'rubygems:asciidoctor-revealjs:2.0.0' 
}

asciidoctor {
	sourceDir 'asciidoc'
    sources {
        include '*.adoc'
    }
    outputDir file('build/docs/asciidoc')
	resources {
		from('asciidoc') {
	    	include '**/*.png'
	 	}
		into '.'
	}
    logDocuments = true
}

asciidoctorj {
	modules {
       // diagram.use() 
       diagram.version '1.5.16' 
    }
    // useIntermediateWorkDir = true
    attributes toc: 'left',
    	'source-highlighter': 'highlightjs'

    /*	
	extensions {
        block_macro (name: 'tweet') { parent, target, attributes ->
            String content = """<div class="tweet" data-src="https://twitter.com/${target}/status/${attributes.get('1')}"></div>"""
            config.remove 'content_model'
            createBlock(parent, "pass", [content], [:], config)
        }
    }
    */	
}

asciidoctorRevealJs {

    sourceDir 'revealjs'
    sources {
        include '*.adoc'
    }
    outputDir file('build/docs/revealjs')
	resources {
		from('revealjs') {
	    	include 'images/**'
	    	include '**/*.css'
	 	}
		into '.'
	}

    attributes 'sourceDir': 'revealjs',
    	'imagesDir': 'revealjs',
        'icons':'font',
        'iconfont-name': 'fontawesome-4.5.0'

    revealjsOptions {
        controls = true
        slideNumber = true
        progressBar = true
        pushToHistory = true
        overviewMode = true
        touchMode = true
        backgroundTransition = 'convex' //none , fade, slide, convex, concave, zoom
        theme = 'white' //'black', 'beige' , 'league', 'night', 'serif', 'simple', 'sky', 'solarized'
    }

	plugins 'rajgoel/chart/Chart.min.js'
	//plugins 'IainAndrew/footer-reveal/footer-reveal.min.js'
	
	
}

revealjs {
	version '2.0.0' //  why not '3.8.0' 
	templateGitHub {
   		organisation = 'hakimel'
    	repository = 'reveal.js'
    	tag = '3.8.0'
  	}
}

revealjsPlugins {
    github 'rajgoel', {
        organisation = 'rajgoel'
        repository = 'reveal.js-plugins'
        branch = 'master'
    }
    
    /*github 'IainAndrew', {
        organisation = 'IainAndrew'
        repository = 'footer-reveal'
        branch = 'master'
    }*/
}

build.dependsOn 'asciidoctorRevealJs'
Original line number Diff line number Diff line
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

lectures/gradlew

deleted100755 → 0
+0 −188
Original line number Diff line number Diff line
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
    echo "$*"
}

die () {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Escape application args
save () {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"

lectures/gradlew.bat

deleted100644 → 0
+0 −100
Original line number Diff line number Diff line
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem      http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Original line number Diff line number Diff line
= IT1901 
:customcss: slides.css
:icons: font
:includedir: 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 2024 / Fall 2024

== Agenda

@@ -41,6 +43,7 @@ Smidig og moderne praksis og konstruksjon
** mobil
** web


== IT1901 Goals

[.smaller-80]
@@ -56,34 +59,53 @@ Smidig og moderne praksis og konstruksjon
** documentation
** code quality

== Group work
== Tools used in IT1901

In the course we will use several tools:
[.smaller-80]
[%step]
** Git for source code management
** GitLab for collaboration: repository sharing, issue tracking, issue boards, code review ...
** Eclipse Che  - automatically spin a workspace that is accessible via a browser to work, collaborate, evaluate ...
** VSCode - recommended IDE to use as it is the same as the gitpod environment
** sdkman - recommended tool to manage JDK and Maven

== Individual and Group work

- there are 3 group deliverables and one individual deliverable
- there is one individual development assignment (mandatory to pass to get a grade) 
- 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
- fill in the form announced on Blackboard to be assigned to a group


== Deliverables and tasks

- go through the available materials 
- work on individual assignments 
- until you are assigned to a group you must 
** set up your development environment 
** checkout, build and run the simple example
** checkout, build and run the todo list example

https://gitlab.stud.idi.ntnu.no/it1901/course-material/tree/master/simpleexample
https://gitlab.stud.idi.ntnu.no/it1901/todo-list

The first task for the group is to select the domain.

== Timeline

[.smaller-80]
[.smaller-60]
[%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 34 - start on individual assignment, intro
- week 35 - establish groups and start group work, git++
- week 36 - deliver individual assignment 
- week 38 - Deliverable 1 (10% / group) (basic modular JavaFX application)
- week 41 - Deliverable 2 (10% / group) (improved modular application)
- week 46 - Deliverable 3 (50% / group) (final technical)
- week 47 - Deliverable 4 (30% / individual) Reflection report

== Deadlines

- the deliverables are due on Thursdays at midnight in the week indicated
- if you are late you need to inform the TA

== Evaluation and feedback
 
@@ -92,18 +114,35 @@ The first task for the group is to select the domain.
 - deliverables 1-3 will be basically snapshots of the repository at given times
 - we will strive to provide quick feedback based on the repo activity

== Using AI tools and other resources

- Each group will have to document:
[.smaller-80]
** what tools are used and for what purpose (document)
** snipets of code generated need to reference properly the source (use comments)
** snipets of code copied from stackoverflow or similar need to reference properly the source (use comments)


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


== 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 

@@ -120,53 +159,32 @@ The first task for the group is to select the domain.
** 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
Gruppekontrakt skal godkjennes av studentassistent, signeres av alle gruppemedlemmer - og leveres på Blackboard

== Group registration form

[.left]
https://bit.ly/2HdMRQi
- The form link is on Blackboard
- https://s.ntnu.no/it1901groups  
- deadline for answering is on September 1st, 23:59 
- in the group form you are expressing preferences
- course staff will make any changes necessary to get the best group composition possible

== Tasks for this week

[.smaller-60]
- fill in the form for group formation
- brush up and revisit Java and JavaFX (useful links on BlackBoard) 
- prepare ideas for the project - so you are ready when the groups are done
- prepare your development environment - git, sdkman, vscode, maven etc
- log in to https://gitlab.stud.idi.ntnu.no/
- ask access to https://gitlab.stud.idi.ntnu.no/it1901/students-2024/sandbox and create a test repo
- start with the individual mandatory assignment as soon as it is available (probably tomorrow, latest on Monday morning)
- follow BlackBoard for updates

[.right]
image::../images/lecture01/qrcode-group-registration.svg[width=400]

== ! 

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
+192 −0
Original line number Diff line number Diff line
= Git Basics
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Git Basics
:LECTURE_NO: 2nd lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}

== Agenda

[%step]
- Administrative issues
- 1st individual deliverable 
- Why Java
- Git
- Summary

[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Groups

- fill the form to be assigned to a group
- https://s.ntnu.no/it1901groups
- deadline for answering is on September 1st, 23:59
- will announce the groups in week 36 
- 70 % of grade is given by groupwork


== 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
- Meld deg i pausen om du er interessert!
- If until next week there are no volunteers we will randomly select 5 students 

 
== Getting help

- check BlackBoard
- ask your group TA - list coming soon


== Approaching Deadlines

- Søndag, 1. september / 23:59
** Fill the group form

- Torsdag, 12. september / 23:59 
** 1st individual deliverable 
** pushed later to week 37



[background-color = "#124990"]
[color = "#fff6d5"]
== 1st individual deliverable


== Læringsmål for øvingen

* grunnleggende git-ferdigheter
* oppsett av java-prosjekt med maven
* sammenheng mellom navn, struktur og innhold
* oppfriskning om javafx og fxml
* generell feilfinning

== Hensikt

Alle skal kunne bidra til prosjektet!!!

== Grunnleggende git-ferdigheter

* opprett kodelager på gitlab - ( use fork )
* klone mal-kodelager (`git clone`)
* lage nye versjoner (`git add` og `git commit`)
* overføre til fjernlager (`git push`)


== Java-prosjektoppsett m/maven

* kildekodemapper og pakkehierarki
** **src/main/java** og **src/main/resources**
** **src/test/java** (og **src/test/resources**)
* pakkehierarki og mappestruktur
** pakkenavn(segmenter) tilsvarer mappestruktur
** både kode og ressurser hører til pakker
** `getClass().getResource(...)`

== Navn, struktur og innhold

* klasser og filer, pakker og mapper
* konfigurasjon i pom.xml
** klassenavn (og modulnavn)
** kommandolinje-argumenter
* **module-info.java**
** modulnavn i deklarasjon og `requires`
** pakkenavn i `exports` og `opens`

== Navn, struktur og innhold

* **pom.xml**
** konfigurasjon av maven-tillegg
** inkl. kjøring av tester og app
** klassenavn (og modulnavn)
** kommandolinje-argumenter

== Oppfriskning om javafx og fxml

[.smaller-80]
* rollefordeling mellom domene- og kontroller-klasse(r)
* kobling mellom fxml og kontroller-klasse
** **fx:id** og **onXyz**-attributter i fxml-fil
** felt og metoder i kontroller-klasse
* programflyt i kontroller
** initiell visning av tilstand
** reaksjon på hendelser
** oppdatering av visning

== Generell feilfinning

[.smaller-80]
* tolke symptomer
** hvorfor reagerer ikke appen?
** hvordan finne ledetråder i "stacktracen"?
** hvorfor kalles ikke metoden?
* løse problemet
** utvikle hypoteser om årsaker
** validere (eller falsifiere) hypoteser
** prøve ut løsninger

== Main steps

[.smaller-80]
- set up the repo in gitlab
** create a project under students-2024
** use the javafx-template as a starting point
- change the template
** project name
** packages
- implement the missing logic
** check by running the tests


[background-color = "#124990"]
[color = "#fff6d5"]
== Why Java

== Java

[.smaller-80]
- in top languages for many years
- general purpose 
- "the COBOL of the 21st century"
- great community and tooling
- actively developed
- good job opportunities
- Scala, Kotlin, Groovy, Clojure run on JVM



[background-color = "#124990"]
[color = "#fff6d5"]
== Git

== What is git

Git is a source code management system that is lightweight, reliable, fast and fully distributed. 
On top of that it is free and open source. Git was  initially authored by Linus Torwalds and emerged from his troubles encountered while trying to manage the contributions to Linux kernel.

include::{includedir}scm_content.adoc[]

== Quizz 

 - Join at menti.com  
 - use code 3440 3064


[background-color = "#124990"]
[color = "#fff6d5"]
== Summary


include::{includedir}footer.adoc[]
 No newline at end of file
+102 −0
Original line number Diff line number Diff line
= Git++
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: git++
:LECTURE_NO: 2nd lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2023 - {LECTURE_NO}

== Agenda

[%step]
- Administrative issues
- Git
- Gitlab
- Demo
- 1st individual deliverable 
- Summary

[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Groups

- fill the form to be assigned to a group
- https://s.ntnu.no/it1901groups
- deadline: Torsdag, 31. august 16:00
- will announce the groups in week 36 
- 70 % of grade is given by groupwork


== 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
- Meld deg i pausen om du er interessert!
- If until next week there are no volunteers we will randomly select 5 students 

== Approaching Deadlines

- Torsdag , 31. august 16:00
** Fill the group form

- Torsdag 7. september / 18:00 
** 1st individual deliverable 

 
== Getting help

- ask your group TA
- piazza channel - coming up next week
- technical helpdesk - coming up next week



[background-color = "#124990"]
[color = "#fff6d5"]
== Git

== What is git

Git is a source code management system that is lightweight, reliable, fast and fully distributed. 
On top of that it is free and open source. Git was  initially authored by Linus Torwalds and emerged from his troubles encountered while trying to manage the contributions to Linux kernel.


include::{includedir}scm_content.adoc[]


[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab


== What is GitLab

Is a complete devops solution that does repository hosting, issue tracking, agile planning, code review, ci/cd and more. It started as an open source project and it still has a community edition which is free and open source



[background-color = "#124990"]
[color = "#fff6d5"]
== Demo


[background-color = "#124990"]
[color = "#fff6d5"]
== Summary

== Next week

 - more on git and gitlab
 - talk about containers for development


include::{includedir}footer.adoc[]
 No newline at end of file
Original line number Diff line number Diff line
= Software Development 
:customcss: slides.css
:icons: font
:includedir: 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
+15 −0
Original line number Diff line number Diff line
= Software Development 
:customcss: slides.css
:icons: font
:includedir: 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
+189 −0
Original line number Diff line number Diff line
= Git, GitLab and development environment
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Git, GitLab and development environment
:LECTURE_NO: 3rd lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}

== Agenda

[%step]
- Administrative issues
- Git
- Gitlab
- Developmennt environment
- Summary

[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Groups

- groups will be finalized this week
- there will be a BlackBoard group and a GitLab group assigned for each team of students
- issues - contact Talha Mahboob Alam talha.m.alam@ntnu.no


== Referansegruppe

[.smaller-60]
- established - 1st meeting next week
- members
** Vebjørn Liland Drefvelin vebjorld@stud.ntnu.no	Informatikk
** Jessica Shuyue Liu jessicsl@stud.ntnu.no	Datateknologi
** Kristoffer Welle kristwel@stud.ntnu.no Datateknologi
** Erling Kvalvik Eriksen erlingke@stud.ntnu.no	Lektorutdanning i realfag


== 1st Group deliverable

- start working on selecting the project as soon as your group is ready
- prepare group contract
- read carefully the instructions

== Approaching Deadlines

- Torsdag, 12. september / 23:59 
** 1st individual deliverable

- Torsdag, 19. september / 23:59 
** 1st group deliverable

- Torsdag, 19. september / 23:59 
** group contract

 
== Getting help

- ask your group TA
- Q and A sessions every Thursday starting week 37
- some lectures will also Q and A sections 
- technical help - more info coming soon



[background-color = "#124990"]
[color = "#fff6d5"]
== Git

== What is git

Git is a source code management system that is lightweight, reliable, fast and fully distributed. 
On top of that it is free and open source. Git was  initially authored by Linus Torwalds and emerged from his troubles encountered while trying to manage the contributions to Linux kernel.


[.grid-left-right-50-50]
== Typical sequence (share project) 

[.area-left][.smaller-60]
- starting a project and sharing it on Gitlab for team collaboration
** `git init`
** `git status`

[.area-right][.smaller-60]
** `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][.smaller-60]
- working with a shared project
** `git clone`
** `git pull`

[.area-right][.smaller-60]
** `git status` 
** `git add ...`
** `git commit ...`
** `git push`

== 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>` 


[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab


== What is GitLab

Is a complete devops solution that does repository hosting, issue tracking, agile planning, code review, ci/cd and more. It started as an open source project and it still has a community edition which is free and open source


[background-color = "#124990"]
[color = "#fff6d5"]
== Development environment


== Sdkman

- tool allowing managing several versions of frameworks and development kits
- works on linux, mac and windows (with some convincing)
- manage several Java versions and or Maven versions
- easily install different flavours and releases


== Typical development environment for the course

- VSCode + relevant extensions
- git 
- sdkman - get Java 17.0.xx-tem and Maven 3.9

== Services used

- GitLab - https://gitlab.stud.idi.ntnu.no/
- Eclipse Che - https://che.stud.ntnu.no/


== Levels and approaches to the development environment for the course

- use the local machine - install on your OS
- use a virtual machine (e.g. VirtualBox)
- use a container (Docker Desktop + VSCode)
- use the cloud IDE (Eclipse Che + browser)



[background-color = "#124990"]
[color = "#fff6d5"]
== Summary




include::{includedir}footer.adoc[]
 No newline at end of file
+374 −0
Original line number Diff line number Diff line
= Build tools
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Build tools
:LECTURE_NO: 4th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}

== Agenda

[%step]
- Administrative issues
- 1st Group Exercise
- Build tools
- More on development environment
** VSCode extensions
** Eclipse Che
- Agile Practices
- Summary


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Groups

- groups have been established
- each student team got a BlackBoard group and a GitLab group 
- the GitLab group contains the "standard" repository
- check if you are properly assigned to your group



== Approaching Deadlines

- Torsdag, 12. september / 23:59 
** 1st individual deliverable

- Torsdag, 19. september / 23:59 
** 1st group deliverable

- Torsdag, 19. september / 23:59 
** group contract

 
== Getting help

- ask your group TA
- Q and A sessions every Thursday starting week 37
- some lectures will also Q and A sections 
- technical help - helpdesk on teams starting next week


== ! 

image::../images/lecture04/overview.png[canvas, size=contain]


[background-color = "#124990"]
[color = "#fff6d5"]
== 1st Group Exercise

== Start group work

 - finish and deliver the group contract
 - discuss and select domain / aplication for group project
 - discuss and agree on workflow, meetings etc
 - set up your gitlab workspace and repository
 - plan the sprint  / iteration for the first deliverable

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

== 3 step release plan

- Minimal application
- Application with more features / improved quality 
- Final technical – client server / REST API / more features / alternative client

== Minimal application

- a simple app is created with JavaFX and FXML, with relatively minimal functionality 
- can save data to a file and start up again where it left off
- divided into separate modules
- good point to start could be the modules-template (from the individual exercise)
 ** one can also use the todo list example as inspiration

== Requirements (1)

 - project must be in the group repo in gitlab
 - documentation for each release is placed in a separate folder
 ** 1st deliverable (release)-  `...groups-2024/gr24nn/gr24nn/docs/release1`
 - a milestone in Gitlab should refer to the corresponding documentation and issues

== Requirements (2)

- project must build with Maven
- one root level README.md in the repo to describe the content
- another README.md file (use links) must describe expected application functionality (use at least a screen mockup / screenshot) 
- there must also be at least one user story
- there must be corresponding issues in Gitlab

== Requirements (3)

- you must reference the issues in the commits
- configure Maven  so that 
** application runs with  `mvn javafx:run` 
** test can run using `mvn test` 
- the build must report test coverage ( > 0% ) 
 
== Requirements (4)

- there must be at least something in each of the three architecture layers 
** domain logic, user interface (JavaFX-GUI) and persistence 
- project should be configured to open and run in eclipse che (link in README.md)

== Requirements (5)

- Readme.md file should include a section where requirements are specified - versions for Java, Maven, dependencies etc.
- Document usage of AI-tools. Why and what / why not
** (...groups-2024/gr24nn/gr24nn/docs/release1/ai-tools.md).
- any code taken / generated needs to reference the source in a comment

== Application description

- General description included in readme.md file
- user stories supported by additional design documents such as:
** conceptual model, 
** personas, 
** scenarios, 
** UI mockups, 
** UI protoypes
- User stories get broken down into issues and tasks
- Lead to a functional application




[background-color = "#124990"]
[color = "#fff6d5"]
== Build Tools

== Build tools (1)

[%step]
- Automate the process of building executable programs from source files
- Packaging binaries required for deployment / distribution
- Run automated tests

== Build tools (2)

[%step]
- Build automation is a necessity to enable CI/CD
- Remove the need to do redundant tasks
- Improve quality of the software
	** the software builds are prepared in a consistent and predictable manner
	** possible to have data to analyze issues and improve

== Make (1)

[%step]
- Designed by Stuart Feldman
- Released in 1976
- Uses makefiles to describe the actions required to produce the build
- Manages dependencies

[.smaller-40]
https://en.wikipedia.org/wiki/Make_(software)

== Make (2)

[%step]
- Has been rewriten a number of times
- Standard modern implementation is GNU Make
- Used in Linux and Mac OS

== Java world build tools

- Ant with Ivy
- Maven
- Gradle

== Apache ANT

[%step]
- modern build system
- released in 2000
- build files use XML
	** tends to get unmanageable even for small projects
- Apache Ivy for managing dependencies (added later)
	** download over network

[.smaller-40]
http://ant.apache.org

== Apache Maven (1)

[%step]
- released in 2004
- improves on ANT
- build files use also XML but the structure is radically different
- dependency management with automatic downloading over the network is available from release

[.smaller-40]
http://maven.apache.org

== Apache Maven (2)

[%step]
- hides complexity in build files through plugins 
- customizing is hard
- dependency management has issues with conflicting versions of same library  


[background-color = "#124990"]
[color = "#fff6d5"]
== Gradle


== Gradle (1)

[%step]
- released in 2012
- build scripts are written in a domain specific language based on Groovy
	**  Groovy ( http://www.groovy-lang.org/ )
- the build script is named `build.gradle`
- build steps are called "tasks"

[.smaller-40]
https://gradle.org


== Gradle (2)

[%step]
- easy to create own tasks
- uses plugins to hide complexity 
- applying plugins allows access to additional tasks 


== Gradle (3)

[.center-paragraph]
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

== Maven (3)

* manages builds, dependencies, versions 
* configuration file is `pom.xml`
* has good IDE support
* central repository(ies) for dependencies

== Maven - pom.xml

* 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

== Maven - pom.xml (cont.)

* dependencies - list of artifacts we depend upon
* packaging - e.g. .jar (Java archive)
* description 

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

== Maven build lifecycles

[.smaller-60]
* clean
* site
* default
** validate
** compile
** test
** package
** verify
** install
** deploy


== Maven plugins

* add functionality
* connected to a certain lifecycle phase
* provide additional goals

[background-color = "#124990"]
[color = "#fff6d5"]
== More on development environment


[background-color = "#124990"]
[color = "#fff6d5"]
== VSCode extensions



[background-color = "#124990"]
[color = "#fff6d5"]
== Eclipse Che


[background-color = "#124990"]
[color = "#fff6d5"]
== Agile Practices - Scrum

== User stories

[.smaller-80]
- short, simple descriptions for application features 
- formulated from the stand point of the user / customer
- template: 
** As a **< type of user >**, I want **< some goal >** so that **< some reason >**.
- they are not replacing design documents  / requirements specification
- they need to be developed into specific tasks and connected to constraints and other meaningful documentation. 

== Sprints
- meaningful iterations of comparable length
- they should have a clear goal

== Planning releases
- 3 deliverables - map to releases
- a release should produce a minimum viable product (MVP)
** a MVP is a version of an application with just enough features to be usable in getting feedback to guide the development process 


== Meetings
- regular stand-up meetings (synchronize and commit, remove hindrances)
- retrospectives (reflect on your group work)
- sprint reviews / demos (invite TA, prepare deliverables)

 


[background-color = "#124990"]
[color = "#fff6d5"]
== Summary


include::{includedir}footer.adoc[]
 No newline at end of file
+100 −0
Original line number Diff line number Diff line
= SCM - Git demo
:customcss: slides.css
:icons: font
:includedir: 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
Original line number Diff line number Diff line
= Individuell obligatorisk øving
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Øving 1
:LECTURE_NO:  4th lecture

include::{includedir}header.adoc[]

[.smaller-80][.center-paragraph]
IT1901 Fall 2023 - {LECTURE_NO}

[background-color = "#124990"]
[color = "#fff6d5"]
== Overview

- Administrative issues
- Individual exercise
- Build tools
- Summary


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Groups

- fill the form to be assigned to a group
- https://s.ntnu.no/it1901groups
- deadline: today, 31. august 16:00
- will announce next week
- the late comers to the course will have a bit more time 


== Approaching Deadlines

- Torsdag , 31. august 16:00
** Fill the group form

- Torsdag 7. september / 18:00 
** 1st individual deliverable 


== Help tools

- Piazza for the course is up and running
- Helpdesk is up and running
- Relevant links and info in Blackboard


[background-color = "#124990"]
[color = "#fff6d5"]
== Individual exercise


== Læringsmål for øvingen

* grunnleggende git-ferdigheter
* oppsett av java-prosjekt med maven
* sammenheng mellom navn, struktur og innhold
* oppfriskning om javafx og fxml
* generell feilfinning

== Hensikt

Alle skal kunne bidra til prosjektet!!!

== Grunnleggende git-ferdigheter

* opprett kodelager på gitlab
* klone mal-kodelager (`git clone`)
* knytte kodelager til annet fjernlager (`git remote`)
* overføre til fjernlager (`git push`)
* lage nye versjoner (`git add` og `git commit`)

== Java-prosjektoppsett m/maven

* kildekodemapper og pakkehierarki
** **src/main/java** og **src/main/resources**
** **src/test/java** (og **src/test/resources**)
* pakkehierarki og mappestruktur
** pakkenavn(segmenter) tilsvarer mappestruktur
** både kode og ressurser hører til pakker
** `getClass().getResource(...)`

== Navn, struktur og innhold

* klasser og filer, pakker og mapper
* konfigurasjon i pom.xml
** klassenavn (og modulnavn)
** kommandolinje-argumenter
* **module-info.java**
** modulnavn i deklarasjon og `requires`
** pakkenavn i `exports` og `opens`

== Navn, struktur og innhold

* **pom.xml**
** konfigurasjon av maven-tillegg
** inkl. kjøring av tester og app
** klassenavn (og modulnavn)
** kommandolinje-argumenter

== Oppfriskning om javafx og fxml

[.smaller-80]
* rollefordeling mellom domene- og kontroller-klasse(r)
* kobling mellom fxml og kontroller-klasse
** **fx:id** og **onXyz**-attributter i fxml-fil
** felt og metoder i kontroller-klasse
* programflyt i kontroller
** initiell visning av tilstand
** reaksjon på hendelser
** oppdatering av visning

== Generell feilfinning

[.smaller-80]
* tolke symptomer
** hvorfor reagerer ikke appen?
** hvordan finne ledetråder i "stacktracen"?
** hvorfor kalles ikke metoden?
* løse problemet
** utvikle hypoteser om årsaker
** validere (eller falsifiere) hypoteser
** prøve ut løsninger

== Main steps

- set up the repo in gitlab
** create a project under students-2023
** use the javafx-template as a starting point
- change the template
** project name
** packages
- implement the missing logic
** check by running the tests


[background-color = "#124990"]
[color = "#fff6d5"]
== Demo time


[background-color = "#124990"]
[color = "#fff6d5"]
== Build tools

== Build tools (1)

[%step]
- Automate the process of building executable programs from source files
- Packaging binaries required for deployment / distribution
- Run automated tests

== Build tools (2)

[%step]
- Build automation is a necessity to enable CI/CD
- Remove the need to do redundant tasks
- Improve quality of the software
	** the software builds are prepared in a consistent and predictable manner
	** possible to have data to analyze issues and improve

== Make (1)

[%step]
- Designed by Stuart Feldman
- Released in 1976
- Uses makefiles to describe the actions required to produce the build
- Manages dependencies

[.smaller-40]
https://en.wikipedia.org/wiki/Make_(software)

== Make (2)

[%step]
- Has been rewriten a number of times
- Standard modern implementation is GNU Make
- Used in Linux and Mac OS

== Java world build tools

- Ant with Ivy
- Maven
- Gradle

== Apache ANT

[%step]
- modern build system
- released in 2000
- build files use XML
	** tends to get unmanageable even for small projects
- Apache Ivy for managing dependencies (added later)
	** download over network

[.smaller-40]
http://ant.apache.org

== Apache Maven (1)

[%step]
- released in 2004
- improves on ANT
- build files use also XML but the structure is radically different
- dependency management with automatic downloading over the network is available from release

[.smaller-40]
http://maven.apache.org

== Apache Maven (2)

[%step]
- hides complexity in build files through plugins 
- customizing is hard
- dependency management has issues with conflicting versions of same library  


[background-color = "#124990"]
[color = "#fff6d5"]
== Gradle


== Gradle (1)

[%step]
- released in 2012
- build scripts are written in a domain specific language based on Groovy
	**  Groovy ( http://www.groovy-lang.org/ )
- the build script is named `build.gradle`
- build steps are called "tasks"

[.smaller-40]
https://gradle.org


== Gradle (2)

[%step]
- easy to create own tasks
- uses plugins to hide complexity 
- applying plugins allows access to additional tasks 


== Gradle (3)

[.center-paragraph]
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

== Maven (3)

* manages builds, dependencies, versions 
* configuration file is `pom.xml`
* has good IDE support
* central repository(ies) for dependencies

== Maven - pom.xml

* 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

== Maven - pom.xml (cont.)

* dependencies - list of artifacts we depend upon
* packaging - e.g. .jar (Java archive)
* description 

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"]
[color = "#fff6d5"]
== Summary


== Next week

[.smaller-80]
* set up groups
* set up repositories 
* announce 1 group exercise
* start working with the group exercise and group contract

include::{includedir}footer.adoc[]
 No newline at end of file
+191 −0
Original line number Diff line number Diff line
= Scrum / Gitlab
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Scrum / Gitlab
:LECTURE_NO: 4th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2022 - {LECTURE_NO}

== Overview

- Administrative issues
- Group contract
- Scrum
- Gitlab


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues


== Administrative issues

- Reference group
- Groups
- Getting help
- Upcoming deliverables

== Reference group (1)

- Special thanks to the reference group volunteers for their interest in the course.
- we selected a representative mix in the order of volunteering
- you can see the contact info in Blackboard
- questions regarding the course organization and proposals for improvements should be communicated to the reference group
- half of the reference group has been randomly selected to have a balanced set of representatives


== Reference group (2)

- vebjorbl@stud.ntnu.no	Vebjørn Falk Blom-Hagen
- hanneswi@stud.ntnu.no	Hannes Witt	
- johanlm@stud.ntnu.no	Johannes Landmark Meldal
- adelefe@stud.ntnu.no	Adele Felicia Ellingsen-Grønningsæther
- olejme@stud.ntnu.no	Ole Jacob Mellgren
- elintes@stud.ntnu.no	Elin Tesaker



== Groups

- groups have been formed based on the form and input from students
- will be uploaded in BlackBoard tomorrow
- for issues with groups contact Farzana Quayyum <farzana.quayyum@ntnu.no>
- several of the enrolled students have not been distributed to groups
- we will proceed to create the gitlab groups with the same composition as the Blackboard groups ASAP
 
== Getting help

- Use piazza instead of sending individual emails to staff
- technical help-desk will be shortly operating
- A TA will be assigned to each group 
** subject matter and group related questions should be addressed to them


== Upcoming deliverables (1)
- 1st individual assignment 
- deadline on this Thursday at midnight
- not all requested access for 1st individual assignment
- this is a mandatory exercise, you cannot get a grade in the course if you do not pass it

== Upcoming deliverables (2)

- group contract
- deadline one week from announcing the groups

[background-color = "#124990"]
[color = "#fff6d5"]
== Group contract


== Group contract (0) 

- contact the other members of your group
- start working on the group contract

== 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 this Friday by 16:00

== Group contract (3)
- more recommended 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 recommended 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 recommended 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


[background-color = "#124990"]
[color = "#fff6d5"]
== Scrum

== 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

[.smaller-80]
- short, simple descriptions for application features 
- formulated from the stand point of the user / customer
- template: 
** As a **< type of user >**, I want **< some goal >** so that **< some reason >**.
- they are not replacing design documents  / requirements specification
- they need to be developed into specific tasks and connected to constraints and other meaningful documentation. 

== Sprints
- meaningful iterations of comparable length
- they should have a clear goal

== Planning releases
- 3 deliverables - map to releases
- a release should produce a minimum viable product (MVP)
** a MVP is a version of an application with just enough features to be usable in getting feedback to guide the development process 


== Meetings
- regular stand-up meetings (synchronize and commit, remove hindrances)
- retrospectives (reflect on your group work)
- sprint reviews / demos (invite TA, prepare deliverables)

== Pair programming

- popular agile development  technique
- recommended to be used in your groups


[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab

== Gitlab -Issue tracking

- Issues
- Labels
- Milestones
- Boards

[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab demo

include::{includedir}footer.adoc[]
+191 −0
Original line number Diff line number Diff line
= Scrum / Gitlab
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Scrum / Gitlab
:LECTURE_NO: 4th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2022 - {LECTURE_NO}

== Overview

- Administrative issues
- Group contract
- Scrum
- Gitlab


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues


== Administrative issues

- Reference group
- Groups
- Getting help
- Upcoming deliverables

== Reference group (1)

- Special thanks to the reference group volunteers for their interest in the course.
- we selected a representative mix in the order of volunteering
- you can see the contact info in Blackboard
- questions regarding the course organization and proposals for improvements should be communicated to the reference group


== Reference group (2)

- August Sætre Aasvær	augustsa@stud.ntnu.no	
- Skage Klingstedt Reistad	skagekr@stud.ntnu.no
- Iver Baardsgaard Brønstad	iverbb@stud.ntnu.no
- Anna Østmo	annaost@stud.ntnu.no
- Mats Ellingsen	matsel@stud.ntnu.no
- Victoria Kjerstin Huaco Simensen	vksimens@stud.ntnu.no


== Groups

- groups have been formed based on the form and input from students
- check in BlackBoard if you are in a group
- for issues with groups contact Farzana Quayyum <farzana.quayyum@ntnu.no>
- 338 out of the 353 enrolled students have been distributed to groups
- we will proceed to create the gitlab groups with the same composition as the Blackboard groups ASAP
 
== Getting help

- Use piazza instead of sending individual emails to staff
** 192 out of 338 students have registered in piazza
- If relevant you can use the technical help-desk
** how to access it and use it is posted in Blackboard 
- A TA will be assigned to each group 
** subject matter and group related questions should be addressed to them


== Upcoming deliverables (1)
- 1st individual assignment 
- deadline on this Friday at 16:00
- 271 out of 338 - requested access for 1st individual assignment
- this is a mandatory exercise, you cannot get a grade in the course if you do not pass it

== Upcoming deliverables (2)

- group contract
- deadline on this Friday at 16:00

[background-color = "#124990"]
[color = "#fff6d5"]
== Group contract


== Group contract (0) 

- contact the other members of your group
- start working on the group contract

== 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 this Friday by 16:00

== Group contract (3)
- more recommended 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 recommended 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 recommended 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


[background-color = "#124990"]
[color = "#fff6d5"]
== Scrum

== 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

[.smaller-80]
- short, simple descriptions for application features 
- formulated from the stand point of the user / customer
- template: 
** As a **< type of user >**, I want **< some goal >** so that **< some reason >**.
- they are not replacing design documents  / requirements specification
- they need to be developed into specific tasks and connected to constraints and other meaningful documentation. 

== Sprints
- meaningful iterations of comparable length
- they should have a clear goal

== Planning releases
- 3 deliverables - map to releases
- a release should produce a minimum viable product (MVP)
** a MVP is a version of an application with just enough features to be usable in getting feedback to guide the development process 


== Meetings
- regular stand-up meetings (synchronize and commit, remove hindrances)
- retrospectives (reflect on your group work)
- sprint reviews / demos (invite TA, prepare deliverables)

== Pair programming

- popular agile development  technique
- recommended to be used in your groups


[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab

== Gitlab -Issue tracking

- Issues
- Labels
- Milestones
- Boards

[background-color = "#124990"]
[color = "#fff6d5"]
== Gitlab demo

include::{includedir}footer.adoc[]
Original line number Diff line number Diff line
= Groupwork and more
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Groups and groupwork
:LECTURE_NO: 5th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2023 - {LECTURE_NO}

== Overview

- Administrative issues
- Group contract
- 1st group deliverable
- Scrum
- Gitlab
- Summary


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues


== Groups (1)

- Groups have been assigned a TA
- We have created the groups in Blackboard
- We have added the members to each group
- Each group has assigned a TA (info in BlackBoard)
- We will create the gitlab groups ASAP 

== Groups (2)

- Check in BlackBoard to see your group
- If you are not allocated contact talha.m.alam@ntnu.no


== Reference group (1)

- Special thanks to the reference group volunteers for their interest in the course.
- we selected a representative mix in the order of volunteering
- you can see the contact info in Blackboard
- questions regarding the course organization and proposals for improvements should be communicated to the reference group

== Reference group (2)

- Trygve Eriksen tryger@stud.ntnu.no	(Datateknologi)
- Magnus Andreas Giverin magnusgi@stud.ntnu.no (Datateknologi)
- Noah Lund Syrdal noahls@stud.ntnu.no (Informatikk)
- Caroline Wie carolwie@stud.ntnu.no (Informatikk)
- Anine Løkken aninelok@stud.ntnu.no (Datateknologi)


== Nearing Deadlines

 - First individual assignment (Thursday 07.09.2023 18:00)
 ** there will be a possibility to resend after the first round of feedback
 - Group contract (Thursday 14.09.2022 18:00)
 - First group assignment (Thursday 21.09.2022 18:00)


[background-color = "#124990"]
[color = "#fff6d5"]
== Group contract

== Group contract (0) 

- contact the other members of your group
- start working on the group contract

== 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 by Thursday 14.09.2022 18:00

== Group contract (3)
- more recommended 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 recommended 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 recommended 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



[background-color = "#124990"]
[color = "#fff6d5"]
== 1st group deliverable


== Start group work

 - finish and deliver the group contract
 - discuss and select domain / aplication for group project
 - discuss and agree on workflow, meetings etc
 - set up your gitlab workspace and repository
 - plan the sprint  / iteration for the first deliverable

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

== 3 step release plan

- Minimal application
- Application with more features / improved quality 
- Final technical – client server / REST API / more features / alternative client

== Minimal application

- a simple app is created with JavaFX and FXML, with relatively minimal functionality 
- can save data to a file and start up again where it left off
- divided into separate modules
- good point to start could be the modules-template (from the individual exercise)
 ** one can also use the todo list example as inspiration

== Requirements (1)

 - project must be in the group repo in gitlab
 - documentation for each release is placed in a separate folder
 ** 1st deliverable (release)-  `...groups-2023/gr23nn/gr23nn/docs/release1`
 - a milestone in Gitlab should refer to the corresponding documentation and issues

== Requirements (2)

- project must build with Maven
- one root level README.md in the repo to describe the content
- another README.md file (use links) must describe expected application functionality (use at leasst a screen mockup / screenshot) 
- there must also be at least one user story
- there must be corresponding issues in Gitlab

== Requirements (3)

- you must reference the issues in the commits
- configure Maven  so that 
** application runs with  `mvn javafx:run` 
** test can run using `mvn test` 
- the build must report test coverage ( > 0% ) 
 
== Requirements (4)
- there must be at least something in each of the three architecture layers 
** domain logic, user interface (JavaFX-GUI) and persistence 
- project should be configured to open and run in eclipse che (link in README.md)


== Application description

- General description included in readme.md file
- user stories supported by additional design documents such as:
** conceptual model, 
** personas, 
** scenarios, 
** UI mockups, 
** UI protoypes
- User stories get broken down into issues and tasks
- Lead to a functional application


[background-color = "#124990"]
[color = "#fff6d5"]
== Scrum

== User stories

[.smaller-80]
- short, simple descriptions for application features 
- formulated from the stand point of the user / customer
- template: 
** As a **< type of user >**, I want **< some goal >** so that **< some reason >**.
- they are not replacing design documents  / requirements specification
- they need to be developed into specific tasks and connected to constraints and other meaningful documentation. 

== Sprints
- meaningful iterations of comparable length
- they should have a clear goal

== Planning releases
- 3 deliverables - map to releases
- a release should produce a minimum viable product (MVP)
** a MVP is a version of an application with just enough features to be usable in getting feedback to guide the development process 


== Meetings
- regular stand-up meetings (synchronize and commit, remove hindrances)
- retrospectives (reflect on your group work)
- sprint reviews / demos (invite TA, prepare deliverables)

== Pair programming

- popular agile development  technique
- recommended to be used in your groups


[background-color = "#124990"]
[color = "#fff6d5"]
== GitLab

== GitLab

* Issues
* Milestones
* Task lists and check lists
* Labels
* Boards
* Quick actions

== Issues (1)

- collaboration and discussion
- elaborate on design and implementation
- plan work and track progress

== Issues (2)

- issues track work (not only programming work)
- examples
** new features, bugs and change requests
** other tasks - documentation, refactoring, configuration
** knowledge acquisition  - (to get work done)
** etc


== Milestones

- way to organize and manage issues and merge requests
- can be used to manage releases
- can be mapped to sprints

== Task lists and check lists

- split work in finer chunks
- keep track of progress within issues

== Labels

- allow categorizing issues and other elements in gitlab
- used with boards and issues to facilitate workflow and visibility

== Boards

- tool to manage and visualize workflow for a software artifact 
- combine issue tracking and project management in a single tool
- you can create a Scrum board or custom boards as needed


== Quick actions

- allow including in the text of the issue / comments commands
- assign , label, set due date etc in one go
- context dependent - options based on the state of the item


[background-color = "#124990"]
[color = "#fff6d5"]
== Summary


include::{includedir}footer.adoc[]
Original line number Diff line number Diff line
= GitLab
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: GitLab
:LECTURE_NO: 5th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2022 - {LECTURE_NO}

== Overview

- Administrative issues
- Gitlab


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues


== Administrative issues (Groups)

- Groups have been assigned a TA
- we have created the groups in gitlab
- we have added the members to each group
- the initial repositories for group exercises have been created 
- check if all in the group can access the repository 
- standard repository gr22nn/gr22nn 

== Administrative issues (Tech support)

- Technichal support is operational
- Link and info  will be published in BlackBoard


== Reference group (updated)

- vebjorbl@stud.ntnu.no	Vebjørn Falk Blom-Hagen (Informatikk)
- hanneswi@stud.ntnu.no	Hannes Witt	(Informatikk)
- johanlm@stud.ntnu.no	Johannes Landmark Meldal (Informatikk)
- jakobto@stud.ntnu.no	Jakob Tøssebro (Datateknologi)
- olejme@stud.ntnu.no	Ole Jacob Mellgren (Datateknologi)
- elintes@stud.ntnu.no	Elin Tesaker (Lektorutdanning i realfag)


== Nearing Deadlines

 - First individual assignment
 ** postponed to next week (Tuesday 13.09.2022 23:59)
 ** there will be a possibility to resend after the first round of feedback
 - Group contract (Tuesday 13.09.2022 23:59)
 - First group assignment (Thursday 22.09.2022 23:59)

== Start group work

 - finish and deliver the group contract
 - discuss and select domain / aplication for group project
 - discuss and agree on workflow, meetings etc
 - set up your gitlab workspace and repository
 - plan the sprint  / iteration for the first deliverable

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

== 3 release plan

- Minimal application
- Application with more features / improved quality 
- Final technical – client server / REST API / more features / alternative client

== Application description

- General description included in readme.md file
- user stories supported by additional design documents such as:
** conceptual model, 
** personas, 
** scenarios, 
** UI mockups, 
** UI protoypes
- User stories get broken down into issues and tasks
- Lead to a functional application



[background-color = "#124990"]
[color = "#fff6d5"]
== GitLab

== GitLab

* Issues
* Milestones
* Task lists
* Labels
* Boards
* Quick actions


include::{includedir}footer.adoc[]
+55 −0
Original line number Diff line number Diff line
= Q & A
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Q&A
:LECTURE_NO: 5th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2021 - {LECTURE_NO}

== Overview

- Administrative issues
- Q & A


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues


== Administrative issues
- Groups have been assigned a TA
- we have created the groups in gitlab
- we have added the members to each group
- the initial repositories have been created 


[background-color = "#124990"]
[color = "#fff6d5"]
== Q & A


== 3 release plan

- Minimal application
- Application with more features / improved quality 
- Final technical – client server / REST API / more feature / alternative client

== Application description

- General description included in readme.md file
- user stories supported by additional design documents such as:
** conceptual model, 
** personas, 
** scenarios, 
** UI mockups, 
** UI protoypes
- User stories get broken down into issues and tasks
- Lead to a functional application

include::{includedir}footer.adoc[]
+337 −0
Original line number Diff line number Diff line
= Code Quality and Testing
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Code Quality and Testing
:LECTURE_NO: 5th Lecture

include::{includedir}header.adoc[]

[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}

[background-color = "#124990"]
[color = "#fff6d5"]
== Overview

[.smaller-80]
- Administrative issues
- 2nd Group Exercise
- Code Quality
** Testing
- Summary

[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== Administrative issues

* Mandatory Individual Assignment
* Group work


== Mandatory Individual Assignment

* deadline was on 12.09.2024
* the majority submitted 
* information about retake will be available after we check the exercises


== Group work

- prepare for delivery
- you submit the link to repo and the commit hash to evaluate
- report any group drop out cases - exercises are designed to work for 3-4 people
- we take into account the reduced numbers when grading
- test your deliverable in Eclipse Che


== Approaching Deadlines

- Torsdag, 19. september / 23:59 
** 1st group deliverable

- Torsdag, 19. september / 23:59 
** group contract


[background-color = "#124990"]
[color = "#fff6d5"]
== 2nd Group Exercise





[background-color = "#124990"]
[color = "#fff6d5"]
== Code quality

== Code quality

- testing
 ** automated tests
 ** +++
- coding standards and consistent formatting
- check for higher level types of errors (bug patterns)
- +++


[background-color = "#124990"]
[color = "#fff6d5"]
== Testing

== Crowdstrike incident 2024

* largest IT outage in history
* several billion USD in losses
* affected roughly 8.5 million systems
* bad test practices - happy path, no compatibility
* bad deployment practices

== Knight Capital Group (2012)

* technician forgot to copy the new version on one of the servers
* new version repurposed a flag that trigerred the olde version to send orders indefinitely
* 440 million USD lost
* lack of thorough regression testing

== Therac-25 - mid 80s

* radiation treatment cancer patients
* software issues - wrong dose
* caused 6 accidents, killed 3 patients
* bad design and development practices
* unfeasible to test properly and automate tests



== 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 now, 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 (2)

``` 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  
https://junit.org/junit5/docs/current/user-guide/



[background-color = "#124990"]
[color = "#fff6d5"]
== TestFX

== TestFX

- testing for JavaFx applications
- provides robots for UI testing
- support for JUnit

[.smaller-40]
https://github.com/TestFX/TestFX


[background-color = "#124990"]
[color = "#fff6d5"]
== Mockito


== Mockito

- mocking is a technique to test functionality in isolation
- mock objects simulate real objects
- return dummy values corresponding to the input given at creation
- Mockito uses reflection features in Java to create the mock objects

[.smaller-40]
https://site.mockito.org/


[background-color = "#124990"]
[color = "#fff6d5"]
== Jacoco

== JaCoCo (1)

- Java Code Coverage (JaCoCo)
- popular tool for measuring code coverage in Java projects
- measures several metrics  

== Jacoco (2)

- tool for assessing code coverage
- does not need modifying code
- can produce a report in html format
- integrates with a number a tools including Gradle

[.smaller-40]
https://www.jacoco.org/



== JaCoCo metrics

- Instructions 
- Branches (exception handling is excluded)
- Cyclomatic Complexity - "According to  McCabe1996 cyclomatic complexity is the minimum number of paths that can, in (linear) combination, generate all possible paths through a method."
- Lines
- Methods
- Classes

[.smaller-40]
https://www.jacoco.org/jacoco/trunk/doc/counters.html

== 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

[background-color = "#124990"]
[color = "#fff6d5"]
== Summary

include::{includedir}footer.adoc[]
 No newline at end of file
+103 −0
Original line number Diff line number Diff line
= Administrative Issues 
:customcss: slides.css
:icons: font
:includedir: 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
Original line number Diff line number Diff line
= Build tools. Introduction to testing 
:customcss: slides.css
:icons: font
:includedir: 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
+69 −0
Original line number Diff line number Diff line
= Pair programming + Git
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Pair programming / Git
:LECTURE_NO: 5th lecture

include::{includedir}header.adoc[]


[.smaller-80][.center-paragraph]
IT1901 Fall 2021 - {LECTURE_NO}

== Overview

- 1st group deliverable
- Pair programming
- Git


[background-color = "#124990"]
[color = "#fff6d5"]
== 1st group deliverable

== 1st group deliverable

- 1st release  (MVP)
- deadline (to be discussed with the TAs) 
** standard deadline Friday 24th of September by 16:00
** extended deadline Friday 1st of October by 16:00


[background-color = "#124990"]
[color = "#fff6d5"]
== Pair programming

== Pair programming (0)

- a pair of developers take on a task
- use one computer
- take turns to the roles of driver / observer (navigator, co-pilot)
- program out loud 


== Pair programming (1)

- agile development technique
- better quality and less defects / more person hours
- learning from each other
- transfer of skills
- increased resilience of the development process
- aiding team building and communication 


== Pair programming (2)

- there are advantages to all kinds of pairing
- engagement is key to having results
- learning from each other
- remote pair programming 



[background-color = "#124990"]
[color = "#fff6d5"]
== Git


include::{includedir}footer.adoc[]
+122 −0
Original line number Diff line number Diff line
= Debugging
:customcss: slides.css
:icons: font
:includedir: includes/
:LECTURE_TOPIC: Debugging
:LECTURE_NO: 7th lecture

include::{includedir}header.adoc[]

[.smaller-80][.center-paragraph]
IT1901 Fall 2024 - {LECTURE_NO}


[background-color = "#124990"]
[color = "#fff6d5"]
== Overview
[.smaller-80]
- Administrative issues
- Debugging
- Summary


[background-color = "#124990"]
[color = "#fff6d5"]
== Administrative issues

== 1st individual exercise

- 2 thirds got it approved
- last chance to deliver
- mandatory exercise 
- new deadline 03.10.2024 23:59


== Approaching Deadlines

- Torsdag, 03. oktober / 23:59 
** 1st individual exercise

- Torsdag, 10. oktober / 23:59 
** 2nd group deliverable

== Next Lecture

* focus on advanced source code management
* go through the materials before the lecture
* more interactive

[background-color = "#124990"]
[color = "#fff6d5"]
== Debugging

== Debugging

- important part of software development
- process of finding and fixing faults
- apparently term became popular in 1940s - Grace Hopper moth inside a computer
- “bug” was used by Thomas Edison to describe a defect in a technical system 1870s

== Debugger

- tool that allows developer to 
** inspect values
** run step by step
** set "breakpoints"

== Why not printing?

- you can use sysout or logs to help
- it tends to polute the actual code
- gets unmanageable very fast in more complex projects



== Isn`t unit testing enough?

- testing and unit testing are useful and necessary
- not a replacement for debugging
- using debugging we can see what is happening in the code not passing the test
- tests are code too - you can debug the code in your tests as well


== Breakpoints

- developer can mark certain spots in the code where the execution should pause
- at the breakpoint one can decide how to continue
- one can inspect existing variables and also custom expressions

== Debugging commands

- Step into - follow code into methods, one step at a time
- Step over - go to the next line whithout going into methods
- Step out - run to the end of the method and go out to the caller code
- Continue - run until finding another breakpoint

== Advanced debugging

- conditional breakpoints - excution stops when a condition is met
- expressions - (watch) - code that evaluates at debug time
- changing values of runtime variables

== Typical uses

- correcting errors in code
- tracing the code paths
- understanding difficult or unfamiliar code



[background-color = "#124990"]
[color = "#fff6d5"]
== Debugging Demo


== Questions ?


[background-color = "#124990"]
[color = "#fff6d5"]
== Summary

include::{includedir}footer.adoc[]
 No newline at end of file
Original line number Diff line number Diff line
= Workflow Example 
:customcss: slides.css
:icons: font
:includedir: 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[]

lectures/settings.gradle

deleted100644 → 0
+0 −10

File deleted.

Preview size limit exceeded, changes collapsed.

pom.xml

0 → 100644
+223 −0

File added.

Preview size limit exceeded, changes collapsed.

public/index.html

0 → 100644
+9 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0

File added.

Preview size limit exceeded, changes collapsed.

settings.gradle

deleted100644 → 0
+0 −3

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/.classpath

deleted100644 → 0
+0 −30

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/.gitignore

deleted100644 → 0
+0 −6

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/.gitignore~

deleted100644 → 0
+0 −5

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/.project

deleted100644 → 0
+0 −23

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/README.md

deleted100644 → 0
+0 −48

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/build.gradle

deleted100644 → 0
+0 −86

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/ci-gradle.md

deleted100644 → 0
+0 −70

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/gradlew

deleted100755 → 0
+0 −188

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample/gradlew.bat

deleted100644 → 0
+0 −100

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/.gitignore

deleted100644 → 0
+0 −5

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/README.md

deleted100644 → 0
+0 −13

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/core/gradlew

deleted100755 → 0
+0 −188

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/fxui/gradlew

deleted100755 → 0
+0 −188

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/gradlew

deleted100755 → 0
+0 −188

File deleted.

Preview size limit exceeded, changes collapsed.

simpleexample2/gradlew.bat

deleted100644 → 0
+0 −100

File deleted.

Preview size limit exceeded, changes collapsed.