I'll address your second question first. With respect to coverage testing, Treas. Reg. 1.410(b)-8(a) provides that plans may satisfy the coverage test using a daily testing option, a quarterly testing option, or an annual testing option. In practice, most plans will satisfy coverage using the annual testing option, but the other options may provide better results in certain circumstances. For nondiscrimination, Treas. Reg. 1.401(a)(4)-1(c)(3) provides that the nondiscrimination requirements will generally be met on the basis of the plan year.
For the definition of compensation used to apply the various tests, you have to look at the test in question. For the ADP test, for example, compensation is defined in Treas. Reg. 1.401(k)-6, to mean compensation as defined in 414(s) and 1.414(s)-1, measured over either the plan year or calendar year, or the portion of the year in which the employee was eligible. For the top heavy minimum, however, the definition of compensation - as per Treas. Reg. 1.416-1 M-7 and T-21 - is the definition in 1.415(c)-2 and you do not get the option to measure it over just the period of the year in which the employee was an eligible participant. For HCE determination, Treas. Reg. 1.414(q)-1T Q&A-13 references IRC 415(c)(3).
In general, the term "compensation" doesn't mean the employee's stated rate of pay, but rather the amount actually paid by the employer to the employee. A popular definition of compensation is the amount shown in box 1 of the employee's W-2, plus deferrals. However, compensation is a complex topic and this is only scratching the surface of it.