3 ms·
Types are there to ensure against human error and reduce the amount of code we need to write. Tests exist to guarantee functionality and increase productivity
by bubblebeard 2y ago
Types are there to ensure against human error and reduce the amount of code we need to write.
Tests exist to guarantee functionality and increase productivity (by ensuring intended functionality remains as we refactor/change our code/UI).
There may be cases where some tests are too expensive to write, but I have never come across this myself. For example, in functional tests you would attempt to find a secure way to distinguish elements regardless of future changes to that UI. If your UI changes so much between iterations that this is impossible it sounds like you need to consider the layout a little more before building anything. I’m saying that based on experience, having been involved in several projects where this was a problem.
Having said that, I’m myself horrible at writing tests for UI, an area I’m trying to improve myself, it really bothers me :)
- whstl 2y agoTests can be expensive to write if they are an afterthought, and/or the code is not written in way that is easy to test. UI tests can be cheap but they require some experience in knowing how to write a testable UI. One way of achieving that is writing them as early as possible, of course. Which is not always possible :/
- protomolecule 2y ago> the code is not written in way that is easy to test Which isn't devoid of downsides either
- whstl 2y agoThat's a good point. Sometimes more ergonomic APIs can be harder to test.