11 ms·
> Without tests, there’s a very strong possibility that your change will have broken some other, potentially unrelated feature. [...] > This is why I start ev
by beachy 4y ago
> Without tests, there’s a very strong possibility that your change will have broken some other, potentially unrelated feature.
[...]
> This is why I start every single one of my projects with a passing test. It doesn’t matter what this test is—assert 1 + 1 == 2 is fine!
These two statements do not add up.
- lostcolony 4y agobadum-tsh That said, I think he just means "do the work to get tests in place, and build the habit of running them as part of your development cycle", even if, when starting, what you're running isn't helpful. The idea being that building "write a test" "run the tests" into your iterative loop, from the beginning, is a worthwhile practice.
- BlargMcLarg 4y agoIt's half work until those tests actually test something of value. We all know what happens with half-work in the long run, and it certainly isn't 'they build habits towards full work'. That's before considering even if the tests do test something, most code tests written are easily improved upon garbage.
- simonw 4y agoThey add up if you consider the text in between them: "Adding a new test to a project with a lot of existing tests is easy" My point here is about ensuring you have a test suite from the very first commit to a repo, so you have an obvious place to add tests to in further commits.
- rendall 4y agoIf one is working in a team, and the team does code review before committing to master, then tests can be part of the code review. The most stable code bases I have ever worked with come with teams who will reject a pull request with inadequate tests.