Systematic and scientific approach to analyse source code for understanding
3 22 Jul 2015 14:46 by u/munoi
Hello communtiy,
I have to extend some unfamiliar source code and also write some paper about it. To do so I want to document, how I dive into the unfamiliar code.
Is there some step by step guide somewhere, that describes, how I should approach software to get to know it? Like a top down approach: - Find all its dependencies (third-party-libraries) - Check the folders/packages/modules out and - See what design patterns were used - Go to the entry-point and check flow ...
I tried to google something like "code analysis" but always get some tools for metrics which I am not interested in. I want to find a method to get to know what some kind of software (source code) does.
2 comments
3 u/pm_me_or 22 Jul 2015 16:11
Strangely, I read "unfamiliar source code" as "hostile source code". Because it often is.
You'll sometimes even wonder if the coder has volontarily overcomplicated everything (e.g. sliced a simple flow in multiple callback-ridden subprocesses) just to screw with you.
But more seriously, I do not know a simple method to read hostile code. I work in a SaaS-architectured IS, so my experience may not be applicable to your current problem, but what I do is :
All in all, welcome to hell.
0 u/ITW 24 Jul 2015 00:42
I'd say this is a good answer. It really depends on what kind of project it is though.