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

Adding a file to a Git repo using PyCharm

Figure 2

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 3

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

Figure 4

Visually diff-ing in PyCharm:   Git diff using PyCharm


Figure 5

Exploring Git repo history using PyCharm

Figure 6

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

Figure 7

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 8

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

  • Figure 9

    Comparing two Git revisions using PyCharm

    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

    Advanced Git Commands


    Figure 1

    Adding a new member to your GitLab project

    Figure 2

    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 3

    Reviewing commit changes in GitLab

    Figure 4

    Commenting on commit changes in GitLab

    Figure 5

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

    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

    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.

    venv and pip are considered the de facto standards for virtual environment and package management for Python 3. However, the advantages of using Anaconda and conda are that you get (most of the) packages needed for scientific code development included with the distribution. If you are only collaborating with others who are also using Anaconda, you may find that conda satisfies all your needs. It is good, however, to be aware of all these tools, and use them accordingly. As you become more familiar with them you will realise that equivalent tools work in a similar way even though the command syntax may be different (and that there are equivalent tools for other programming languages too to which your knowledge can be ported).

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

    In the next sections we will look at how to manage virtual environments from the command line using venv and manage packages using pip.

    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

    If you are using Windows and invoking python command causes your Git Bash terminal to hang with no error message or output, you may need to create an alias for the python executable python.exe, as explained in the troubleshooting section.


    Figure 2

    Sine Wave Plot

    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