List of exercises

Full list

This is a list of all exercises and solutions in this lesson, mainly as a reference for helpers and instructors. This list is automatically generated from all of the other pages in the lesson. Any single teaching event will probably cover only a subset of these, depending on their interests.

Social coding

In social-coding.md:

Social-1: Think about if and how you share

  • Did you ever share your code? If yes, what motivated you? Come up with reasons for sharing your scripts/code/data.

  • Also think about reasons for not sharing.

In social-coding.md:

Social-2: Discussion about “You aren’t required to support anyone”

  • Have you experienced an implicit expectation of support?

  • Supporting all requests can lead to overworking and mental health issues.

  • Not supporting requests can also induce guilt.

  • Most projects are maintained by 1 or 2 persons.

  • Most projects cannot retain contributors for a longer time. Interests change. “Casual contributors are like tourists visiting NYC for a weekend” (Nadia Asparouhova, book below).

  • If you maintain all projects that you start forever, at some point it may be difficult to start new projects.

  • What are your experiences? Do you agree with the above thoughts?

  • Book recommendation: Nadia Asparouhova (formerly Nadia Eghbal): “Working in Public: The Making and Maintenance of Open Source Software (Stripe Press)”

Software licensing focusing on open source

In software-licensing.md:

Limitations and context of this lesson

This lesson is designed as practical educational material for researchers and research software engineers, not formal legal advice

  • Regional Focus: Guidance is grounded in EU statutory directives, European institutional frameworks and developers based in Europe with a global focus.

  • Institutional Context: Employment contracts, grant agreements, and university policies heavily influence software ownership and licensing choices.

  • This lesson covers only the general principles of open-source reuse, copyright scope, and software adaptation.

If you need formal guidance references below and legal experts, especially if you have legal services at your host institute, could be of help:

In software-licensing.md:

Scenario 1: Authoring original code and algorithms

You wrote an original algorithm from scratch (in Python, C++, Rust, etc.). Your repository contains only your original source code and dependency specifications (requirements.txt, CMakeLists.txt, Cargo.toml).

  • Licensing Goal: You want maximum adoption and zero friction for commercial or academic reuse.

  • Legal Reality: External dependencies remain separate works. Because you have not bundled third-party code inside your repository, you hold full copyright over your original codebase.

  • JLA Selection Strategy: To ensure downstream users must acknowledge your original authorship while granting them maximum flexibility to incorporate your code into both open and proprietary software, you require citation credit (Incl. Copyright) without imposing share-alike conditions (leaving Copyleft/Share a. unselected).

In software-licensing.md:

Scenario 2: Implementing mathematical models with copyleft obligations

You developed a custom mathematical solver implementing algorithms from academic literature. You want to ensure that any downstream improvements, extensions, or modifications made by others remain open-source and are shared back with the scientific community.

  • Licensing Goal: You want to enforce reciprocity (share-alike), preventing third parties from incorporating your algorithm into proprietary, closed-source software without sharing their modifications.

  • Legal Reality: Mathematical concepts and formulas themselves are not copyrightable, but your specific code implementation is fully protected by copyright. Applying a copyleft license legally binds anyone who distributes modified versions of your implementation to release their source code under matching reciprocal terms.

  • JLA Selection Strategy: To enforce reciprocal sharing, you must mandate that downstream distributors disclose their modified source code (Disclose source) and license their derivative works under matching terms (Copyleft/Share a.).

In software-licensing.md:

Scenario 3: Embedding permissively licensed third-party code

You are building an RSE tool and copied a helper function or utility snippet from a third-party project licensed under a permissive license (e.g., MIT or Apache-2.0) directly into one of your source files.

  • Licensing Goal: You want to maintain a permissive default for your project while properly acknowledging and legally respecting the embedded third-party code.

  • Legal Reality: Permissive licenses explicitly grant you permission to copy, modify, and embed their code into your repository. However, embedding permissive code does not make the original third-party copyright disappear, you must preserve the original copyright attribution and license terms for that specific snippet.

  • JLA Selection Strategy: Because inbound permissive code gives you maximum licensing flexibility, your overall repository can remain permissively licensed. To reflect this, select citation obligations (Incl. Copyright) without imposing reciprocal sharing constraints (leaving Copyleft/Share a. unselected).

In software-licensing.md:

Scenario 4: Embedding copyleft third-party code

You are building an software tool and copied a non-trivial code snippet from a third-party project licensed under a copyleft license (e.g., GPL-3.0 or EUPL-1.2) directly into one of your source files.

  • Licensing Goal: Comply with legal requirements imposed by the inbound copyleft code while ensuring your overall repository remains legally compliant.

  • Legal Reality: Copyleft licenses require that any work containing copyleft code must be shared under a compatible copyleft license as a whole. Embedding copyleft code directly into your repository creates a single combined work, making copyleft licensing mandatory for your entire project.

  • JLA Selection Strategy: Because the inbound copyleft code forces your repository to adopt reciprocal sharing terms, you must configure JLA to require source code disclosure (Disclose source) and reciprocal licensing (Copyleft/Share a.).

In software-licensing.md:

Scenario 5: Linking against a GPL-licensed library

You are developing an software application that imports or links against an external software library licensed under GPL-3.0 (e.g., importing a GPL Python package or linking a C/C++ static/shared library).

  • Licensing Goal: Ensure legal compliance while using copyleft libraries as core dependencies in your software project.

  • Legal Reality: Under mainstream copyright interpretation and the text of GPL-3.0, linking your code directly against a GPL library (whether statically or dynamically) creates a combined work. Consequently, the copyleft obligations of the external library extend to your entire repository.

  • JLA Selection Strategy: Because linking to a GPL library requires your distributed project to be released under matching reciprocal terms, you must configure JLA to mandate source code disclosure (Disclose source) and reciprocal licensing (Copyleft/Share a.).

In software-licensing.md:

Scenario 6: Authoring container recipes and environment specifications

You are creating a Dockerfile, Conda environment.yml, or build recipe to automate the setup of your research environment. The recipe itself contains setup instructions, shell commands, and package lists.

  • Licensing Goal: You want maximum adoption and reuse of your build automation script so other researchers can freely adapt and build upon your workflow.

  • Legal Reality: Build recipes and configuration scripts are plain-text source code separate from the software binaries they download at execution time. You hold copyright over the unique build instructions you write in the Dockerfile.

  • JLA Selection Strategy: To allow anyone to reuse or adapt your container recipe without restrictions, you require citation credit (Incl. Copyright) while leaving reciprocal requirements (Copyleft/Share a.) unselected.

In software-licensing.md:

Scenario 7: Distributing pre-built container images

You compiled and published a pre-built container image (e.g., pushing a compiled Docker image to Docker Hub, GitHub Container Registry, or an institutional registry) containing an OS layer, runtime binaries, dependencies, and your application code.

  • Licensing Goal: Safely distribute compiled container images without violating the license terms of any software layer or binary included inside the image.

  • Legal Reality: A compiled container image is a multi-license aggregate bundle. Distributing pre-built binaries triggers source-code distribution obligations for any copyleft software (e.g., Linux base packages, coreutils, GPL libraries) pre-installed inside the image layers.

  • JLA Selection Strategy: Because a container image combines multiple distinct software components, JLA is used to evaluate constituent component obligations. When distributing compiled binaries containing copyleft layers, source disclosure requirements (Disclose source) must be fulfilled for those specific layers.

In software-licensing.md:

Scenario 8: AI-assisted code generation

You used AI tools (e.g., GitHub Copilot, ChatGPT, Claude) to write functions, unit tests, or documentation for your research software repository.

  • Licensing Goal: Retain clear ownership and apply a permissive license (MIT or Apache-2.0) to your repository without incurring hidden copyright infringement or copyleft obligations from code embedded during model training.

  • Legal Reality: Unmodified AI-generated outputs lack human authorship and are generally not eligible for copyright protection under current EU and international legal standards. However, if an LLM reproduces a substantial copyrighted code snippet verbatim from its training data (memorization), that output snippet retains its original copyright and license obligations.

  • JLA Selection Strategy: To ensure maximum adoption and academic reuse for your overall codebase, require citation credit (Incl. Copyright) while avoiding share-alike constraints (leaving Copyleft/Share a. unselected), supported by automated compliance checks.

In software-licensing.md:

Scenario 9: Packaging AI workflows, datasets, and model weights

You are developing research software that includes source code alongside trained machine learning model weights (.pt, .safetensors) and benchmark datasets.

  • Licensing Goal: Apply a clear dual-licensing strategy that makes both the software source code and the non-code assets (data, weights) open and reusable under appropriate legal frameworks.

  • Legal Reality: Standard open-source software licenses (MIT, GPL) are written specifically for source code and are legally ill-suited for datasets or neural network parameters. Under EU legal frameworks, datasets and model weights are governed by database rights (sui generis database protection) rather than traditional code copyright.

  • JLA Selection Strategy: Use JLA to select an OSI-approved open-source license for the executable code component (Incl. Copyright selected), while using Creative Commons licenses (e.g., CC-BY-4.0 or CC0) for the dataset and weight files.

Software citation

In software-citation.md:

Discussion (Citation-1): Explain how you currently cite software

  • Do you cite software that you use? How?

  • If I wanted to cite your code/scripts, what would I need to do?

OLD Software licensing

In software-licensing-old.md:

Licensing-1: What constitutes derivative work?

This question 5 below can be used as a starting point and copied to the collaborative document or form input for an online poll:

## Question 5: Which of these are derivative works?

**Choose many**. Vote by adding an `o` character:

- A. Download some code from a website and add on to it
  - votes:

- B. Download some code and use one of the functions in your code
  - votes:

- C. Changing code you got from somewhere
  - votes:

- D. Extending code you got from somewhere
  - votes:

- E. Completely rewriting code you got from somewhere
  - votes:

- F. Rewriting code to a different programming language
  - votes:

- G. Linking to libraries (static or dynamic), plug-ins, and drivers
  - votes:

- H. Clean room design (somebody explains you the code but you have never seen it)
  - votes:

- I. You read a paper, understand algorithm, write own code
  - votes:

In software-licensing-old.md:

Licensing-2: Consider some common licensing situations

  1. What is the StackOverflow license for code you copy and paste?

  2. A journal requests that you release your software during publication. You have copied a portion of the code from another package, which you have forgotten. Can you satisfy the journal’s request?

  3. You want to fix a bug in a project someone else has released, but there is no license. What risks are there?

  4. How would you ask someone to add a license?

  5. You incorporate MIT, GPL, and BSD3 licensed code into your project. What possible licenses can you pick for your project?

  6. You do the same as above but add in another license that looks strong copyleft. What possible licenses can you use now?

  7. Do licenses apply if you don’t distribute your code? Why or why not?

  8. Which licenses are most/least attractive for companies with proprietary software?