• DfE Good Code Practice
  • 1 Introduction
    • 1.1 Who is this guide for?
    • 1.2 Writing code for QA
    • 1.3 Our approach to writing and updating this guidance
  • 2 The fundamentals of writing good code
    • 2.1 Why writing good code is so important
  • 3 Fundamentals: How to write good code
  • 4 Fundamentals: What good code looks like
    • 4.1 A clear and informative Header
    • 4.2 Consistent use of indentation
    • 4.3 Descriptive use of variable names
    • 4.4 Descriptive and informative comments
    • 4.5 A clear flow and structure
    • 4.6 Consistent spacing
    • 4.7 If required, the use of functions or subroutines
  • 5 Advanced: Optimising code structure
  • 6 Advanced: Testing code
    • 6.1 In-script testing
    • 6.2 Formalised testing
      • 6.2.1 Software testing
      • 6.2.2 Unit testing
      • 6.2.3 testthat
      • 6.2.4 pytest
      • 6.2.5 Testing Shiny apps
      • 6.2.6 Test driven development
  • 7 Advanced: Version control
  • 8 Advanced: Documentation
    • 8.1 Comments
    • 8.2 Rmarkdown file
    • 8.3 Packaging your analysis
    • 8.4 A word on package version and dependency
  • 9 Links
    • 9.1 Internal DfE and Other Government Department resources
    • 9.2 Testing
    • 9.3 Style Guides
    • 9.4 R
  • Published with bookdown

DfE Good Code Practice

Chapter 9 Links

This page collates all of the links mentioned throughout this document, plus some additional reading and resources.

9.1 Internal DfE and Other Government Department resources

  • DfE QA page
    • The main sharepoint pages for QA in DfE - containing various templates and documentation to assist with quality assurance.
  • DfE QA framework
    • The framework sets consistent standards of quality assurance across all anaytical work.
  • Git and DevOps Guide
    • A guide to assist with version control using Git and DevOps.
  • Analytics Academy - R training course
    • A course created by analysts at DfE to help you learn and master R skills. Bitesized videos, lessons and missions.
  • DfE Coffee and Coding
    • DfE seminars focusing on coding tools and techniques. See recordings/materials from previous seminars, and find out about upcoming seminars.
  • R in ESFA
    • An introduction to common tasks and problems in R, aimed at those new to R and RStudio.
  • Data Engineering Division T-SQL coding standards
    • Guidance on how to utilise best practice in all development products for SQL Server, and industry standards that must be adhered to.
  • Statistics Production Guidance
    • Guide aimed at anyone producing or publishing official statistics, particularly for those using Explore Education Statistics (EES).
  • DfE Data Warehouse Wiki - FE
    • The Data Warehouse is used to publish official statistics, and is currently the single data store for Individualised Learner Record data.
  • ONS QA of code
    • Guidance for those using coding languages produced by the Office for National Statistics.

9.2 Testing

  • Automated testing with testthat
    • A blog post about using the testthat package to perform different types of testing
  • TestThat blog
    • A blog post about using the testthat package to perform unit testing
  • Hadley Wickham - Testing
    • Hadley Wickham (the author of the testthat package) discusses how to structure and write tests.
  • Functional programming and unit testing
    • More information on unit testing within R
  • Unit testing in R
    • Using tidylog, testthat and assertr to perform unit testing
  • Pytest
    • Testing in python using pytest
  • Shiny testing
    • Testing Shiny apps using Shinytest
  • Shiny - Scaling testing
    • Documentation on using testthat to test Shiny apps
  • Shinytest
    • Documentation on the Shinytest package, which records a script of actions and takes snapshots of Shiny apps to assist with testing/debugging.

9.3 Style Guides

  • R Style guide
    • A guide to best practice for writing code in R
  • Google Python Style Guide
    • A guide to best practice for writing code in Python
  • Kickstarter SQL guide
    • A guide to best practice for writing code in SQL
  • VBA Style Guide
    • A guide to best practice for writing code in VBA

9.4 R

  • Rapid R Data Viz
    • Quick and easy intro to data visualisation in R.
  • Packaging R
    • Documentation on how to write and use packages in R.
  • Renv
    • Documentation on the renv package - this helps to manage library paths and isolate R dependencies to ensure that existing tools work as they did before regardless of updates.