Maintainable code/software

First steps

Meron Vermaas (m.vermaas@vu.nl)

FAIR data is “old news” ;P

But, software is not data!

  • Software is …
    • complex: code is creatively generated, interconnected and multi-layered
    • interdependent: it builds upon and therefore depends on other software
    • executable: it is not static, but can be run
    • dynamic: it can break over time, and versioning is common

Software offers its own opportunities!

  • Software is a living thing
    • Creative process allows for early adoption of good practices
    • Openness and transparency are inherent to software

Everything together is a lot!

There is some support though

                        And more (to come)

Software DevOps

To get on the red curve:

  • Version Control
  • Github
  • Code Review
  • Testing
  • Modular coding
  • Documentation

Software Management Plans

How to decide what to use:

  • Establish a structured way of developing research software and make explicit:
    • what research software does
    • who it is for
    • what the outputs are
    • who is responsible for what
    • what resources you need
    • How long should this code last?

Five recommendations for FAIR software

From fair-software.eu:

  • Use a publicly accessible repository with version control.
  • Add a license.
  • Register your code in a community registry.
  • Enable citation of the software.
  • Use a software quality checklist.

Use version control + a repository

  • Version control systems help to organize and collaborate on code.
  • Using a public repository contributes to the reproducibility, reusability and quality of your code.

How to stay in control of your versions

There is some support ;)

                       

Add a license

Creative Commons licenses

Copyleft vs Permissive

An example

Suppose you wrote a small code snippet and want to share it with the rest of your research group. While writing the code, you copied a couple of snippets from Stack Overflow. What do you have to do to not get into trouble over copyright infringement?

  • Read the Stack Overflow post: Code snippets published since 01.02.2016 are under the MIT license, but you do not have to add the MIT license. A link to the post is enough as attribution.

How to choose?

Exercise

In pairs, discuss the license(s) that may fit you best. Think about things like:

  • Collaborators (researchers, companies, …)
  • Packages you build upon, or use
  • Copyleft, copyright, permissive

Exercise

In pairs, discuss the license(s) that may fit you best. Think about things like:

  • Collaborators (researchers, companies, …)
  • Packages you build upon, or use
  • Copyleft, copyright, permissive

Check licenses of dependencies automatically or manually

Register your code in a registry

Exercise

Have a look at https://tinyurl.com/aweregistry and pick a registry for your software.

Get recognition for your software

Exercise

Bonus exercise part1

  • If needed, make a new public repository on GitHub.
    • Click on ‘uploading an existing file’, and drag and drop the contents of a folder/file to the repository.
    • Click on ‘commit changes’ to complete the upload.
  • Add a license to the project
  • Edit the changelog to reflect the addition of your license, and prepare for a new version release.
    • You can do this from inside GitHub, by clicking on the file, and then on the pen-icon to edit it. Don’t forget to click ‘Commit changes’ when you are done, to save your changes.
    • You can also edit it locally and upload the changelog to your repository.
  • Connect your GitHub page to Zenodo.
    • Log in to Zenodo’s sandbox environment
    • Why are we using a Sandbox? Hint: the Sandbox is non-permanent, and forgets its “archived” projects!
    • Click ‘log in with GitHub’ and authorize Zenodo to connect to your GitHub account.
    • On Zenodo’s main page, click on the triangle next to your name, and choose ‘GitHub’. Find the repository you just created, and enable Zenodo’s access by toggling the switch to ‘on’.

Bonus exercise part2

  • Make a release from the GitHub main page:
    • Click ‘create a new release’
    • Tag the release with the version number. Note that it is common practice to prefix the letter ‘v’ to your version number; e.g.: v0.1.0.
    • Name the release. For example, using the version tag and the date (in YYYY-MM-DD format!)
    • Use the description field to copy the changelog information. Since this is the first release on GitHub, you can copy the entire changelog into the description. Future releases can be described by the changes made between the previous release and that one.
    • Click ‘Publish release’.
  • Return to the GitHub page in your Zenodo profile. Verify that the repository is uploading. After the release is complete (this can take a while!), you should be able to click through to the sandbox page of your released project!
    • Under normal circumstances, you would get the DOI and place a badge in your GitHub README. Why should you not do this now you are working in the Zenodo sandbox?

Use a software quality checklist

  • Checklists help you write good quality software!
  • Include the checklist as part of the README

Use a software quality checklist

An example

Exercise

Discussion

  • What is the upside and downside to FAIR practices?
  • When would you go open and when closed?

Questions?