Tax-Calculator icon indicating copy to clipboard operation
Tax-Calculator copied to clipboard

Unit testing of calcfunctions.py

Open jdebacker opened this issue 5 years ago • 4 comments

While is full code coverage for tests of calcfunctions.py, the unit tests essentially only confirm that all function arguments are passed properly and that those passed are used. There ought to be tests that validate the logic of each function (i.e., that given certain values for inputs, the expected output values are produced).

jdebacker avatar Jun 17 '20 18:06 jdebacker

cc @MattHJensen This might be a good beginner issue to work on (at least for most of the functions in calcfunctions.py).

jdebacker avatar Jun 17 '20 19:06 jdebacker

Evidence in favor: https://github.com/PSLmodels/Tax-Calculator/issues/2551

MattHJensen avatar Feb 11 '21 22:02 MattHJensen

Checklist of functions in calcfunctions.py module that have unit tests written specifically for them (or in progress through open PRs) in test_calcfunctions.py:

  • [ ] BenefitPrograms
  • [ ] EI_PayrollTax
  • [x] DependentCare
  • [ ] Adj
  • [ ] ALD_InvInc_ec_base
  • [ ] CapGains
  • [ ] SSBenefits
  • [ ] UBI
  • [ ] AGI
  • [ ] ItemDedCap
  • [ ] ItemDed
  • [ ] AdditionalMedicareTax
  • [x] StdDed
  • [x] TaxInc
  • [ ] SchXYZ
  • [ ] SchXYZTax
  • [ ] GainsTax
  • [ ] AGIsurtax
  • [ ] AMT
  • [ ] NetInvIncTax
  • [ ] F2441
  • [ ] EITCamount
  • [ ] EITC
  • [ ] RefundablePayrollTaxCredit
  • [ ] ChildDepTaxCredit
  • [x] PersonalTaxCredit
  • [ ] AmOppCreditParts
  • [ ] SchR
  • [ ] EducationTaxCredit
  • [ ] CharityCredit
  • [ ] NonrefundableCredits
  • [ ] AdditionalCTC
  • [ ] C1040
  • [ ] CTC_new
  • [ ] IITAX
  • [ ] Taxes
  • [ ] ComputeBenefit
  • [ ] BenefitSurtax
  • [ ] BenefitLimitation
  • [x] FairShareTax
  • [x] LumpSumTax
  • [x] ExpandIncome
  • [x] AfterTaxIncome

jdebacker avatar Sep 27 '21 20:09 jdebacker

Writing unit test for a single one of these functions is a good place to start to learn more about Tax-Calculator. You can deal with the a single function without having to know the full model.

These are ideal issues for someone with good knowledge of the tax code (or an interest in learning more about it) and moderate experience with Python (and a willingness to learn more).

jdebacker avatar Sep 27 '21 20:09 jdebacker