Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "unit tests"
We passed a milestone: 250,000 phpunit testcases.
If it weren't for a heavily parallelized build pipeline which splits it out over 20 servers, it would take about 7.5 hours to complete.
Not hating on PHP, and without tests it would truly be hell...
But still, fucking hell, we outgrew PHP.
Not having a solid type system just means you either accept more bugs, or write thousands of unit tests to guard all the foundational cracks in the system.
On the bright side, I get a coffee break after every commit 😄22
Some 'wk306' highlights from different people:
Walk around the office in his underwear, because he forgot he left his trousers in the bathroom
Run a red light outside the office due to not wearing his required glasses. When questioned by co-workers, replied "I don't follow those facist rules"
Asking if we work less will we get paid more, because the project will take longer to do (while in a startup with no funding trying to secure some)
Tell a senior dev to stop testing in his spare time, as we won't be able to release on time if he keeps finding critical security bugs
Telling me "your timezone is not my concern", when asking for help with new tooling so we don't have to be online at the same time
Blaming my team for requesting too much help, leading to his team missing deadlines, in a meeting with very senior managers. When the reason we were requesting help was the handover doc we were given was filled with lies about features being finished and "ready to ship" and lacking any unit tests
Being accused of bullying and harassment to the CEO, because someone asked "did you follow up with X about the partnership they emailed us about". The person who was responsible, forgot 4 times, and saw it as an "attack" to mention it in team meetings
Telling an entire office/building mid November they've secured funding for at least the next year, then announcing in January after the Christmas break that its cheaper to move to India, so they are closing the office in 30 days3
This happened today...
Manager: how long this is going to take?
Dev: 3 months
M: cool! 3 weeks then
D: no.. This is quite complicated and most of us are unfamiliar with the topics. It'll take us 2 weeks just to get started
M: drop the unit tests then. Just get the features done in 3 weeks. We have customers waiting
D: that's a bad idea. We'll end up with unstable co..
M: oh we also need to complete documentation, release guide, and this [shitty feature no one care about]
D: but that is even more complex. We don't have enough ti..
M: just copy it from stackoverflow. It'll only take 5 minutes guys
Worst part? This guy is technically sound and understands our pain really well. He is just acting dumb and trying to put the blame on us when the higher management asks
Second worst part? The whole team keeps silent when I try to convince him somehow and starts ranting after he leaves the call2
Current work project is microservices architecture out of 4 - 8 components.
It is fully Infrastructure as a Code automatized. I just change somewhere code, git pushing
And it automatically invokes Gitlab CI, terraform, ansible, kubernetes helm charts.
Auto checking itself with unit and integration tests in autoredeployed staging env. Then it saves tested results to docker registry and asks for one button verificating click to be rereleased to prod.
I just go for drink or eat food. While all the stuff is happening.
And I am proud that all the infrastructure, backend and frontend I made on my own.
I don't need to remember how to Deploy it. It is all automatized3
I was pressued to shift the blame.
We received an angry email from a customer that some of their data had disappeared. The boss assigns me to this task. This feature is relatively new and we've found some bugs in the past in here. I go through request logs, search the database, run some diagnostics, etc. for about 5 hours and I cannot find the problem. I focus on the bugs that we've had before but they don't seem to be the problem.
I tell the boss "sorry but I checked XYZ and I can't find the problem. I'm out of ideas." But the boss wanted answers by the end of the day. They did not want to admit to the client that we couldn't figure out what's wrong.
By now I was more pressured to find an answer, find something or someone to blame it on, not exactly to find the real solution. So I made up some BS:
"Sometimes, in HTML forms, the number inputs allow you to change the number by scrolling. We have some long forms where the user has to scroll. Perhaps the focus remained on the number input, so when they scrolled down they accidentally changed the number they meant to input."
The boss was happy with that. We explained this to the customer, and there's now a ticket to change type="number" to type="text" in our HTML forms and to validate it in th backend.
A week later another customer shows us a different error. This one is more clear because it had a stack trace, but I realise that this error is what caused our last error. It was pretty obscure, mind you, the unit tests didn't detect it.
I didn't tell the boss that they were connected tho.
With two angry clients in two weeks, I finally convinced the boss to give us more time to write more unit tests with full coverage.
Employer: Hey, we are moving an API update live tomorrow morning that could affect our apps. Can you regression test the apps to make sure they all work?
Me: The API team is pushing code overtop of live endpoints that can break them?
Employer: Yes, we need the updates to work with a new product we are developing.
Me: And nobody thought about versioning these endpoints so we guarantee uptime on all existing services using them now?
Employer: We looked at that but it cost extra and required us to use the cloud solution so we don’t use versioning.
Me: Okkk… I also take it that the API’s don’t have integration tests written?
Employer: What are integration tests? Are unit tests the same thing?
Me: No, so when do I need to regression test all 7 production apps?
Employer: The API’s are moving to production at 4am and we need it signed off by 7am.
Me: I only have 3 hours to regression test 7 production apps at 4am? Each app, if I just skim over them, would take me 2 hours each. I will do my best but that’s a very short time to ensure complete functionality.
Employer: Don’t you have unit tests?1
Supervisor: YOU NEED TO INCREASE THE COVERAGE OF YOUR UNIT TESTS! THE FILE logger.js DOESN'T HAVE >80% COVERAGE! IMAGINE PICKING THIS UP 6 MONTHS FROM NOW!
Bro. It's a Winston instance.
I am literally exporting a fucking Winston instance with 0 custom logic.
If 6 months from now I take a file and can't understand a Winston instance anymore, you're well within your right to fire me on the spot.2
Unpopular opinion: unit tests are often overrated.
Although a well written test suite is almost essential in some parts of the application (I.E. business logic) I cringe when I see hundreds or thousands of line which “mocks” everything to test a micro service which just does CRUD operations on a database, in cases like that unit tests are just a waste of time because almost every operation involves a mock which may not behave like the real database and often needs to be rewritten when the code undergoes a huge refactoring. In these case a integration test suite is faster to write and way more helpful.7
delete unused code according to IDE
unit with context tests now fail
what is a good alternative industry or career instead of software development8
probably every time I see my tests failing.
Each time I am writing tests I'm convincing myself "it's an investment", "spend 2 hours now to save 2 days later", "unit-tests are good".
And each time I'm chasing away ideas like "perhaps they are right, perhaps writing unit tests is a waste of time..", "this code is simple, it should ever break - why test it??", "In the 2 hours I'll spend writing those UT I could build another feature"
Yes, it is terribly annoying to write tests, especially after writing the production code (code-first approach). Why test code that you know works, right?
But after a few weeks, months or years, when the time comes to change your feature: enhance it, refactor it, build an integration with/from it, etc, I feel like a child who found a forgotten favourite candy in his pocket when I see my tests failing.
It means I did a very good job writing them
It means it was not a waste of time
it means these tests will now save me hours or days of trial-and-error change→compile→deploy→test cycles.
So yeah, whenever I see my tests fail, I feel warm and fussy inside :)3
Not leaning on unit tests. I usually write them after testing my code manually, and lose time for testing feature by hand.1
all that decades spent on debuggers, strict typing, static analyzers, fucking unit tests
ima put frogs in my code so they eat bugs
S̸ ̶T̶ ̵O̴ ̴N̵ ̶K̶ ̸S̷
If you're subscribed to me only because of my jokes, feel free to ignore this rant. You won't miss anything.
If not, bear with me.
I was wrong about almost everything I can remember. Preaching so-called “conceptual thinking”, I invented a fantasy world of random anecdotes, which turned into a completely false worldview that shaped my reality. I bashed magical thinking, yet succumbed to it. What I believed to be true was just as magical, wrapped into what sounded like science. In the Dunning-Krueger scheme, I was right there on Peak Stupid.
Random hear-say, stupid concepts I invented, random “knowledge” I picked from YouTube videos, all that was rotting inside my head, one anecdote contradicting another. Ultimately, I think this was the reason of my constant anxiety and pointless, never-ending thought process in background.
If you learned anything factual from me and didn't fact-check it, please forget that immediately. The list includes but is not limited to everything on brain structure, everything on philosophy, almost everything on engineering and architecture, almost everything on systems theory and programming meta stuff (declarative, imperative, etc.)
I admit bashing unit tests. The only reason was me disliking writing them in uni. I wrote like three test cases, disliked it, and the rest was history. Everything else was a rationalization on top. If I was right about something, I was just lucky.
I'm not a CSS prodigy. I know stuff that earns me money and impresses my colleagues, but my knowledge is just one step above basics, in one thousand steps ladder.8
so am 23 , with a work experience of 1.5 years (1 year at b2c cumpany, 6 months at current b2b company) and am kinda uncomfortable with the comfort in my job.
tldr : my company has a work heaven and a very boring product , the nature of tasks makes me feel like a glorified QA and i am kinda feeling like wasting my 20s. should i quit?
my last company used to keep me on toes. they had this massive multi module fast evolving android app on which i used to work. it was made with latest techs from 2021/+ and combined with a lot of modules/architecture, it was very overwhelming at first.
i used to work 12+ hours everyday , not because of any pressure ( the pressure to execute fast was there, but the team was very helpful and understanding) , but because i liked to learn and explore.
at the end of my journey with them, i left with a lot of good memories with helpful seniors, a great knowledge of android dev and an unsatisfactory amount of bank balance.
my current company is... i guess ok. the work here is awkward. the product is made of either legacy techs(large verbose java project in which even concurrency or image downloading classses are written in project and not any 3rd party library) or techs that i don't find interesting ( unity , react native , flutter, etc projects that are just wrapper over native sdks)
its heen 6 months here and the growth for me here seems weird.
- i mean i can say i got to work on different techs but 1) am not becoming a master or anything useful in those techs . and 2) i already know a frontend framework i.e native android which i like and was growing in it.
- most tickets are client side tasks : client is unable to use some feature/product > i ask for their logs / app and weather they followed the docs/sample > they say we did> i check the logs which indicates that they didn't > i inform them the step and they are back to being happy. but most of the times i am also clueless and get to the conclusions after discussing with my seniors
- the non client tasks that i got were also not very interesting : one ticket was included testing out all sdks and 3rd party integrations and make a csv of what features are available in each . another was about creating a cicd pipeline that was kinda okay. but now its done so am guessing am back to making it useful by adding more unit tests :/
- however the work environment is very good i guess? daily scrum happens on MWF only, i get literally 0 meetings if not urgent on TT . apart from sat/sun and general festivals, the 3rd monday of every month is off . plus i get 2 additional paid leaves every month that gets can be carry forwarded for 11 months. in a nutshell, i feel like being the son of a school principal in school.
- pay is good , i switched here for an almost 100% hike
i have tried to utilise my time in learning different tech stacks (working on android all the time feels like unworthy) but i am not getting a kick. the satisfaction that i got in writing code that is immediately being used by 5 million people gave me the kicker to learn more and more.. but now am just feeling like being on a extended vacation where i have to sometimes wash utensils.
should i start interviewing with other companies? it's not like my current company is some well established corporate to always keep less worthy resources like me around. i am definitely worth getting the axe on the next possible layoffs7
Read this and tell me OOP (or at least C#) isn't broken:
All I want to do is mock System.DateTime is for a few of my tests, and I ended up going down this rabbit hole of absolute horseshit: build a custom class that you can mock in tests, blah blah blah blah, uhhhh... YEAH NO
Such a simple functionality / need, and yet there is no easy way to test for it. Sigh.16
I hate unit test. I hate testing by code.
I hate the idea to write code that tests code. And that u must update both when u add a feature. Like wtf.
Good debug mode with clear verbose and precise reporting tool and voila.
Drives me nuts thus trending shit.10
Unit tests pass locally but fail on the pipeline. After 3rd re-queue, pipeline tests pass. I am so over this bloody week.11
What have you suggested at work which sounded like a good idea at the time, but now sounds like a nightmare?
I inherited a nasty old legacy c# desktop app a few years ago, I was a sql developer so it was a steep learning curve, but I’ve tried to make it better, fixing things as I go.
I had the bright idea of mentioning that I would look at starting to add unit tests etc.
It seemed like a good idea at the time, but now I’m not so sure.3
Looking for android dev who could mentor me with more advanced android dev topics (architecture, unit tests, code style and etc.) I am a self tought intermediate dev with 2 years experience (worked in 3 startups). I need help with questions/ocasional code reviews.3