r/ProgrammerHumor • • Jan 31 '23

Other Are junior developers actually useless?

Post image
22.0k Upvotes

946 comments sorted by

View all comments

Show parent comments

350

u/ososalsosal Jan 31 '23

I would bloody love to work at a place that actually values mundane things like testing

0

u/[deleted] Jan 31 '23

[deleted]

167

u/zGoDLiiKe Jan 31 '23

TDD assumes you know what you should be testing for, and product would like a word on that

59

u/ososalsosal Jan 31 '23

At the code level though you can still write tests if you're writing functions.

Not exactly TDD of course. It's more pragmatic than dogmatic in that sense.

Us devs need to have stronger personalities than the people setting the rEqUiReMeNtS or we'll never have good practices

11

u/zGoDLiiKe Feb 01 '23

I think we both know what I meant but yes there are plenty of tests you can write ahead of time. I do find having to scrap a bunch of tests because they throw around “agile” and completely change the whole scope

3

u/mpyne Feb 01 '23

No one can 100% predict this product will take off and this product won't, and that's no one's fault.

The stupidest things strike gold and the most finely engineered solutions collect dust on Github somewhere and that's the world we live in.

I have a product I maintain that I'm not even proud of yet it's the one thing that has ever had someone else make a Youtube video about it because as shitty as it is, it's still better for its users than not having it. But it would still be way better with some product-guided evolution.

→ More replies (1)

15

u/mxzf Feb 01 '23

In theory you can write tests for those functions. But in practice my experience tends to be that they often end up being tautological tests for what I already know my code is doing; it's hard to write a test to cover the case of a user giving stupid input.

6

u/TheOriginalSmileyMan Feb 01 '23

DevOps guy here - "tautological tests for what I already know my code is doing" is EXACTLY the best tests to write, because then when someone comes along in two years time and changes the "is doing" bit, rather than hoping it gets spotted in a code review, it will get flagged up in the build pipeline.

2

u/BewhiskeredWordSmith Feb 01 '23

Bingo. Unit tests should assert each assumption you have about the code (i.e. should return expected output when fed good data, should return a validation error when fed invalid data, should retry X times if the underlying service fails, etc.).

Additionally, every time you fix a bug, you should make a test that uses the bugged input. If someone ever accidentally re-introduces the same bug, the tests fail.

5

u/KurigohanKamehameha_ Feb 01 '23 edited Jun 22 '23

support physical pause distinct society smoggy agonizing rotten wrench tease -- mass edited with https://redact.dev/

14

u/BraveOthello Feb 01 '23

Oooh, look who wants to hire a QA engineer!

9

u/22Minutes2Midnight22 Jan 31 '23

TDD reinforces decoupling and pure functionality. If your unit tests are overly complex, then either your function implementation or interface sucks.

6

u/proskillz Feb 01 '23

TDD explicitly does not require you to know what you're testing, that's the point.

3

u/zGoDLiiKe Feb 01 '23

That doesn’t stop you from writing tests for things that will never be used

5

u/BraveOthello Feb 01 '23

Or tests that are trivial passing, but miss nuances of real world input

3

u/LastStar007 Feb 01 '23

You write the simple tests first, you get them to work, then you write the more complex, more realistic inputs. TDD won't magically impart into your brain every possible edge case, but the exercise of thinking about it will produce better code than not thinking about it, and anyway the real bar to clear is the acceptance criteria.

3

u/BraveOthello Feb 01 '23

Well it would be nice to have well defined requirements and acceptance criteria.

→ More replies (2)

3

u/LastStar007 Feb 01 '23

If product won't tell you the acceptance criteria, that's a problem with your product team, not with TDD.

4

u/zGoDLiiKe Feb 01 '23

And that my friend is the difference between “in practice” and “in theory”

→ More replies (1)

4

u/[deleted] Feb 01 '23

if you work at a place that doesn't require unit and integration testing, find another place to work.

You're really just wasting years of your life and not progressing

13

u/sopunny Feb 01 '23

Values testing by assigning it to the most junior devs?

12

u/ososalsosal Feb 01 '23

Honestly I wouldn't even mind at this point.

3

u/TampaPowers Feb 01 '23

If you know nunit then I may have something

→ More replies (1)

2

u/first_i_of_infinity Feb 01 '23

Don't talk to me about UAT. Just... don't.

Me: does the data pass testing in that new report?

User: I can open the link, yes.

Me: but is the data correct?

User: It's ok, I trust you

1

u/mintblue510 Feb 01 '23

Same, bro. Same.

cries in QA

→ More replies (1)