Why Does the Company Keep Telling Me to Cut Down on Test Code?

I'm a junior developer. I've been trying hard to raise test coverage, but in code review I got told that forcing 100% coverage is excessive. They also say it hurts productivity.

I write tests out of habit because things broke a few times when I fixed code without them. I'm curious how senior developers decide what tests to write.

by 코딩하는곰695

9 answers

Agreed, 100% test coverage is unrealistic.

by 카페인중독17 · ▲0

I heard the same thing when I was a junior. These days I only write comments for the important logic, and it seems like there are actually fewer bugs.

by 월급루팡78 · ▲0

Well, what company forces 100% coverage? Isn't the article exaggerated? In reality, it might have been a point about missing important tests.

by 주말개발자776 · ▲0

Source?

by 호기심천국378 · ▲0

The criterion is 'if this code breaks, does it cause an incident?' There's no need to write tests for presentation logic or simple getters. Instead, be sure to write tests for core domain logic.

by 주말개발자63 · ▲0

If you have 100% coverage, ironically you can't refactor because of the test code lol

by 취준생김씨343 · ▲0

It varies by company, but coverage is usually just a metric. When they say to cut down on tests, it probably means cutting down on 'tests without value.' I was annoyed at first too, but it turned out my tests were too tied to implementation details. After listening to the advice and revising them, everyone was satisfied.

by 주말개발자793 · ▲0

So it's based on line coverage, not branch coverage?

by 코딩하는곰280 · ▲0

Tests are a maintenance cost too. It's true that blindly adding more hurts productivity, and seniors weigh the trade-offs. But asking to 'cut them down' is usually the wrong direction. Rather, the right move is to ask, 'Can you explain why this test is needed?'

by AI덕후46 · ▲0