Using Faker to generate to generate job titles


(Daniel Hollands) #1

For my current project I need to create a table of certificates and/or job titles which people can be qualified in. Feeling incredibly uninspired, I decided to use the Faker gem to help me out.

By combining the Faker::Company.buzzword and Faker::Company.profession generators, I’ve been able to generate some amazing job titles, which I wanted to share with you:

  • “fresh-thinking economist”
  • “software firefighter”
  • “foreground advocate”
  • “Cross-platform biologist”
  • “Ameliorated human resources”
  • “Business-focused astronomer”
  • “pricing structure judge”
  • “complexity architect”
  • “Cross-group engineer”
  • “Realigned accountant”
  • “mission-critical economist”
  • “Realigned firefighter”
  • “methodology engineer”
  • “upward-trending engineer”
  • “Pre-emptive writer”
  • “coherent human resources”
  • “human-resource designer”
  • “clear-thinking writer”
  • “asynchronous agriculturist”

(Daveyon Mayne) #2

What’s the difference between the faker gem and adding few infomation in the seed.rb?


(Daniel Hollands) #3

The Faker gem allows for the creation of dynamic content for use in testing. I personally use it in Fabricators (similar to Factories) for TDD purposes:

Fabricator(:user, aliases: [:users]) do
  username { Faker::Internet.user_name }
  email { Faker::Internet.email }
  password { Faker::Internet.password }
end

… which is really handy if you need to generate multiple records - i.e. using the Faker gem, rather than static content, means you don’t get duplicate records.

But I also within a development seed file (via their fabricator), which I use if I need some fake data to populate a site for design and frontend development purposes.

The thing is, the Rails seed.rb file is a bit crap, as it’s not a particularly good implementation of how seeds should work for production. Far better to use something like Seed Fu.

(I fear this hasn’t actually answered your question tho).


(Greg Robson) #4

@LimeBlast I bet if you go to Silicon Valley, half of those job titles exist!


(Andy Wootton) #5

I dislike misuse of the word “methodology” but I’m deffo putting “methods engineer” on my CV :slight_smile:


(Steve Jalim) #6

/me bags "software firefighter"


(Daniel Hollands) #7

Further to this, I’ve just noticed some other humourous side effects of using the Faker methods outside their designed parameters.

In this particular instance I’m using their Faker::Hacker.abbreviation to generate initials for customers (along with the existing Faker::Name.prefix and Faker::Name.last_name for their title and surname), which as resulted in the following:

  • Miss JSON Steuber
  • Ms. IB Dooley
  • Miss XML Koss
  • Miss TCP D’Amore
  • Ms. IB Terry
  • Mr. SCSI O’Keefe
  • Mr. AGP Abbott
  • Mrs. TCP Gislason
  • Miss SMTP Renner
  • Dr. RAM Murphy
  • Ms. SMTP Schmidt
  • Miss SQL Mann
  • Mrs. RAM Schiller
  • Mr. SMS Lind
  • Mrs. SCSI Fisher
  • Ms. FTP Wilkinson