Testing practice: Irish phone numbers
I came back from holiday to find that the sprint had finished and all the stories were tested. I was pleasantly surprised, but naturally skeptical. There was a really comprehensive table (that was probably generated using an LLM) detailing test cases that covered interesting scenarios and different formats. All of the test cases were marked “passed”, but no evidence was there.
I decided to take a look myself and ended up battling with phone validation for 2 days. Here’s what I learned.
Irish Phone Numbers Are Weird
First of all, Irish phone numbers are weird. Maybe all countries' phone numbers are weird, but I don’t know. Here is what Wikipedia has to say on Irish phone number formats:
Geographic
01 XXX XXXX
– Dublin area0XX XXX XXXX
– All other 7-digit areas0XX XXX XXX
– 6-digit areas0XX XXXXX
– 5-digit areas0X0X XXXXX
– 5-digit areas
Non-Geographic
1800 XXX XXX
– Freephone/Toll Free0818 XXX XXX
– Standard Rate
Mobile
08X XXX XXXX
Mobile M2M (Machine to Machine)
088 XXXXX XXXXX
Alphanumeric dialling, using letters as mnemonics for advertising etc., is supported but is rarely used.
The interesting things that stick out to me:
- The capital city, Dublin, has a completely unique format compared to the rest of Ireland.
- There are 7-digit areas, 6-digit areas, and two types of 5-digit areas.
- Thankfully, freephone and mobile numbers seem straightforward (phew).
The Hunt for Real Numbers
The first thing I do when validating a phone or address is find an ACTUAL number.
To do that, I choose to go to Google and find a random business. Then straight away, a new type of number needs supporting — the international version.
There are two ways of formatting the international phone code:
+353
00353
Rather annoyingly, there’s a recent trend of putting the zeros in front of the code in brackets, meaning you can’t copy phone numbers into your clipboard and dial them without removing said brackets.
Formatting Chaos
Already, we are racking up quite a combination of potential numbers. Now let’s get into how people would actually use them.
For this, let’s take a random number: 01 234 5678
Depending on who you ask, people may choose to write that number in a few different ways:
- Spaceless →
012345678
- Typical →
01 234 5678
- Dashed →
01-234-5678
- Dotted →
01.234.5678
- Unhinged →
012 3456 78
- International →
+3531 234 5678
- Stuck in an airport for 20 years like Terminal →
0 0 3 5 3 1 2 3 4 5 67 8
(don’t know where this is going tbh)
Why This Matters
My point is that the way people input numbers depends on many factors:
- How they see phone numbers elsewhere
- How they read the numbers aloud
- How numbers were formatted when copied from the web
- How their computer auto-formatted them
- What generation they’re in
- Personal preference
- …and so many more.
These are things that testers love to nerd about, but actually getting other people to care is a whole different beast.
The Big Question
Then comes the real challenge: what formats do we NEED to support?
- Do clients know their users well enough to specify?
- Or is it left to the developer?
- Do we provide help text showing supported numbers?
- Is the error message clear?
All questions worth considering before anyone says, “it’s just a phone number field.”