Reported observations in H alpha, Ca II H, and K or other chromospheric lines of coronal rain trace back to the days of the Skylab mission. Corresponding to cool and dense plasma, coronal rain is often observed falling down along coronal loops in active regions. A physical explanation for this spectacular phenomenon has been put forward thanks to numerical simulations of loops with footpoint-concentrated heating, a heating scenario in which cool condensations naturally form in the corona. This effect has been termed "catastrophic cooling" and is the predominant explanation for coronal rain. In this work, we further investigate the link between this phenomenon and the heating mechanisms acting in the corona. We start by analyzing observations of coronal rain at the limb in the Ca II H line performed by the Hinode satellite, and derive interesting statistical properties concerning the dynamics. We then compare the observations with 1.5-dimensional MHD simulations of loops being heated by small-scale discrete events concentrated toward the footpoints (that could come, for instance, from magnetic reconnection events), and by Alfven waves generated at the photospheric level. Both our observation and simulation results suggest that coronal rain is a far more common phenomenon than previously thought. Also, we show that the structure and dynamics of condensations are far more sensitive to the internal pressure changes in loops than to gravity. Furthermore, it is found that if a loop is predominantly heated from Alfven waves, coronal rain is inhibited due to the characteristic uniform heating they produce. Hence, coronal rain may not only point to the spatial distribution of the heating in coronal loops but also to the agent of the heating itself. We thus propose coronal rain as a marker for coronal heating mechanisms.