LRUs are designed to specifications. The specification defines the inputs and outputs. It also defines the tools to replace the unit (usually nothing more than a #2 Phillips-head screwdriver), and the bulk and weight (they always need to be carried by one man, and fit through a door, if possible). There are also requirements for flammability, unwanted radio emissions, resistance to damage from fungus, static electricity, heat, pressure, humidity, condensation drips, vibration, radiation and other environmental measurements.
Many LRUs for commercial aircraft are designed according to ARINC specifications. ARINC (Aeronautical Radio Incorporated) is a company owned by a number of airlines, that sells specifications and sets standards. LRUs are also defined by manufacturers like Airbus and Boeing, or various military organizations.
LRUs are painted crackle-black to more efficiently radiate and convect heat away from the unit.