|
|
|
|
|
by uticus
1046 days ago
|
|
> Simple code:
>
> Passes all tests
> Expresses intent
> Does not repeat itself
> Does not contain superfluous parts Good start. Of course everyone will have differences in what should be generally emphasized, I would add my PR sessions also look for sane logic and accurate modeling. In very simple terms, sane logic being: are control structures called at the right time, accurate modeling being: how well does it match ideas. |
|
In my coding life, I had a period where I was super into test driven development with mocks and I believe I was doing something very similar to what you called sane logic check. However, I later dropped this approach in favor of heavily parametrized tests where checks happen only on the output of functions and on side effects when necessary (e.g. an email is sent or a row is updated in the database).
Note: I am using this Martin Fowler's definition for "spies": https://martinfowler.com/bliki/TestDouble.html