These are chat archives for got-lambda/expression

11th
Sep 2018
Magnus Therning
@magthe
Sep 11 2018 07:30
I've heard that use of "golden" in other areas too, like a "golden image" of a VM (it's an image you prepare up and then use as a base for other images or running VMs)
@Zalastax yes, I had to skip that meetup
I'm still not sure how I feel about golden testing, it was a nice way of quickly writing tests that cover existing code that lack tests (together with a coverage tool for guidance), however, I'm not as sure about using it for new code, I'd like to see/experience what it's like in that setting too.
jolod
@jolod
Sep 11 2018 09:24
@Zalastax Makes sense.
@magthe I think it depends on the context. Golden/approval tests are most useful, it seems, for things that are not feasible to write as unit tests, e.g. numerical algorithms or similar data processing.
Pierre Krafft
@Zalastax
Sep 11 2018 09:39
What golden testing does is that it pins the output of the system - it notifies when output changes. This is great when you refactor code and don't want to break old behaviour or if you're testing UIs (where you will inspect the change visually).
Unit tests can tell you more about the why than a golden test can.
Magnus Therning
@magthe
Sep 11 2018 10:29
@Zalastax I would have guessed the property-based testing is even more suitable for numerical algorithms.
Pierre Krafft
@Zalastax
Sep 11 2018 10:36
@magthe possibly, at least if you want to show commutativity, associativity etc.
If you have number processing that is based on business rules, or the like, property based tests can be impossible to write
jolod
@jolod
Sep 11 2018 15:59
@magthe Any kind of testing is hard for numerical algorithms, especially if it's floating point. A change that should have no effect could have an effect due to floating point precision. Acceptance tests (i.e. the result "looks right") is much easier.
If you want to assert properties then you frequently need to include tolerance intervals.
Magnus Therning
@magthe
Sep 11 2018 20:37
Yes, but why would you want to achieve "looks right" using golden testing as opposed to (traditional) unit testing?
Pierre Krafft
@Zalastax
Sep 11 2018 20:47
Different workflow? Unit tests for test first workflow and golden testing for test last+inspect output workflow. If you're short on time but still want to be notified if things change. They complement each other. Legacy/UI/in a big rush = prefer golden, otherwise prefer normal tests?
Magnus Therning
@magthe
Sep 11 2018 21:14
Except that "looks right" for numerical algorithms sounds like I'd have to inspect the "golden data", which is exactly the kind of activity I have my doubts about.
I agree with legacy, where I want to avoid changing behaviour, or UI, where I can determin "looks right" with a quick glance.
Pierre Krafft
@Zalastax
Sep 11 2018 21:18
Good point! Emily Bache might have a more informed opinion - I'm just speculating.
Magnus Therning
@magthe
Sep 11 2018 21:20
I'm completely unburdened by any sort of real experience or insight 😁