How does the NATO code name system work, are they just random names, or is there some sort of rule(s)?
From Wiki


  They provide unambiguous and easily understood English words in a
  uniform manner in place of the original designations, which either may
  have been unknown to the Western world at the time or easily confused
  codes.


Much the like the NATO alphabet rules the names but be easy to understand (possibly under multiple speaking accents) and must be non ambiguous. 

The following rules are also applied 


  Aircraft
  
  The first letter indicates the type of aircraft, like
  Bear for a bomber aircraft, or Fulcrum for a fighter aircraft. 
  
  F —
  fighter aircraft, also later ground attack aircraft: List of NATO
  reporting names for fighter aircraft 
  
  B — bomber aircraft: List of NATO
  reporting names for bomber aircraft 
  
  C — commercial aircraft and
  airliners, and cargo aircraft: List of NATO reporting names for
  transport aircraft 
  
  H — helicopters: List of NATO reporting names for
  helicopters 
  
  M — Miscellaneous; trainers, reconnaissance, seaplanes,
  tankers, AEW etc.: List of NATO reporting names for miscellaneous
  aircraft 
  
  For fixed-wing aircraft, one syllable names were used for
  propeller-powered craft (turboprops included), while two-syllable
  names indicated jet engines.