Emojis: A Critical Path For Testing

by Eduardo Fischer

Emojis! Some of us think they’re silly and others use them whenever they can. Whatever the habits of your user base may be, you probably should be considering them as input if you aren’t already doing so. 

If you have a little experience as a tester, you’ve probably talked to at least one developer about a field that accepted invalid dates or was required but allowed empty input. But have you ever advised your developer colleague that a name field was accepting smiles or Japanese characters… and it wasn’t supposed to? Perhaps you thought that checking for emoji input was insignificant, something no one would ever do. Through experience, I’ve learned never to disregard emoji inputs as test cases.


An Error Message “Of Unknown Origin”

I used to work at a logistics startup. I was the first tester to join the company: I started as a back-end engineer and then asked to be moved into test. Since I had development experience, one of my first tasks was to help my colleague Brian debug an unknown issue. Brian was trying to migrate a users database to the new version of the project. But the database would not be migrated. I asked him to show me the error message from the database platform: it helpfully said something along the lines of “Unknown error.”


Finding The Needle In The Haystack

First, I did a web search for the message itself, but I found nothing. We tried many things after that; nothing helped. 

The following day I decided simply to look at the data in the database, thousands of rows worth, to see if it would shed any light. After about 3,000 rows, I spied something interesting: a little heart emoji in a username, almost mocking us to find it. I showed it to Brian, and at first view, he didn’t know why the emoji would be an issue. And then he remembered.  


The Root Cause: Database Encoding

Brian looked at the encoding of the databases. The older version of the project used UTF-8, while the new version used Latin-1. Emojis, Japanese characters, the euro sign, and other characters not in common use in US English are not available in Latin-1, but they are available in UTF-8. So when he tried to execute the migration to a Latin-1 encoded database, the migration failed. We lost two whole days over an emoji because the choice of encoding did not anticipate all of the use cases.


The new project’s database encoding was changed to UTF-8 and the migration was a success. After that day all user inputs were validated for the presence of emojis on both front and back ends. Since then, every time a new developer asks me why we check for emojis, I tell them this story. 


Another Cautionary Tale of Emojis Gone Wrong

Sometime after my first learning experience with emojis and encoding, I was validating that the backend rejected emojis, using Postman as my testing tool. The backend didn’t forbid emojis in the username. I wrote a bug report explaining the situation and left it at that.

The next day I read something that made me nervous. The company’s CTO announced that he was going to show the internal development version of our platform to customers. He cautioned us against displaying any jokey or unprofessional content in the user interface. So I knew I had
to make sure that no emoji would show up for that demonstration. I took the emoji test case out of my test suite, re-ran the tests… and thought that all was well.

I thought wrong: unbeknownst to me, my testing tool ran the old version of the test suite. When I did a last-minute check shortly before the presentation, all the usernames had been replaced with smiley faces!

With literal minutes to go until the presentation began, I researched the issue in the test suite execution, found the root cause, and re-ran the test suite. I was relieved to see that the usernames were once again in alphanumeric format, and the only smiling faces around now were on actual human beings.

Later that day I explained to the CTO why validating for emojis is important. He seemed satisfied with the answer and the presentation had come off well. But for a few hours I was worried about my job security. Emojis always cause me trouble… and if your team isn’t thinking about emojis as user input, they could cause trouble for you too!


Author Bio

Eduardo Fischer is a quality assurance engineer who focuses on API and UI test automation with occasional forays into load and mutation testing. He discovered his passion for testing during his time as a backend developer and eventually made testing his fulltime job. His hobbies are developing Alexa skills and making models for his 3D printer. You can find him on LinkedIn

 

You might also be interested in

Stop Tuning Out and Start Tuning In by Elizabeth Zagroba

The Software Testing Planning Checklist by Rosie Sherry

Software Testing Heuristics: Mind The Gap! by Richard Bradshaw and Sarah Deery