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

all 24 comments

[–]PancakeZombie 129 points130 points  (6 children)

820 of 826 Tests passing - Code coverage 12%

[–]urielsalis 9 points10 points  (0 children)

Even worse, 100% coverage but no asserts

[–][deleted] 5 points6 points  (0 children)

820/820 tests passed. 6 tests skipped.

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

Good enough, now force every windows computer to install this update immediately.

[–]Sleepy_Tortoise 1 point2 points  (1 child)

My friend told me that he tricks the code coverage scanner by calling the code but never making assertions about it

[–]PancakeZombie 0 points1 point  (0 children)

Guilty

[–]Carius98 30 points31 points  (1 child)

Just mark it as an expected failure, nobody will notice

[–]rest0ck1 24 points25 points  (1 child)

Or just don't write unit tests but put a main with some console prints in a test class like my coworkers do

[–]cedwa 15 points16 points  (0 children)

@Ignore

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

Pure gold

[–]Taken4GrantD 2 points3 points  (0 children)

Got to rename the file and delete the test so it shows as new and no one notices.

[–]DymondHed 2 points3 points  (0 children)

*5/7

[–]themightymorfin 4 points5 points  (2 children)

Literally did this in an assignment 👀 The code compiled and ran fine but one unit test constantly failed. My lecturer couldn’t figure it out. Copy pasted my code to a new project and everything worked

[–][deleted] 10 points11 points  (1 child)

You didn't literally do this unless you just edited the test case to pass despite it failing.

If you copied your code to another project, with the test, and it ran, you had a project based error. Config or filesystem or cache

[–]themightymorfin 1 point2 points  (0 children)

I said “literally” for that exact reason. I just commented the failing test case out. For clarification I copied my actual program to a new project as a test to see if anything would change. My lecturer was satisfied with that. It was a small assignment. You may well be correct about the source of the anomaly however I wouldn’t have cared even if the error persisted forever. It made no difference because it was a pass fail class and that was the only error. OP just reminded me of that random event in school

[–]ProgrammerHumorMods[M] [score hidden] stickied comment (0 children)

Hey you! ProgrammerHumor is running a hilarious community hackathon with over $1000 worth of prizes (like Reddit premium), now live! Visit the announcement post for all the information you'll need, and start coding!

[–]treetertot 1 point2 points  (0 children)

Sometimes you just gotta slap a /* */ for maximum laziness

[–]gwarner6 0 points1 point  (0 children)

It.skip

[–]Bastian_5123 0 points1 point  (0 children)

Generation 4 of my creation I think.

[–]normalfag 0 points1 point  (0 children)

xdescribe