nasa / nasa/CF

Remove unit test context_t elements as overkill for a coverage test

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unit-test
Dominant language
C
Stars
120
Forks
77
Avg merge
7d 18h
Merged PRs (30d)
3

Description

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I reviewed the CF README.md file to see if the feature is in the major future work.
  • I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.
There's a significant amount of unit test logic dedicated to confirming argument inputs to stub functions that go above and beyond the requirements of a coverage test. This logic is associated with defining and saving *_context_t structures from within stubs. While there is technically nothing wrong with these tests (they all pass), the issue is with technical debt. Unless the test is verifying requirements/spec/algorithm document there's also the question of what is truth.

Describe the solution you'd like
Use functional tests to verify function. Remove context checks that don't add value in the coverage test context.

Describe alternatives you've considered
Leave as is, but whenever maintenance is performed encourage simplification. At minimum we should avoid this pattern in new or updated tests.

Additional context
Along the same lines as removing the randomness, these aren't intended to be fuzz tests.

  • #86

Requester Info
Jacob Hageman - NASA/GSFC

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

No specific files or tests are named. Locate the unit-test stubs that define and save *_context_t structures, then identify checks that only validate stub arguments rather than functional behavior. Done means unnecessary context checks are removed while the coverage tests still pass and retain their intended coverage.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.