"There are only two hard things in Computer Science: cache invalidation and naming things." (quote)
We almost completely avoid cache invalidation, because I got a long time ago an allergy to hidden/implicit state, and the "happy" debugging problems that result.
I would writing unit tests as another hard thing.
I just saw (while looking for something else) that R package statmod has glm.scoretest as a test for adding variables.
Our GLM (model not results) has a not advertised score test, no verified unit tests, AFAIR, and I'm unhappy with name and options.
I couldn't think of a good name that is not as long as
test_added_variable or test_variable_addition or
test_score_add_variable.
I think I finally settle for `test_omitted`.
score_test, lm_test or conditional_moment_test are all to generic because we can test many things not just adding an explanatory variable to the mean function.
I have no idea yet about what the API for a generic score/lm/cm test should look like.
This would essentially be a central interface for all kinds of `diagnostic` and specification tests, similar to the current standalone functions for OLS.
API feedback and suggestion would be welcome. (*)
Josef
(*) So I don't have to think for months what a good name and API would look like.