Skip to content

Generic testing via mixins across transforms

No due date 95% complete

Summary:

Refactoring tests to a new format where inherited behaviour is tested in inheritable tests to avoid implementation testing or duplication of identical tests across many test modules.

Detail:

This milestone details the steps required to refactor the testing in the tubular package so that we test behaviour, not implementation (see #155).

We have cr…

Summary:

Refactoring tests to a new format where inherited behaviour is tested in inheritable tests to avoid implementation testing or duplication of identical tests across many test modules.

Detail:

This milestone details the steps required to refactor the testing in the tubular package so that we test behaviour, not implementation (see #155).

We have created a tree of inheritable test classes. Between them these test classes contain tests for the full suite of behaviours that will be inherited when you inherit from the transformer in question, allowing these behaviours to be tested explicitly, rather than implicitly through implementation tests such as test_super_transform_called.

Refactoring a test file to bring it into the new framework mainly consists of selecting the correct classes to inherit from when writing the unit tests. The inherited tests will all run automatically and test for the inherited behaviours, thus the only tests that need to explicitly be written into the test file are the tests specific to that transformer (e.g. expected output tests).

When working through this checklist it is important to check that test classes have been written for the relevant inherited transformers before beginning the refactor of a child transformer, for example make sure that CappingTransformer has been done before it's child class OutOfRangeNullTransformer.

This work looks at every transformer and so provides a good opportunity to audit Tubular! If you see anything you think could be improve, or spot any redundancy or duplicity in the package, please raise an issue.

This milestone has replaced #150 and #151 as means of tracking work.

Loading