Skip to content

Proposal: how we could describe an individual test case#4

Open
kkmann wants to merge 1 commit into
mainfrom
a-test-case-description
Open

Proposal: how we could describe an individual test case#4
kkmann wants to merge 1 commit into
mainfrom
a-test-case-description

Conversation

@kkmann

@kkmann kkmann commented Jul 7, 2023

Copy link
Copy Markdown
Owner

This PR explores how we could describe an individual test case. The idea would be to then aggregate multiple such tests to assess a function / package and build human-readable documentation.

Besides test cases, we could also define formats for sharing bugs or discrepancies from other implementaitons -> different topic though.

Would be cool to see whether we can run these atomic test cases in GH actions.

Comment thread tests/testCase1.json
"uuid": "4fa03a8d-2e39-4866-9cd3-69b77bd78a6b",
"testName": "t test produces calibrated p values",
"keywords": ["t-test", "p value", "statistics"],
"description": "This test checks that the p values produced by stats::t.test do not deviate substantially from the expected uniform distribution.",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should render to markdown

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GAMP and CSA suggest a Test Objective, which ist linked to N Test cases.

Comment thread tests/testCase1.json
"keywords": ["t-test", "p value", "statistics"],
"description": "This test checks that the p values produced by stats::t.test do not deviate substantially from the expected uniform distribution.",
"references:" "",
"code": "set.seed(42)\nm <- 100\nfor (n in c(5, 50, 500)) {\n# repeatedly sample data under null and record p value\nres <- numeric(m)\nfor (i in 1:m) {\nres[i] <- t.test(rnorm(n))$p.value\n}\n# expect non significant result\nexpect_true(\nks.test(res, 'punif')$p.value > 0.05\n)\n}",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be executable as markdown r chunk

Comment thread tests/testCase1.json
"references:" "",
"code": "set.seed(42)\nm <- 100\nfor (n in c(5, 50, 500)) {\n# repeatedly sample data under null and record p value\nres <- numeric(m)\nfor (i in 1:m) {\nres[i] <- t.test(rnorm(n))$p.value\n}\n# expect non significant result\nexpect_true(\nks.test(res, 'punif')$p.value > 0.05\n)\n}",
"output": "",
"environment": {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify a reference environment to run the test in

@borgmaan

Copy link
Copy Markdown
Collaborator

@kkmann - thanks for proposing! I really like how this is coming together.

One topic that kept coming up in the various stakeholder interviews was the desire to have a formal requirement/use case/spec that the test is addressing. I think it is worth discussing the addition of a (potentially optional) requirement field to the test specification.

Comment thread tests/testCase1.json
"testName": "t test produces calibrated p values",
"keywords": ["t-test", "p value", "statistics"],
"description": "This test checks that the p values produced by stats::t.test do not deviate substantially from the expected uniform distribution.",
"references:" "",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"references:" "",
"references": "",

@Stefan-Doering-BI

Copy link
Copy Markdown

In General, we should consider to standardize to the CSA guidance. Maybe the structure for "Assurance Activity
Scripted Testing: Robust" would maybe fit what we intend to so here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants