If you were given a legacy codebase with minimal documentation, how would you approach understanding and improving it?

Situational