Ruthlessly Helpful
Stephen Ritchie's offerings of ruthlessly helpful software engineering practices.
Fake 555 Telephone Number Prefix and More
February 28, 2012
Posted by on
Unless you want your automated tests to send a text message to one of your users, you ought to use a fake phone number. In the U.S., there is the “dummy” 555 phone exchange, often used for fictional phone numbers in the movies and television.
These fake phone numbers are very helpful. For example, use these fake numbers to test the data entry validation of telephone numbers through the user interface.
example.com, example.org, example.net, and example.edu
What about automated tests that verify email address validation? Try using firstname.lastname@example.com.
In all the testing that you do, select fake Internet data:
Fake URLs: http://www.example.com/default.aspx
Fake top-level domain (TLD) names: .test, .example, .invalid
Fake second-level domain names: example.com, example.org, example.net, example.edu
Fake host names: http://www.example.com, http://www.example.org, http://www.example.net, http://www.example.edu
Source: http://en.wikipedia.org/wiki/Example.com
Source: http://en.wikipedia.org/wiki/Top-level_domain#Reserved_domains
Fake Social Security Numbers
In the U.S., a Social Security number (SSN) is a nine-digit number issued to an individual by the Social Security Administration. Since the SSN is unique for every individual, it is personally identifiable information (PII), which warrants special handling. As a best practice, you do not want PII in your test data, scripts, or code.
There are special Social Security numbers which will never be allocated:
- Numbers with all zeros in any digit group (000-##-####, ###-00-####, ###-##-0000).
- Numbers of the form 666-##-####.
- Numbers from 987-65-4320 to 987-65-4329 are reserved for use in advertisements.
For many, changing all the SSNs to use the 987-00-xxxx works great, where xxxx is the original last four digits of the SSN. If duplicate SSNs are an issue then use the 666 prefix or 000 prefix (or use sequential numbers for the center digit group) as a way to resolve duplicates.
Source: http://en.wikipedia.org/wiki/Social_security_number#Valid_SSNs
More Fake Data
There are tons of sources of fake data out on the Internet. Here is one such place to start your search:
http://www.quicktestingtips.com/tips/category/test-data/
Good tips, Stephen. I didn’t know about those reserved top-level domains — that’s good stuff!
Also, I see you’ve finally acknowledged the uniqueness of SSNs ;-)