If heat $Q$ flows from the surrounding nature temperature at $T_\text{surr}$ to the system at temperature $T_\text{system}$, then $$\Delta S_\text{total}=\frac{+Q}{T_\text{system}}+\frac{-Q}{T_\text{surr}}$$
This definition is from my book in which heat is exchanged between system and surrounding. This formula for me would only be valid when both the system and the surrounding is undergoing reversible processes but nothing about it is said over here. Does this mean this formula assumes both the heat gained and heat lost are rebersible processes? Isn't entropy defined for reversible processes?