Consolidate repeated unit test setup code into helper functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c
- Domain
- embedded-iot, testing
Research direction
The issue does not name specific files or tests. Start by locating the CF unit-test suites and inventory repeated precondition setup for input and output PDUs; confirm the common sequences and their callers before choosing helper boundaries. Done means the repeated setup is centralized and the unit tests still pass.
Written by the indexing model from the issue text.
Description
In the CF unit tests, the "preconditions" for each test case are often very similar, but instead of being set up through some sort of helper function, the code is cut-and-pasted. As a result, code to set up for particular preconditions may be repeated dozens of times in the unit test.
This incurs a significant maintenance cost when the FSW data structures need to change in any way (and they will, the FSW is not set in stone and will need to be maintained). A small change to FSW can affect many different unit test cases. This wouldn't be a big problem if the setup was in some sort of helper function, but since it is repeated, each affected case must be individually found and fixed. As a result, the time cost of maintaining the unit test is extremely high.
To reduce this cost, common sequences of setup (such as setting up for an input PDU, an output PDU, etc) should be consolidated into a helper function, so only this function needs to change if the internal FSW structures change.
- Dominant language
- C
- Stars
- 123
- Forks
- 82
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nasa/CF
-
CF_CFDP_S_SendFileData computes the file checksum from the SB buffer after CFE_SB_TransmitBufferOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Assert checks non-existent variable (`pt`) in `CF_CFDP_ProcessPlaybackDirectory()`May be free again A pull request for this issue was closed without being merged. Openinvalid
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
389ds/389-ds-base#8251 ·
Maintainers usually reply within 1 day
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ROCm/hrx-system#3628 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
OpenPrinting/cups#1844 ·
Maintainers usually reply within 1 day