Automatic Self-Test Circuit in GFCI outlet
What kind of self-test circuits or method do they used in the GFCI outlets generally? 


An temporary imbalance (leak) between the hot and neutral is created, and the GFCI circuit should detect it.


  Is it just firmware or is there a physical addition.


There is a physical addition: a resistor for creating a leak, some kind of switch for connecting and disconnecting this resistor.  (By the way, most GFCI deices are hard-wired, and they don't have microcontrollers with firmware.)

I've designed an GFCI (RCD) circuit once, and it has a self-test.  R9 provides the controlled leakage.  U2 is the solid state relay for connecting the R9 during self-test and disconnecting it the rest of the time.