• kaba0@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I believe we should have a new word that differentiates between ultra-basic tiny unit tests, and bigger unit tests that are still not integration tests.

    E.g. rust and some other newer languages have a way to write basically an inline test for a function — that would constitute my former category. These make sense during development as a reality check. “Yes, this ad hoc stack I need inside this class should have two elements if I push two elems” sort of thing. That implementation may not even be accessible from the outside in case of an OOP language so you can’t even properly test it. Also, these are the ones that should change with the code and removing them is no big deal.

    The other kind should work against the public APIs of libs/classes and they should not be rewritten on internal changes at all.