How to RAP: bringing good practice to life

This is part two of a series. Part one: ‘RAP: it’s all about the code’ covered Reproducible Analytical Pipeline (RAP) definitions and coding standards.
The technology we use and how we communicate affect how well we can implement Reproducible Analytical Pipelines (RAP). We’ve established RAP ways of working to promote industry best practices for working together effectively and sharing our work. This blog explores how we can put these into action and how they can help your team.
What we mean by ways of working
The ways of working in the Reproducible Analytical Pipeline Minimum Standard (RAP MVP) aim to support the technical side of RAP and embedding quality throughout, while taking into account the public sector context we work in.
Ways of working describe things like the technology we use and how we communicate. Discussing and defining your teams’ ways of working removes ambiguity, helping to work in a way that is consistent and effective.
Setting expectations and assumptions early is useful. Small things like how you will review, communicate, and deal with blockers is useful to establish early, constantly building and agreeing on practices as you learn more about the project and each other.
Let’s look at three ways of working that support RAP development and implementation.
Real-time code sharing: an alternative to code_final_v2actual.py
Many of us will have worked on that ‘final final’ version of a document with tracked changes galore. But when it comes to working with code, there’s a better way. Git is the industry standard of version control software, often paired with GitHub or GitLab. Compared to something like storing code on Sharepoint, Git allows us to see who made what changes, when they were made, and crucially why, thanks to ‘commit messages’.
Git facilitates coding together by allowing multiple people to make changes on the same codebase using distinct ‘branches’. These can be merged together into the final product, and Git helps us reconcile conflicting changes along the way. This results in a reliable audit trail, which also serves to make it simple to ‘roll back’ in the case of mistakes.
Using Gitlab or GitHub to host your code allows for a number of other bonuses, with a big one that’s particularly important for RAP…
‘What does that do?’ – the power of peer review
Peer review involves someone else running our code, which is vital for reproducibility. Having assurance others can run code minimises single points of failure and other risks to delivery.
Depending on the type of changes being made, peer review can take only a few minutes. Having someone else run your code is great for picking up things like missing dependencies, which could cause code to break for others. A second pair of eyes is also helpful for more minor things too, like suggesting helpful names for functions.
If you’re already using GitLab or GitHub, peer review can be introduced easily during the pull or merge request process. You can even go a step further by using templates to easily communicate the standards of your code.
If more formal peer review sounds daunting, why not get started with pair programming? This is where someone tackles a coding problem with input from another person, and can even be fun! Code review and pair programming are fantastic ways to boost code quality, share knowledge, and build skills within a team.
Show your work to the world
… except when you shouldn’t! You may hear the phrase ‘open source’, which means to make code public. Although this is not always appropriate due to sensitivity, security, or disclosure concerns, this can be a great way of building trust with stakeholders.
Gitlab and GitHub enable us to make use of ‘Issues’, which alongside a public code base readily show code users the advantages and limitations of our code. This fosters a culture of transparency. Sharing our code also means we can invite collaboration on fixing code problems. Finally, making our code public also allows others to use it. This helps us deliver more value from what we do by saving others time!
Keep developing RAP
All these ways of working help implement the Code of Practice for Statistics pillars of Trustworthiness, Quality, and Value, and help us work better together as we develop Reproducible Analytical Pipelines.
Thanks for reading! If you’d like to know more about RAP, reach out to your department’s RAP Champion.
Why not join the RAP Champions Network? If you’re experienced with RAP, join us as a champion, and if you’re new to RAP, get involved as a practitioner to build your skills and knowledge.