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

Follow

@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

@sir I disagree with that statement as well. But you are certainly entitled to that opinion.

@Absinthe fact: human beings can test code, too. Counterpoint: human beings are falliable. Counter-counterpoint: guess who wrote the automated tests you dip, human ass beings

@sir making human beings do mindless repetitive tasks is immoral and akin to cruel and unusual punishment. A computer can do that better. There are testings that are suited to humans, let them do that, because computers are not quite up to that task. Right tool for the job. Sometimes that tool is a human.

@Absinthe it's neither mindless nor repetitive, it's something you have to do before you commit your code. Are you saying that you never actually RUN the code that you wrote, but trust that it Just Werks so long as the little green light in your IDE (a tool that I'm 95% confident you use) is lit up?

And drop the moral bullshit, kid

@sir so all you do is first line testing? I ran it, it worked. Let's ship it! :) Been there, done that.

No, I am not concerned with little green lights.

You and I have a problem of vernacular. When you say TDD and when I say TDD we are not talking about the same thing.

Like I said in the beginning, I am not interested in changing your mind or having an argument about it.

@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.