Hacker News new | ask | show | jobs
by ipsento606 101 days ago
I've been working on react and react native applications professionally for over ten years, and I have never worked on a project with any kind of meaningful test coverage
5 comments

I have not seen tests in any code base I worked on in the past 20 years. I have noticed that there is some kind of sanctimonious demeanor to quite a few people that advocate for tests (on comment boards). I find the reactions to discussions on tests fascinating because it seems to elicit very strong opinions, sort of a "do you put your shopping cart back" kind of topic, but for programmers.
I find that fascinating, because interacting with the tests in our codebase (both Python and JS) answers a _lot_ about "how is this meant to work", or "why do we have this". I won't say I do test-driven development, at least not very rigorously, but any time I am trying to make a small change in a thing I'm not 100% familiar with, it's been helpful to have tests that cover those edge cases. :)
People who advocate “writing tests” never admit any of the costs and difficulties of automated output checking.

As you change your codebase you will experience lots of “failures” that are not failures. You still have to burn your time investigating them.

Many checks will require elaborate mocking or other kinds of setup, that give lie to the claim that designing them is simple and straightforward.

I've checked the stats, the previous app I've worked on has 31% reported coverage and I think the actual value is higher, with coverage of most of the critical paths. But it's been a lot of work and the engineering hierarchy is supportive in adding time to manage the existing tests and test the new features.
over 20 years, many stacks, and same
> I have never worked on a project with any kind of meaningful test coverage

That says more about you and the care you put into quality assurance than anything else, really.

Have you ever worked at a place where you were put on an existing codebase, and that code has no tests? Have you ever worked at a place where, when you try to fix that, management tells you that they don't have the time to do so, they have to crank out new features?

Is ipsento606 working at such a place? I don't know, and neither do you. Why do you jump to the conclusion that it's their personal failing?

> Have you ever worked at a place where you were put on an existing codebase, and that code has no tests?

Yes.

Then I added tests. Now the codebase has tests.

Funny how that works.

> Have you ever worked at a place where, when you try to fix that, management tells you that they don't have the time to do so, they have to crank out new features?

Yes.

I then added tests that covered my features. Now the project has tests.

Funny how that works.

Presumably you mean me, and every current and former team-member I've ever had? If so, you're talking about hundreds of engineers.
> Presumably you mean me, and every current and former team-member I've ever had?

Yes, I mean you.

You don't need hundreds of engineers to have a test suite with meaningful coverage. You need yourself and willingness to do the job.

Just adding happy path tests can get you significant coverage. Why did you failed to do this?

Blaming others for the problems you created and help create is not helpful. You can post PRs, can't you?