Skip to content

Testing

Michaela Lawrence edited this page Oct 23, 2025 · 13 revisions

Testing involves ensuring that requirements have been fully met by using appropriate tools and techniques to verify that a product or service works. The GDD skills framework for data engineers officially only goes up to the working level however testing is very important in the ONS so we go up to practitioner level here.

Awareness: correctly execute test scripts under supervision. Understand the role of testing and how it works.

Working: review requirements and specifications, and define test conditions. Identify issues and risks associated with work. Analyse and report test activities and results.

Practitioner: manage the planning of system and acceptance tests, co-ordinating both functional and non-functional specifications provide authoritative advice and guidance on test planning. Identify process improvements and contribute to the definition of best practice.

The table below shows which skill level each grade should be working at within three to six months of starting a new role.

Grade Associate Data Engineer (EO) Data Engineer (HEO) Senior Data Engineer (SEO) Head of Data Engineering (G7) Lead Data Engineer (G6)
Skill level TBD Awareness Working Working Working

General resources

PyTest is probably more commonly used in the ONS than the inbuilt unittest module or Robot. They have plenty of how to guides and information on their website.

Writing good unit tests in Python with Ease - starts with “why test”, then goes into details.

Test driven development (TDD) could probably be considered a practitioner or expert level topic however the concepts of TDD can be beneficial to even beginner testers. There are lots of resources out there for TDD IBM and Test Driven Data Analysis (TDDA) are a couple of options. We don't encourage the use of the TDDA library necessarily but the blog itself is very useful for understanding TDD concepts from a data perspective as opposed to a software perspective.

Awareness

There are many different ways to classify tests. Unit tests are probably the best place to start but after that there are multiple directions you could go in. Here is a blog posts that describes different types of testing in Python. Beginners may also find some of the earlier blog posts in this series to be useful. At awareness level you should be able to run tests and possibly recognise different kinds of tests but not necessarily know how to write your own from scratch.

Working

CS50P has been mentioned elsewhere in this learning roadmap. See CS50P: Week 5 Unit Tests for an overview of error handling and PyTest.

YouTube: How to Write Unit Tests in Python

Learning Hub: Introduction to Unit Testing

Real Python: Getting started with testing in Python (PyTest).

You can categorise unit tests in different ways. One way is positive vs negative testing.

Getting the right information when Pytest runs

Useful PyTest command line options

Coverage reports with pytest-cov

Practitioner

Article: Five Advanced PyTest Fixture Patterns

Ed's helpful demo of PyTest Examples is especially useful if you are interested in parameterised testing.

Book: Obey the testing goat - this is a slightly outdated implementation of building a simple, fully tested website with Python but the concepts are solid.

Book: Cosmic python - this is the sequel to obey the testing goat and has some really useful concepts in it about the repository pattern and other things that aid testability - it's become my favourite python book!

Video: Stop using mocks (for a while) Pycon talk by the author of obey testing goat and cosmic python about one of the best concepts from the book

Video: Stop mocking start testing - Talk by some google engineers about mocks and testing

Clone this wiki locally