imo if you have 1 test per function in your codebase your codebase is turbodumb

unit tests are generally useless

@sir True, because there is no way you could have 100% coverage with a single test!

Unit tests are useless if they are done wrong. If you don't have 100% coverage in well written and tested tests, then when they pass you know nothing. So they lend no confidence. If you have 100% coverage and they pass then you know you haven't broken anything.

@Absinthe basically tests are useless because they just validate if the code is right, which can also be validated by running it and seeing if it's right

tests are useful when you're making large scale refactorings or replacing components wholesale, for validating that the behavior matches the old code at least in the tested respects

so I would postpone writing tests until such a time occurs

probably

@sir if you do TDD properly what you get in your unit tests is different than if you just write unit tests after the fact. You also get well refactored code earlier so there aren't the same needs for mass refactorings later. But there are plenty of need of TESTS besides unit tests. Functional tests, end to end tests, integration tests, regression tests. Untested code is immoral.

@Absinthe kek TDD does nothing to prevent the need for large refactorings, it just makes them harder to do

Follow

@sir if you are doing TDD correctly, you are refactoring after each passed test in the process. If your code is constantly refactored to remove unnecessary complexity, then there is little to refactor later. It is a process. Work the steps. Save the world :)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.