4 ms·
The original argument for unit tests was on semantic units (do a thing) and not code units (a function). The interface could be a class or a set of functions, b
by Izkata 3y ago
The original argument for unit tests was on semantic units (do a thing) and not code units (a function). The interface could be a class or a set of functions, but the idea was in part not to break it down further than needed or combine separate requirements into one tests.
I think code units / syntactic units became popular as a simplification of the original idea, people copying the style from examples and seeing it as a solution to their problems without actually understanding what the example was describing. Then it gets repeated over and over as "test individual functions" until the original idea is lost and most people haven't even heard of it.
Nowadays the original idea is partially described by black box testing.
- pydry 3y agoIn which case my playwright tests that hit a local database and send an email to a local SMTP gateway are unit tests.