Fork me on GitHub
#testing
<
2019-02-08
>
ljosa17:02:31

Example of where this sort of testing is useful for me. What does your nose say?

seancorfield17:02:02

You have one function that is doing too much.

seancorfield17:02:15

Test each individual function. Then test the orchestration function end-to-end as a black box instead of testing that makes specific calls to implementation functions.

ljosa18:02:01

So I am testing the individual functions that I have stubbed out here (`extract-userintent-from-s3`, etc.) elsewhere. This is an attempt to test the orchestration function extract-transform-and-load-xxx.

seancorfield18:02:39

Like I say, test end-to-end or don't bother testing. The orchestration function should be so simple it's "correct by inspection" and, if not, refactor it to be so.

seancorfield18:02:24

If writing tests for something is painful, then either the code is too complex or the test is not worth doing.

seancorfield18:02:00

You're also introducing a lot of coupling in your tests which will make them brittle.