PolicyEngine / PolicyEngine/policyengine-api

Create raft of tests for structural reforms

Open
#1,885 1 comment 1 reaction 1 assignee View on GitHub

@tawandamoyo is already working on this.

Since Nov 6, 2024.

Dominant language
Python
Stars
18
Forks
33
Avg merge
23h 40m
Merged PRs (30d)
22

Description

There would be a lot of value to adding a series of tests around creating structural reforms with the following:

  • A reform using a neutralize_variable value on an existing piece of the default tax-benefit system
  • A reform using an update_variable value on an existing piece of the default tax-benefit system
  • A reform using an update_variable value to create a totally new variable in the system

All of these should be run in the following four-step manner:

  • For a relevant test household, baseline, no axes
  • Test household, reform, no axes
  • Test household, baseline, axes
  • Test household, reform, axes

This mimics the series of calls that occurs if a user inputs a reform, inputs a household, views their net income output, then clicks "Varying your earnings".

Each output should confirm that:

  • household_net_income is a valid value
  • Each of the default outputs is a valid value (we could even drill down the tree using metadata to ensure every possible display value is valid, depending on how long that makes the test time-wise)
  • Some variable added or altered by the structural reform is present and valid

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.