Contribute to Giskard

How to add your custom ML tests to Giskard's open-source project

Push your tests in the Giskard repo

  • Clone the Giskard repository
  • Create a GitHub branch with the base as main, starting with test-contribution/name-of-your-branch
  • From the root of the cloned repo run ./gradlew generateProto. This will generate the modulegenerated that you will need to create your tests.
  • Write your test inside one of the classes (MetamorphicTests, HeuristicTests, PerformanceTests or DriftTests) inside this repo. If your test does not fit these classes, you can also create a custom class in a new file.
  • We recommend writing unit tests for your test functions: this is the way you can execute and debug your test! Unit tests should be placed in this directory.
A unit test is executed with a test model and test data provided as fixtures.
For example, in test_precision function, we use german_credit_data and german_credit_model as fixtures. If necessary, you can create your own fixtures; check this directory to know how.
  • To use this test on Giskard UI, we recommend you write the same code in the Giskard UI following these steps in our doc.
Even if your test works, it won’t appear in Giskard's frontend, unless you re-create it as a custom test in Giskard UI.
  • Create a Pull Request
Let us guide you with an example where you want to create a heuristic test function: