Consolidate repeated unit test setup code into helper functions

Aperta
#87 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

L'issue non indica file o test specifici. Inizia individuando le suite di unit test di CF e facendo un inventario della configurazione ripetuta delle precondizioni per le PDU di input e output; conferma le sequenze comuni e i relativi chiamanti prima di scegliere i confini degli helper. Il lavoro è completato quando la configurazione ripetuta è centralizzata e gli unit test continuano a passare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

unit-test

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.

Lingua principale
C
Stelle
122
Fork
79
Merge medio
1g 15h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nasa/CF

Tutte le issue di nasa/CF

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.