• toastal@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    10 months ago

    There’s nothing to test when your data structure can’t represent an invalid state. So many tests are being basic stuff like checking nil & empty lists; basic ADTs can design you out of that whole host of invalid states. Further, if your language only allows side effects at the edges of the application & data types are immutable, you are way less likely to need all these mock utils or get unexpected changes to your data.