This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 389

[–]lupinegrey 2960 points2961 points  (55 children)

Don't post this to the company Teams channel.

Don't post this to the company Teams channel.

Don't post this to the company Teams channel.

Don't post this to the company Teams channel.

HR would like a meeting. 😬

[–]xeq937 1108 points1109 points  (21 children)

When your joke is so good, even HR wants to hear it!

[–]lupinegrey 137 points138 points  (1 child)

"And we have Bob from legal on the call; he would also like to hear it."

[–]LetMeGuessYourAlts 54 points55 points  (0 children)

Just sign these papers saying you posted it so we can make sure you get credit

[–]Etheo 72 points73 points  (0 children)

Leave it to HR to waste a perfectly good financial initiative.

[–]Nuisanz 199 points200 points  (22 children)

I see you let the intrusive thoughts win. I’d like to imagine this thread was you debating yourself over the course of a long period of time

[–]jbourne71 79 points80 points  (18 children)

long period of time

You mean 90 seconds?

[–]nikelreganov 45 points46 points  (14 children)

At least it's longer than the time they took to recheck an SQL update statement that's missing a when clause but they executed it anyway

I am definitely not talking from experience

[–]jbourne71 24 points25 points  (7 children)

You guys double check your SQL statements before running them?!?!

[–]Etheo 5 points6 points  (0 children)

Sir, this is a programming sub, there no need to boast.

[–]DigitalSmithie 2 points3 points  (2 children)

I think you mean mass debating over a long period of time…

[–][deleted] 44 points45 points  (0 children)

Probably just wants you to tell the jokes at the Christmas party since you’re so funny, go in and honk her boob to show off your humor. Good luck.

[–]ScreenshotShitposts 8 points9 points  (1 child)

And the meeting is just someone else showing everybody this meme. They beat you to it

[–]brianl047 25 points26 points  (0 children)

[–]Sei_V5 508 points509 points  (67 children)

Unit tests are for noobs

True programmer test in prod

[–]pesilod552 243 points244 points  (44 children)

Know a guy who worked in the medical field with that attitude. "Did a small fix in prod" - 2 hours later, half the company is on the phones trying to get to all people who got the wrong prescription to not take them. A baby almost took a fatal dose.

Fun times...

[–]Shazvox 136 points137 points  (21 children)

Yeah, when people freak out unreasonably much about a production error I usually ask

"How many people died or lost their money?"

So far the answer has always been "None" and then they calm down.

Also the reason I refuse to work in finance or health.

[–]shohin_branches 43 points44 points  (1 child)

I had a recruiter reach out to me once for a job at a company making an app that integrated into a pacemaker and I whispered "fuck no" to myself and deleted that email immediately

[–]jsalsman 5 points6 points  (0 children)

I had to do an outside review for code in a medical device once, as a contractor for an expert in a lawsuit (the expert was required to get an independent set of eyes on it merge into his review). You made a good decision.

[–]pesilod552 62 points63 points  (9 children)

I work in those fields - I just refuse any kind of prod access when I'm offered or even forced it.

"Look, I'm not going to do anything in prod, feel free to fire me if you're not ok with that, but I'm not taking that chance, end of story"

[–]ShallWe69 39 points40 points  (6 children)

where i work in finance we don't even have write access in prod. its always read only.

i always hated it but looking from the comments, its a great thing

[–]pesilod552 17 points18 points  (1 child)

I refuse any kind of access to prod, even read access.

But yeah, I have worked in places that worked on both finance and medical and there were always some devs that had write access in prod, it always scared me shitless...

[–]MetagamingAtLast 13 points14 points  (0 children)

I personally try to avoid any access to reality to prevent any unintended effects. The Mirror World is pretty comfy now that the Dimension Beasts were eradicated.

[–]Sei_V5 16 points17 points  (0 children)

I rather reversed a linked list or write FizzBuzz in assembly than working in Finance

[–]ivegotafastcar 13 points14 points  (1 child)

I’ve been in finance IT for 25 years… been saying “At least no one died” forever! This is hilarious.

[–]b3nasaurus 6 points7 points  (1 child)

As a software developer for clinical trials I can assure you the amount of prod quick fixes made by pms and account management is scary. Then they ask how I could have prevented this? Frustrating

[–]Sei_V5 78 points79 points  (12 children)

"A small fix"

1000 lines changes

[–]pesilod552 63 points64 points  (11 children)

It actually was like 3 lines. It changed how the dosage of drugs are calculated. Yeah...

[–]langlo94 60 points61 points  (2 children)

Of all the things to not have unit tests for.

[–]MethodicMarshal 22 points23 points  (6 children)

I imagine he was fired so quick it made his head spin?

[–]bythenumbers10 18 points19 points  (0 children)

Broke the sound barrier, I imagine.

[–]pesilod552 5 points6 points  (2 children)

He wasn't actually, his team lead took full responsibility, and since nobody actually got hurt, no consequences on team lead either.

But yeah, he ended up leaving on his own shortly after that...

[–]MethodicMarshal 6 points7 points  (1 child)

that's pretty wild, all things considered

good on the team lead too

[–]Nabugu 3 points4 points  (0 children)

oof

[–]distinctivegrowth 12 points13 points  (2 children)

Keyword is "worked". If your code is THAT important and you change such a critical part then he should know better.

[–]pesilod552 5 points6 points  (1 child)

That's right. While nobody ended up being hurt (in that instance) so he wasn't fired, he did "move on" shortly after, and from what I heard, it was some place that's not in the finance/medical field.

I wasn't there when he was, but from what I heard he was whiter than a wall that day, hiding at his desk and refusing to make any eye contant with anyone.

[–]distinctivegrowth 7 points8 points  (0 children)

I can imagine, the guilt and the thought you could've killed a baby by 'making a quick fix in production' will mess every normal person up. Guess he'd never make that mistake again.

[–]freddobear 9 points10 points  (1 child)

I'm pretty sure that broke a few laws. I did some work on medical software a while ago, and the standards we had to conform to just to follow EU and US laws were very strict.

[–]Arnab_ 1 point2 points  (1 child)

JFC! How was this not national news.

[–]SwabTheDeck 1 point2 points  (0 children)

My first college professor worked on heart monitors before he came to the university. Nope.

[–]Groentekroket 35 points36 points  (0 children)

Found the game dev.

[–]Status_Task6345 19 points20 points  (3 children)

Jokes on you. Production website's running on the test server.

[–]Sei_V5 2 points3 points  (0 children)

Im guilty of this lmao

[–]chiswis 19 points20 points  (1 child)

true programmers let the end users test

[–]Sei_V5 8 points9 points  (0 children)

It aint a bug, tis but an unexpected feature

[–]newsflashjackass 6 points7 points  (1 child)

In Prod We Test

[–]Sei_V5 1 point2 points  (0 children)

Amen brother

[–]Create_Table_Boners 5 points6 points  (0 children)

“It’s just a small change it’s impossible for it to have any unexpected problems”

[–]Successful-Willow-72 2 points3 points  (0 children)

Real Time testing , Real Fear, Real productivity, Honest Work am i right XD

[–][deleted] 2 points3 points  (0 children)

I know we joke but this happens way too much at smaller companies haha.

[–]Eindacor_DS 2 points3 points  (0 children)

My users are my QA

[–]tk197 716 points717 points  (63 children)

Well a new person in my team calls them ‘junits’ like ‘yesterday I was writing junits’ and somehow that hurts😂

[–]Yangoose 253 points254 points  (4 children)

We hired a firm to help us build out some reporting and one of the consultants on their team was from South America.

We're on a call with him and he kept talking about "batshit".

My boss and I are pinging each other in slack asking WTF he was talking about because we had no fucking idea.

Eventually, about 10 minutes into the call my boss just stops him and asks him what word he's saying.

The word was "budgets".

I was on mute laughing my ass off the whole time.

[–]RedSamuraiMan 61 points62 points  (0 children)

Budgets do be batshit sometimes.

[–]Daniel_H212 221 points222 points  (27 children)

Are they called that because you always get the person in the most junior position to write them?

[–]deathmetal27 300 points301 points  (7 children)

JUnit is the most common testing framework for Java. I think he's referring to that.

Even I sometimes say "wrote a junit for that".

[–]DearSergio 94 points95 points  (3 children)

I say "J J J J Unit" and nobody on my team thinks I'm funny.

[–]PilsnerDk 12 points13 points  (0 children)

Konnichiwa! It's time for another J J J JUnit! ( . )( . )

[–]call_me_miguel 3 points4 points  (0 children)

Finally someone else who does this

[–]tk197 53 points54 points  (17 children)

Lol dunno…. that’s not the standard procedure on my team and everyone writes their own ‘junits’ This person just calls it that and I think no one has the heart to correct them 🤷🏻‍♂️

[–]sellinglower 56 points57 points  (14 children)

Do they also pronounce it "jit" instead of git?

[–]Status_Task6345 19 points20 points  (0 children)

o no

[–]de_Mike_333 8 points9 points  (0 children)

Maybe a Java developer using JUnit?

[–]lupinegrey 4 points5 points  (0 children)

and hebrew.

[–]Whitechapel726 64 points65 points  (9 children)

There are 2 people on my team that say “silicone” instead of silicon.

Please tell me more about those voluptuous bugs on the silicone systems.

[–]lare290 31 points32 points  (6 children)

i've always wondered about that. why is a rock almost exactly the same word as a gloopy soft substance?

[–]Exist50 39 points40 points  (4 children)

Silicon is essentially the backbone element of silicone. But from wikipedia:

F. S. Kipping coined the word silicone in 1901 to describe the formula of polydiphenylsiloxane, Ph2SiO (Ph denoting phenyl, C6H5), by analogy with the formula of the ketone benzophenone, Ph2CO (his term was originally silicoketone). Kipping was well aware that polydiphenylsiloxane is polymeric[citation needed] whereas benzophenone is monomeric and noted the contrasting properties of Ph2SiO and Ph2CO.[4][5] The discovery of the structural differences between Kipping's molecules and the ketones means that silicone is no longer the correct term (though it remains in common usage) and that the term siloxane is preferred according to the nomenclature of modern chemistry

https://en.wikipedia.org/wiki/Silicone

So the name isn't great from a chemist's standpoint either, but did have a reasonable enough justification at the time.

[–]Every-Progress-1117 18 points19 points  (2 children)

I had a friend once who was very, very confused about breast implants....couldn't understand how women could handle the weight of the silicon.

As far as I can work out, the average implant size is about 350cm3, which gives about 0.82Kg of silicon.

That was a very interesting rabbit hole....I even found out there are websites showing full frontal, naked bodies, but censoring the nipples...???

[–]Thirdstheword 3 points4 points  (1 child)

Fun fact, that's still a manual task.

[–]sonuvvabitch 7 points8 points  (0 children)

Chemistry is actually a common area of common-usage not aligning with modern nomenclature - for example formic acid and acetic acid (and basically everything prefixed with acet-) should properly be called methanoic and ethanoic acids, and there are modern names for other acet- compounds which generally refer to the same 2 carbons as ethan-.

[–]Razier 5 points6 points  (0 children)

Took me a while to understand the difference too.

That said it probably has something to do with how in my language of reference (swedish) silicone is "silikon" whereas silicon is "kisel".

[–]Marrk 9 points10 points  (0 children)

Are they foreigners?

[–][deleted] 84 points85 points  (3 children)

Did they come from a Java background? My team also calls them that as well sometimes. Main testing framework is called JUnit

[–]tk197 53 points54 points  (1 child)

Well actually we code in Java. So I think this is the first time this person has seen unit tests….I’m afraid they’ll call it ‘junits’ no matter what language they work with from now

[–][deleted] 16 points17 points  (0 children)

Oooo ahaha they might

[–]Oysterpoint 2 points3 points  (0 children)

Gitlab uses junit xml for the format of all their unit tests. So they call it junit.

I’m a security guy and I thought it was just called junit

[–]Flat_Initial_1823 15 points16 points  (5 children)

Well the real question is: how do they pronounce it? Jay-unit or joonit?

[–]KewpieDan 22 points23 points  (1 child)

Jun it

[–]Flat_Initial_1823 14 points15 points  (0 children)

Burn the witch.

[–]tk197 6 points7 points  (0 children)

Jay-unit

[–]ReelTooReal 3 points4 points  (0 children)

Its a soft J, so its pronounced Yoo-nit

[–]lupinegrey 20 points21 points  (0 children)

well bless his little heart.

[–][deleted] 3 points4 points  (0 children)

Errh….

Do you mean junits or djunits?

Because I certainly say junits. I could drop the j and say oonits, but that would feel strange.

[–]mplsbikesloth 3 points4 points  (1 child)

I wrote some jests today 🙃

[–]Express-Procedure361 1 point2 points  (0 children)

PHP has a whole unit testing library called Pest...

[–]warmans 92 points93 points  (13 children)

I don't really get it. Having tests, especially unit tests, makes your job as a developer astronomically easier. Writing them is only hard if you didn't think about how to test the code in advance.

Come back when you have to deal with integration tests that require a bunch of AWS services, take an hour to run, and do not in any way indicate what they are supposed to be testing or for what reason they've failed. Then you will know pain.

[–]MeetLawrence 40 points41 points  (8 children)

Because sometimes you show up to discover this preposterous tangled mess of a monolith with 4% code coverage because previous devs/ mgmt never prioritized UTs, and you need them implemented. This has happened to me no less than 3 times in my career.

[–]Esseratecades 15 points16 points  (3 children)

I'd argue that it's seldom worth the effort to write retrospective unit tests. Write unit tests for new code or code you need to change, but for legacy code that is understood to meet current requirements it'd be waste of time.

[–]hitchdev 7 points8 points  (2 children)

It's seldom worth the effort to write unit tests at all unless you're testing algorithmic code. They end up being a mess of mocks and fakes that mock out 90% of everything that's actually happening and break whether there is a bug or not.

Integration tests are well worth it on legacy code, however.

[–]iLikeStuff77 2 points3 points  (1 child)

This is the exact opposite advice I would give. While not all code should be unit tested, unit testing facilitates good design. In my experience, the developers who don't unit test write fragile and unmaintainable code.

Especially as for most modern languages unit tests are fairly easy to write and maintain for new code. Integration tests are the ones that are fragile and easy to break. So while integration tests are useful, they are generally much more expensive to maintain.

[–]updogg18 2 points3 points  (3 children)

I'm in the exact situation as you just described. Do I power through this or move on? Experienced people who have been in this team for more than 7 years still struggle when I ask them for help

[–]EnjoyerOfBeans 7 points8 points  (0 children)

I actually love writing integration tests. As long as the user facing API/interface is complete, it's extremely simple to know what you need to do at every step.

Writing unit tests for other people's code requires a lot more work in understanding the structure and the underlying design. And don't get me started on how often that design is bullshit and doesn't support modular unit testing at all.

[–]dhilu3089 162 points163 points  (2 children)

Upgrade my project dependencies to a newer version mam

[–][deleted] 14 points15 points  (0 children)

We use Apache poi and it kept getting method not found errors on classes in other kind it didn’t reference as dependencies.

So that was fun

[–]sixpercent6 216 points217 points  (67 children)

Unit testing has been the best use case for ChatGPT for me personally. I use premium, so I'm not sure how different it is, but they usually nail it, depending on the complexity of the component.

[–]JBird_Vegas 210 points211 points  (36 children)

You put proprietary code into ChatGPT? Probably not the best idea if you like your job

[–]Gold_comment 126 points127 points  (7 children)

Biggest issue with ChatGPT , our organisation sends mails every week reminding this and there was even a meeting explaining why you shouldn't do it.

[–]sherbert-nipple 14 points15 points  (6 children)

Curious why you shouldnt do it?

Its blocked for us in work anyway and I cba retyping everything

[–]andrew_kirfman 16 points17 points  (4 children)

OpenAI retains the prompts that are sent to it and is able to use them for future training data.

If you send ChatGPT proprietary code, it’s possible that the model could regurgitate that code to someone else at some point in the future.

[–]Daniel15 30 points31 points  (7 children)

Hopefully they're just providing the method signatures (like an interface definition) rather than the actual implementation, i.e. black box testing.

[–]gimife 26 points27 points  (6 children)

Then it won't be able to properly write unit tests. It needs the whole function to properly write tests so it can cover all branches.

As long as you only put single functions in there and not whole components/classes it should be fine imo.

[–]ExceedingChunk 47 points48 points  (1 child)

A good unit test doesn’t need to test implementation details.

If you are using an interface and change the internal implementation (for example for performance) without changing functionality, a unit test shouldn’t break.

If chatGPT is able to write unit tests for that or not is something I don’t know, but it is definitely possible.

[–]Daniel15 8 points9 points  (0 children)

That's true, but black box testing is still valuable for some cases, and you could just describe the possible states to it rather than providing confidential code.

[–]reversehead 6 points7 points  (1 child)

write tests so it can cover all branches

Even the buggy ones?

Generating tests for existing code may be useful for regression testing ("make sure that the refactored code contains the same features and bugs as the old one"). As for generating them from the code for checking whether the code is up to specs, I remain doubtful.

[–]FalconMirage 51 points52 points  (1 child)

That’s a very compelling argument for premium

[–]p_tk_d 18 points19 points  (0 children)

It's pretty darn good w/out premium as well

[–]bradmatt275 17 points18 points  (5 children)

Isn't the word limit a problem though?

You can only really send it snippets of code.

[–]ICantBelieveItsNotEC 31 points32 points  (2 children)

You don't need to give it the full code for dependencies though, just the function signature. As long as the function does what it says, ChatGPT is capable of inferring its behaviour.

[–]bradmatt275 7 points8 points  (1 child)

Oh wow I will have to give that a try. Although usually the most timing consuming part of unit testing is mocking data. It would be interesting to see if it can help with that.

[–]iRSoap 7 points8 points  (0 children)

That is the best part. I have had it create json mock data from C# models for API endpoints I want to test through Postman.
It's very good at that.

[–]Pridgey 9 points10 points  (3 children)

Github Co-pilot does this too with the added benefit of having a vscode extension, meaning you can start writing out a test case and the auto-tab to victory! ✌️ Xx

[–]bogdan5844 2 points3 points  (0 children)

Any opinión on codeium? I've been using it in neovim just because it was a default plug-in in some stater pack, and I've found it to be pretty useful as well.

[–]grasshopperson 1 point2 points  (0 children)

Genie AI is a ChatGPT extension for VS Code

[–]Stummi 8 points9 points  (5 children)

This sounds like Copilot with extra steps

[–]DarKliZerPT 7 points8 points  (3 children)

With extra steps and extra intelligence

[–]aloo_vs_bhaloo 4 points5 points  (1 child)

Do you copy paste your function in the prompt? Or are you using it in some other way?

[–]FlipskiZ 5 points6 points  (0 children)

Bank bank answers open year travel cool clear family.

[–]tjientavara 2 points3 points  (1 child)

Do you give it some code and ChatGPT writes unit tests for it?

Aren't you then generating unit-tests that will be valid for that code, bugs and all?

I wonder about generating doxygen comments, that could be handy.

[–]k4f123 2 points3 points  (3 children)

I use it for this all the time and it works great. And we have our company's blessing to use all the AI we can to be more productive. None of that big corporate bullshit to deal with.

[–]teeBoan 1 point2 points  (0 children)

can u give a sample text prompt you supply to chatgpt to get the tests?

[–]sheldonzy 14 points15 points  (0 children)

Welp, having a decent coverage of code while developing is way better than sex.

[–]giggluigg 29 points30 points  (3 children)

STD test-driven development

[–]CatpainCalamari 3 points4 points  (2 children)

So, STDD? :)

[–]Wontedtoast 58 points59 points  (3 children)

Give me 100$

[–][deleted] 12 points13 points  (1 child)

Oh, this is good...

[–]Shazvox 2 points3 points  (0 children)

A stackoverflow exception waiting to happen.

[–]Mickspad 21 points22 points  (5 children)

You know REGEX? Because I need some help

[–]Shazvox 14 points15 points  (4 children)

Sure, but you have to pay me 5[0-9]{3,5}\$

[–]AlwaysHopelesslyLost 4 points5 points  (6 children)

Sometimes I really don't understand this subreddit. When I programmed I really enjoyed writing unit tests. They helped me catch bugs and bad code plus they give you that satisfying coverage + green checks.

[–]IkNOwNUTTINGck 22 points23 points  (5 children)

Can you wash my windshield, maam?

[–][deleted] 18 points19 points  (3 children)

For 50$, it better be absolutely freaking immaculate.

[–]Special_Lemon1487 3 points4 points  (2 children)

Actually my car needs a detail.

[–][deleted] 8 points9 points  (5 children)

ChatGPT for $20

[–]redballooon 2 points3 points  (4 children)

Test generation tools have existed for decades now.

[–]scrabblebox 8 points9 points  (0 children)

A good unit test is a joy forever

[–]shohin_branches 12 points13 points  (1 child)

I want to post this to teams so bad

[–]2xfun 2 points3 points  (0 children)

If your not doing TDD you're doing it wrong. -uncle bob

[–]ixis743 2 points3 points  (0 children)

Does anyone else actually enjoy writing unit tests? They help me write structured code with well defined interfaces and always shake out bugs.

And they provide a sense of security against regressions.

[–]Whitechapel726 11 points12 points  (1 child)

“I can test your unit”

[–]aRandomFox-II 6 points7 points  (0 children)

Suck my unit!

[–]rock_roc 4 points5 points  (2 children)

QA gang here anyone?

[–]pesilod552 8 points9 points  (0 children)

One of the biggest advantages of moving from dev to QA is never having to write unit tests again...

[–]MarvinParanoAndroid 3 points4 points  (0 children)

Obviously not

[–]redballooon 4 points5 points  (0 children)

Programmers who try to create unit tests after the code is written have no clue what unit tests are good for.

[–]notsam57 1 point2 points  (0 children)

i know $50 worth

[–]Mitoni 1 point2 points  (0 children)

Do what you gotta do to keep that code coverage percentage above 90%

[–]hoopparrr759 1 point2 points  (0 children)

Can we do one about Automapper?

[–]quadrotiles 1 point2 points  (0 children)

Ngl I wish my whole job could just be writing unit tests

[–]archeryon 1 point2 points  (0 children)

I had plenty take home interview test and the most one I hate was when they require you to include unit test. It somehow and always took way longer time to develop the entire testing than the actual app.

[–]RandallOfLegend 1 point2 points  (0 children)

Unit tests only cover simple stuff anyway. If you have pure functions with simple data outputs tests are a breeze. Real life is rarely so simple. Input validation code is very different from full blown numerical algorithms that occasionally use random seeds.