Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
xewl41716y@Hu-bot0x58 My nose will just itch if I don't know where something's coming from. Truth to be said: someone pranked le me in a very similar way, back when I was younger.. (:
-
Fuck I laughed harder than I wanted and let out a loud fart during my pooper time! I shall name my poop after you and knight it before flushing
-
Aren't unit tests just a waste of time? They don't seem to test the software and all they do is force you to work twice on the same problem.
Nothing against integration testing. -
@HitWRight Functional/integration tests are a good starting point. When making a small application or website, I often advise to write at least 10 tests which show that various important pages are reachable and work as expected.
But Functional / Integration tests are hard to maintain, they perform badly, they cover some stuff multiple times and skip other stuff.
When your application grows, you must write modular code — you split things into separate repositories, with separate versions, each as a unique library with its own tests.
Maybe they're not public, open source libraries, but you should still treat them as separate internal products, for your own sanity.
Unit tests are necessary at this point.
Your core app should still have integration tests, but it should be small. All the heavy work should be split off into 100% unit tested packages.
A good unit test doesn't mean you write code twice, it just proves that your library listens and responds as it states on the tin.
Maybe your library calculates distances between cities:
distanceBetween('Amsterdam', 'Paris').
The implementation might be a lookup table to coordinates stored in a protected array, it might use those GPS coordinates with a haversine function, it doesn't really matter.
Your test will just call the function with a few different city pairs, and check if the distance is as you would expect. If you promise to return a float with two decimals like 514.63, you don't want it to ever be a string, or a rounded float. Maybe you specify how errors are handled when you use an unknown city, and those cases should be tested as well.
If a Flat Earther coworker changed the function to not use haversine, but simple triangulation, the test should fail because it becomes imprecise (Fuck you retard coworker, the Earth is curvy!)
That's not double work — you're NOT implementing the method twice, you're just checking input & output. -
Don't you think it’s a curious thing about our industry: not only do we not learn from our mistakes, we also don’t learn from our successes.
-
PaperBag8666yJust realized that "Dave" is almost always the name of the guy who gets fucked in stories of this kind.
Poor dave. -
Currently working on a project with 27 Tests for ~1kSLOC (Ruby on Rails), so...
can you suggest a specific brand? -
@ilPinguino
You have it good. I have to deal with 17000 tests.
Sounds pretty well covered right?
But it's for 35M lines of PHP... so that's one test for every 2000 lines of code. -
@ilPinguino Yes I call those end users. Now if only we can train them to write more detailed bug reports.
-
@bittersweet Well... This has become increasingly difficult since those electric shock collars have been prohibited in my country... A BOFHs best friend 😈
-
I would suggest it was Apple Juice except you might get some good hooch instead of rancid swill.
As I write that, this seems somewhat appropriate for Dave iOS... sometimes he gets hooch, sometimes juice, sometimes swill; every release of iOS is like closing your eyes, reaching in the fridge, grabbing the first bottle you touch and taking a swig. And some days it's like Apple has Urologists on staff who share the fridge with poor Dave. -
Well how about your boss wanted to deploy to production even if there are lots of bugs in staging site? Then will blame the team after if there are bugs occured in production? A bwautigul setup trap
-
@bittersweet
User: (bug report) it doesn’t work.
Me: (report reply) did you try it with your left hand? This is the left handed version.
User: oh, ok
Because if they are dumb enough to come to you with a stupid report like “it doesn’t work” (<- real) then they are dumb enough to do other stupid shit to provide you with some entertainment >:-). Just have to be careful to make it sound believable at their level.
1. Buy boxes of orange juice, almost past their expiry date.
2. Put boxes on the hot office windowsill for a few weeks.
3. Cool down juice in fridge.
4. "Hey dear coworker, would you like a refreshing juice box on this hot spring day?"
5. Watch coworker retch and vomit, spitting blue-grayish juice over his desk, crying: "Why would you give me old moldy juice without checking the date?"
6. "Do you remember when you told me you didn't have time for unit tests? THIS IS WHAT HAPPENS, DAVE, THIS IS WHAT FUCKING HAPPENS WHEN YOU DEPLOY UNTESTED CODE.... NOW FINISH YOUR JUICE!"
rant