DEV Community

Anna Simoroshka
Anna Simoroshka

Posted on

The worst developers are those who complain there are no tests in a project

This is what I heard today from one of the senior developers. His philosophy is that people who want tests just don't want to think. They don't want to invest time into understanding what the code is supposed to do and how their changes will affect everything. They are lazy coders who think that testing will solve all their problems.

I completely disagree (except the part about testing not solving all problems). I've been trying to push some testing culture forward in our company and did some for my parts as much as time allows. But it is hard when the software is not designed to be testable. It is also hard when you don't get support from your seniors and when time spent on tests is seen as wasted money.

Hearing this is discouraging.

What would say or do in this situation? Do you think testing is for lazy developers? Does your company have testing culture?

Top comments (34)

Collapse
 
powerslacker profile image
powerslacker

Testing is good for three things:

  1. Documenting code usage and functionality. Comments can lie. Tests cannot.
  2. Ensuring basic use cases have been fulfilled and that unhappy paths cannot be fulfilled.
  3. Preventing regressions. Once a defect has been found, that should be the last time that defect is found by humans. Computers are excellent at doing boring, repetitive work.

I suggest you read / watch the following:

Unit testing: How to get your team started
https://www.youtube.com/watch?v=TWBDa5dqrl8&t=788s

Top Five (Wrong) Reasons You Don’t Have Testers
joelonsoftware.com/2000/04/30/top-...

The Hidden Costs of Neglecting Testing (shameless self-plug)
powerslacker.cc/hidden-cost-neglec...

Testing both automated and manual can reduce significantly reduce defects in software. This senior developer is just plain wrong. Which is OK, and presents an opportunity for you to educate them.

Google, Amazon, Facebook, and every major software company write tests, employ QA departments, and automate as much as they can.

Collapse
 
simoroshka profile image
Anna Simoroshka

Thank you for the resources, I will check them out!
I am a beginner with testing but I can see the potential benefits. Although I understand it can take a lot of time in the beginning and a shift in thinking about code and development. Habits are difficult to break and create.

Collapse
 
nflamel profile image
Fran C.

If I understood correctly those developers are complaining that other people wants to make their work easier and safer by using proper tools to do that... I would say that deciding not to use a tool that can make our lives easier seems like a very bad choice, no matter how you look at it.

And yes, of course, tests can be taken too far and become an obstacle, but same thing can be said about almost any tool at hand: types, IDEs, dependencies...

Collapse
 
simoroshka profile image
Anna Simoroshka

Maybe they believe that it is possible to write perfect code that will never break...

Collapse
 
david_j_eddy profile image
David J Eddy

I know someone like this; will not work with them again.

Collapse
 
nflamel profile image
Fran C.

Could be... From my point of view the safest believe you can have as a developer is that everything is broken or is going to be broken at some point.

No mater how much experience you might have, how easy the problem to solve is or which tools you use. I guess that's because we engineer solutions based on trade offs and we always leave little things behind. Maybe it is because we don't always fully understand the problems we solve...

Collapse
 
rhymes profile image
rhymes

Enter the room shouting "regressions, regressions, regressions" and see what happens 😬

Seriously speaking I think he's wrong saying that, but he might have been bitten by TDD crazies in the past.

What about introducing some chaos in the system by reproducible tests? Or doing integration testing? I feel like he mostly meant unit tests, where I'm sure he could be more reasonable with overall tests that you could break with a change as a demo. To demonstrate the point about regressions ✌🏾

Collapse
 
simoroshka profile image
Anna Simoroshka

I am trying to get to the point where my tests actually help as much as it is worth a demo with an "I told you" subtext. 😬It is a huge mess of legacy code at the moment that I am dealing with.

So far Cypress E2E is the most helpful tool to catch regressions, but even for that I had to push a few changes because certain things were incompatible or made tests too slow to write and run..

Collapse
 
rhymes profile image
rhymes

It's going to be a long and winding road.

Legacy code is a boon for tests shine though, I'm sure you'll prove their worth!

Thread Thread
 
simoroshka profile image
Anna Simoroshka

Thank you! :)

But I also will need to do these things quietly and as part of whatever I am supposed to do. Apparently, it is not appreciated to log hours just for "automated testing".
I will need to be Piter Parker.

Thread Thread
 
rhymes profile image
rhymes

From great power comes great responsibility 😜

Collapse
 
alanmbarr profile image
Alan Barr • Edited

Testing adds information about risk. A system considered untestable is high risk. Initially adding levels of testing to a project may seem like a waste but this is a type of insurance that may pay off greatly in the future. Compared to a great future failure tests provide us with a much less expensive early warning that our system may not safe. Start small and begin to provide information and over time and compare scary systems with safe systems and capitalize on those successes.

Collapse
 
bosepchuk profile image
Blaine Osepchuk • Edited

I just wanted to explore an alternate explanation.

Most people (in the comments) are assuming that your senior is wrong and that may well be true. But the opportunity I see is for you to dig deeper with your senior and find out why he/she believes what he/she believes.

One of the "7 Habits of highly effective people" is "seek first to understand, then be understood".

By digging deeper, you might learn something valuable even if you don't agree with his/her position on testing. At the very least you might learn what kind of argument or proof would convince your senior to give unit testing a try (or to let you try it).

Collapse
 
simoroshka profile image
Anna Simoroshka

The funny thing is that in the following weeks he proudly announced covering an important part of application with unit-tests.

I guess the point was mainly about how important it is to think carefully about your design decisions and the changes you make to the code base. And that 100% coverage is a waste of time. With both points I agree. Maybe the rest was actually a joke. :)

Collapse
 
bosepchuk profile image
Blaine Osepchuk

Interesting. Now I'm even more curious to know exactly what he meant originally.

Do you think you'll ask about it or let it go?

Thread Thread
 
simoroshka profile image
Anna Simoroshka

I think I will leave it to be a mystery :)

Collapse
 
chenge profile image
chenge

It's about degree and amount of test.

For example of web programming, my solution is unit test includes usecase and entity, not test controller and db. This will be more quick and reduce amount of tests.

If need , add a short time to do integration test for page and db.

More test for key point such as domain model.

No a simple line for test, just experience.

Collapse
 
simoroshka profile image
Anna Simoroshka • Edited

I do agree that testing everything is unnecessary. But some testing, especially on things that, when broken, disrupt the client's workflow or experience, is hugely important.

Collapse
 
chenge profile image
chenge

It's about confidence for remove bug quickly and project control. Test is a valuable tool in the age, unless you are a superman.

Thread Thread
 
simoroshka profile image
Anna Simoroshka

And the confidence that the bug is actually removed and will not come back.

Collapse
 
ghost profile image
Ghost

People definitely take test-driven-development to unhelpful extremes, yes. I recall a couple of developers who were obsessed with it, guilt-tripping others into 100% coverage (as if that were possible!).

In the days of ye olde Extreme Programming dogma, test-driven development supposedly gave license for developers to code in the most direct way possible to make the tests pass, which often resulted in some pretty awful code indeed. So that's an extreme.

Although, for a platform on which a business depends, TDD is pretty damn good.

Call me lazy, but I reserve my tests for bits of code that are really complex, like certain custom algorithms that can't be easily visually verified, and go easy on the bits that can be easily verified with a code inspection. My 2c!

Collapse
 
simoroshka profile image
Anna Simoroshka

I do agree that 100% coverage is too much and can be a time waste. In many cases even TDD is not suitable for the development process.

His point, however, was "no tests at all are needed if you think carefully when you code".

Collapse
 
simoroshka profile image
Anna Simoroshka

...and "lazy people are those who want tests"

Collapse
 
david_j_eddy profile image
David J Eddy

To the question regarding testing; Testing is part of Craftsmanship, Craftsmanship is a trait of Professionalism, Professionalism is a property of Responsibility. Responsibility is invaluable within a high performing organization.

Two; Speak the Seniors language. Figure out what is important them, and how testing makes it even better. For example exemplify cases wherein testing has captured errors early (and cheaply) vs later and more expensive (in production). Or how testing is a cornerstone of high performing engineering departments.

At the end of the day businesses exists to make profit. If the Senior does not appreciate cost savings, and no one above them will champion the initiative, you choice is binary: change your boss or change your job.

Collapse
 
simoroshka profile image
Anna Simoroshka

The choice is even unary. I cannot change my boss unless I change my job, the company is too small.

But first I am going to try and make some difference. It is a challenge now!

Collapse
 
jdsteinhauser profile image
Jason Steinhauser

I thoroughly believe that testing actually helps you think about the problem. That being said, I don't think you need 100% coverage either. Automated test suites give you a "warm fuzzy feeling" that given certain inputs, you get expected outputs. It also helps you see if there are any edge cases that you haven't thought about. To counter his point, I've encountered many people who haven't wanted to test because they're too proud of their code, too lazy to learn how to do proper testing, or can't do it "because their architecture isn't set up for it" (aka, it's bad architecture).

Collapse
 
quii profile image
Chris James

I'd rather be in a team full of "average" developers who write tests than a minefield codebase with no automation which only geniuses can maintain.

Collapse
 
vincent026 profile image
Vincent Schol

Requirements, unittesting and clear code go hand in hand.
I think your senior collegea overestimates him(sounds like typical male behaviour)self. How does he do heavy refactoring? Confirming that nothing broke by testing all use cases in his head?

Collapse
 
fabiowebdev profile image
Fabio Ferreira

Having someone specialized doing the tests is something completely different. Their experience tells them where to search for bugs and so on. Sometimes testers in our company find bugs we had no idea were possible.

Collapse
 
ben profile image
Ben Halpern

Yeah, the best approach is to pragmatically consider the problem at hand and do whatever works without being too dogmatic about it.

You don’t want to disrupt a roadmap towards the proper solution by demanding a certain approach.

Collapse
 
simoroshka profile image
Anna Simoroshka

Yes, I agree with this.

Collapse
 
liltechnomancer profile image
Levi ᕙ(⇀‸↼‶)ᕗ

Ew, I really don't like that dudes opinion. lol

He sounds like a grump.

Collapse
 
simoroshka profile image
Anna Simoroshka

He is actually a very nice and fun person and a great boss. :D

Collapse
 
liltechnomancer profile image
Levi ᕙ(⇀‸↼‶)ᕗ

He tests in secret then ; ) jk jk lol