Remix.run Logo
27183 an hour ago

> You can prove the test covers the bug without understanding the test code (you need to understand the bug, of course).

I'm not following.. When we write regression tests those tests encode invariants we expect to be maintained under source code transformations over time. If I don't understand the test code I've written, how can I know which invariants I've imposed? That's why, broadly speaking, we write test code to be as simple as possible above all else--it's absolutely imperative that these invariants are not only intentional and easy to reason about, but also that when an invariant is violated we can easily discover why. Often, on a team, the person encountering a test failure after making a code change is not the person who originally established the invariant, so it's very important they be able to easily understand it.

I see no possible world in which failing to understand the test code is... possible? Like, if you have indecipherable test code things are really bad in your codebase. Fixing that is P0, because it'll compound rapidly.

11 minutes ago | parent | next [-]
[deleted]
jeremyjh 12 minutes ago | parent | prev [-]

You can know the test is likely good, if it reproduces the failure you are fixing. I don't think we're communicating though because I never said the test code was undecipherable.