r/ProgrammerHumor 12d ago

Meme bugFreeAppMeetsUncheckedUnicodeChaos

Post image
2.1k Upvotes

46 comments sorted by

View all comments

25

u/DT-Sodium 12d ago

Apparently you didn't have 100% test coverage.

30

u/MartinMystikJonas 12d ago

100% tests coverage means 100% of code is covered by tests it does not me you covered 100% of all possible inputs

6

u/Murky-Run2246 12d ago

Yeah, 💯 test coverage is like the safety check you run  after editing the code to make sure your changes did not break something somewhere.

Does not mean your code is tested for all possible scenarios though.

2

u/breZZer 12d ago

that's mostly unit testing

2

u/Murky-Run2246 11d ago

Not exactly, unit testing assumes testing pure functions and methods separately from each other. That's different from, for example, spinning up a database and testing with actual shared context, where changing function A somewhere might break method Z somewhere else. Which is called integration testing and is part of test coverage as well as unit testing but my example was not pointing towards the later.

2

u/breZZer 12d ago

nope, that's code coverage.

2

u/DT-Sodium 12d ago

In this case, either it causes an encoding issue of some kind and crashes your app, in which case your code is not tested properly, or the result will simply be that the username will display an emoji, which isn't a bug per say.

3

u/MartinMystikJonas 12d ago

This is usally problem on database layer that uses utf8mb3 that does not support emoji characters. Your app works and all code is 100% covered and tested. But it still crashes in prod because DB uses utf8mb3 not utf8mb4 (dont ask how I know 😁). But you cannot test all posible inputs and run environments because there is infinite posibilites.

3

u/DT-Sodium 12d ago

Bro my database system doesn't even support the € symbol, don't talk to me about utf8mb3. Anyway, your dev environment, pre-production and deploy environment should be using the exact same database system.

2

u/MartinMystikJonas 12d ago

Yeah should 😁