TuringLang / TuringLang/DynamicPPL.jl

Make tests less specific to a particular model

Open
#1,174 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
286
Forks
41
Avg merge
1d 11h
Merged PRs (30d)
34

Description

#1173 improves our test coverage by changing a lot of tests that used only the models that implement

    s ~ InverseGamma(2, 3)
    m ~ Normal(0, √s)
    1.5 ~ Normal(m, √s)
    2.0 ~ Normal(m, √s)

in various ways, to use a more general collection of models. However, many other tests remain that still have a hard-coded assumption that we are using that particular set of DEMO_MODELS. For instance, some tests assume that there is a variable called x and that it's an observation, or that there is at least one observe statement in a model. We should clean these up and make them all fully generic, making full use of the (excellent) setup in TestUtils.Models with logprior_true and varnames and other such functions used to implement the ground truth of what we expect from any given model.

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.

Research direction

Start by reviewing the changes in #1173 and the test setup in TestUtils.Models, especially logprior_true and varnames. Find remaining tests that assume DEMO_MODELS, a variable named x, or an observation, and generalize them against the model metadata. Done means the tests no longer depend on that particular model collection and the full test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.