Hacker News new | ask | show | jobs
by manlobster 920 days ago
Test code doesn't have tests of its own, so we must rely on inspection to establish that it is correct. This means that test code must be extremely readable.

It would make me uncomfortable to rely on tests like some of the examples in this talk, that have such a degree of complexity without explicit tests. Code such as to parse a text file should be in its own package. The package should expose an extremely readable API, and it should have its own suite of tests.

Similarly, writing formatting code for error messages and diffs inline makes the tests less readable and therefore less reliable. The golang standard library should include testing helpers such as in `testify`, which would allow tests to be concise, less buggy, and extremely readable.