The QuTech Software Maturity Model (QSMM)


Version Control


Figure 1

Comic: a PhD student sends "FINAL.doc" to their supervisor, but after several increasingly intense and frustrating rounds of comments and revisions they end up with a file named "FINAL_rev.22.comments49.corrections.10.#@$%WHYDIDCOMETOGRADSCHOOL????.doc"
“notFinal.doc” by Jorge Cham, https://www.phdcomics.com

Figure 2

A diagram demonstrating how a single document grows as the result of sequential changes

Figure 3

A diagram with one source document that has been modified in two different ways to produce two different versions of the document

Figure 4

A diagram that shows the merging of two different document versions into one document that contains all of the changes from both versions

Figure 5

Accessing Git visual tools in PyCharm

Basic Git Commands


Figure 1

A diagram showing how "git add" registers changes in the staging area, while "git commit" moves changes from the staging area to the repository

Figure 2

A diagram showing two documents being separately staged using git add, before being combined into one commit using git commit

Figure 3

A diagram showing how git restore can be used to restore the previous version of two files

Figure 4

A diagram showing the entire git workflow: local changes are staged using git add, applied to the local repository using git commit, and can be restored from the repository using git checkout

Figure 5

Visually diff-ing in PyCharm:   Git diff using PyCharm


Figure 6

Exploring Git repo history using PyCharm

Figure 7

  • Discarding un-staged changes with PyCharm:   Git rollback using PyCharm

  • Figure 8

    Comparing two Git revisions using PyCharm

    Intermezzo I


    GitLab


    Figure 1

    TUD GitLab Login Page

    Figure 2

    TUD GitLab Login Page

    Figure 3

    Explore projects page with tab “Most starred” open. The tab shows a list of projects with icon, name, descriptions, and four statistical values for each entry.
    Project overview page

    Figure 4

    Create blank project form
    Create blank project form

    Figure 5

    Project homepage for a new project
    Fresh project homepage

    Figure 6

    Local repository with staging area

    Figure 7

    The local and remote Git repos

    Figure 8

    Accessing a GitLab repo via SSH

    Figure 9

    The SSH Keys page in GitLab

    Figure 10

    Adding a new key in GitLab

    Figure 11

    GitLab repo after first push

    Figure 12

    Project Members page
    Project members page

    Figure 13

    Adding a new member to your GitLab project

    Figure 14

    Removing project members
    Removing project members

    Advanced Git Commands


    Figure 1

    A diagram showing that "git clone" can create a copy of a remote GitLab repository, allowing a second person to create their own local repository that they can make changes to.

    Figure 2

    Reviewing commit changes in GitLab

    Figure 3

    Commenting on commit changes in GitLab

    Figure 4

    A diagram showing a conflict that might occur when two sets of independent changes are merged

    Figure 5

    Solving merge conflicts using PyCharm

    Figure 6

    Git feature branch workflow diagram

    Figure 7

    Software project's main branch

    Figure 8

    Software project's develop branch

    Figure 9

    Merge Request button after pushing to a branch

    Figure 10

    Merge Request form

    Figure 11

    Merge Request Lifecycle

    Figure 12

    Merge Request blocked because of conflicts

    Python Virtual Environments


    Figure 1

    Many Tools for the Job

    Installing and managing Python distributions, external libraries and virtual environments is, well, complex. There is an abundance of tools for each task, each with its advantages and disadvantages, and there are different ways to achieve the same effect (and even different ways to install the same tool!). Note that each Python distribution comes with its own version of pip - and if you have several Python versions installed you have to be extra careful to use the correct pip to manage external packages for that Python version.

    For a novice in this area it is very easy to quickly get overwhelmed, leading to situation like this:

    Python Environment Hell
    From XKCD (Creative Commons Attribution-NonCommercial 2.5 License)

    In order to avoid this “Python environment hell” problem, in this course we will only focus on venv and pip. Only focusing on these has several advantages, especially for novice users:

    • venv and pip have been around for quite a while, they are widely used, are very stable, and there is ample online documentation for both of them.
    • venv and pip are quite low-level, and minimalistic, so you do not have to deal with the feature explosion and bloatware that other tools may experience.
    • finally, many of the more high-level tools use the functionality provided by venv and pip as building blocks, so having a good understanding of these provides a solid foundation to expand to more sophisticated tools.

    In the next sections we will look at how to use venv and pip from the command line, similar to the approach we took when learning git

    Making Sure You Can Invoke Python

    You can test your Python installation from the command line with:

    BASH

    $ python3 --version # on Mac/Linux
    $ python --version # on Windows — Windows installation comes with a python.exe file rather than a python3.exe file

    Python Hangs in Git Bash on Windows

    If you are using Windows and invoking python command causes your Git Bash terminal to hang with no error message or output, you may have to use winpty - a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows command line tools. Inside the shell type:

    BASH

    alias python="winpty python.exe"

    This alias will be valid for the duration of the shell session. For a more permanent solution, from the shell do:

    BASH

    $ echo "alias python='winpty python.exe'" >> ~/.bashrc
    $ source ~/.bashrc

    Figure 2

    Sine Wave Plot

    Intermezzo II


    Clean Code


    Figure 1

    "Clean" vs. "Messy"

    Figure 2

    How to measure clean code?

    Figure 3

    Running Pytest from PyCharm

    Figure 4

    Running Pytest from PyCharm

    Figure 5

    Running Pytest from PyCharm

    Figure 6

    HTML coverage overview

    Figure 7

    HTML coverage per file

    Credits