The following wikipedia page derives the expression of heat capacity of a system when holding different state variables constant: https://en.wikipedia.org/wiki/Relations_between_heat_capacities#Ideal_gas
It is shown that the relationship is given by ("blah" is the state variable being held constant): $$ C_{blah} = T \left(\frac{\partial S}{\partial T}\right)_{blah} $$
In the derivation, it is explicitly assumed that, when the gas (or whatever thermodynamic system interested) is being heated, it undergoes a reversible change. May I ask why is this assumption valid? Is it just from the definition of heat capacity?