4 ms·
> It's our job as developers to explain the importance of unit tests, and why they're non-negotiable. Let me put on a hat that I wore a few times - someone who
by notyourday 9y ago
> It's our job as developers to explain the importance of unit tests, and why they're non-negotiable.
Let me put on a hat that I wore a few times - someone who had one person above him in a company. I will also preface this with 'I hate sloppy code. I hate shortcuts. I want people to spend time on building tooling instead of writing features. If I could wave a magic wand we would have 99% test coverage'.
This is 100% incorrect. Code quality on a list of priorities for the business is somewhere between the taste of a three day old coffee and a french fry that fell off a tray.
Business is there to make money. It means that code that works somehow is better than perfect code which did not happen to ship because developers are still working on the unit tests. Developer time costs money. Operations people time costs money. Anything that does not make money but costs money gets de-prioritized. If you think that "code smell" and "unit tests" are non-negotiable especially if it is at the cost of tweaking/fixing something that is going to generate revenue, you are drawing a line in a sand and I'm going to have to point you at the door.
If you would like to get me to allocate resources ( read: $$ ) to address code smell/code stench/etc, you need to either convince me that the sky is falling ( i.e. we start losing money/we are going to start losing customers ) or you need to give me something that can offset some of my costs or you need to come up with a clever way to enable us to make more money.
> Also, if you do the tests at the right time, you end up saving time. I've learnt that the hard way (as most do).
Exactly. The "right time" may not be now and may not be before. It may also not been for another year.
P.S. Incidentally, this is also why product people/project managers and sales people get a better seat at the table than developers ( which is a mistake, from my perspective ) - they typically talk about money while developers talk about code.
- Retra 9y agoBut now you're asking software people to predict long term costs on processes they don't even control, and it's already notoriously impossible for them to do it in the short term on processes they do. I don't see how you can expect more than "if we don't do it, we'll eventually have problems." Customers might leave and features will get harder to implement. It all costs money, but how much is very difficult to say.
- notyourday 9y agoIf you cannot qualify your problem then it is not a problem that needs to be addressed. Let me ask you this - if your car mechanic told you that you need to overhaul your entire car because he did not like the way it felt to him would you let him do it?
- Retra 9y agoImplementing good testing is not an overhaul of your entire business.
- notyourday 9y agoIn that case you should be able to justify it.