EnergySystemsModellingLab / EnergySystemsModellingLab/MUSE_OS

Explore the use of hypothesis in unit tests

Offen
#465 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Python
Sterne
29
Forks
12
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

[Hypothesis](https://hypothesis.readthedocs.io/en/latest/) is a testing library that evaluates functions under a range of conditions and evaluates the properties of the result, rather than testing functions with a single input and asserting the numerical value of the result (as is currently done in many places). It can be particularly useful for finding edge cases, which (as we are all well aware), MUSE is currently not very well set up to deal with.

The costs module seems like a good place to start (see [this comment](https://github.com/EnergySystemsModellingLab/MUSE_OS/pull/462#pullrequestreview-2262280761)), but there are probably other places that would benefit. Part of tackling this issue would involve going through the tests to see which areas could benefit from more robust unit tests.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, die bestehenden Unit-Tests im costs-Modul und die in PR #462 verlinkte Diskussion zu prüfen. Untersuche anschließend andere Tests auf Fälle, die von einer auf Hypothesis basierenden Abdeckung profitieren könnten; als erledigt gilt, geeignete Bereiche zu identifizieren und den Ansatz dort anzuwenden, wo er das Testen von Randfällen verbessert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
testing
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.