3 ms·
Michael Feathers in "working with legacy code" tackled the unit test definition, and in the end defined a unit test as a test that runs fast. Also a very confu
by locallost 3y ago
Michael Feathers in "working with legacy code" tackled the unit test definition, and in the end defined a unit test as a test that runs fast.
Also a very confusing topic for me early on as I tried to grasp how to actually do it. So I read Kent Beck's book on TDD and was even more confused because he did not write tests in isolation there, and I was told to write unit tests like that. But then it hit me: most people are just cargo cultists and repeat what somebody told them.
- malkia 3y agoOne of the best things in bazel is that it's very straightforward when comes to tests - https://bazel.build/reference/test-encyclopedia#role-test-runner https://bazel.build/reference/test-encyclopedia#role-test-ru... - you need to classify your test as short, moderate, long, etc., but also how much memory it takes. In addition if you tests requires isolation, put it too. So potentionally one can combine multiple independent code bases, that share the same testing framework (say gtest), into single executable, and distributevly execute them using sharding on multiple machines (e.g. depending on what changes were detected in the presbumit/preflight/whatever you call phase). And because the tests were marked as such and such, it'll use that knowledge to group them better, and if they no longer qualify, an error would be printed out, and how to fix this (if it's worth fixing).