• Post Reply Bookmark Topic Watch Topic
  • New Topic

Paper source code analysis  RSS feed

 
Luca Cordero
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone i'm a newbie and I want to find a method to fast analyse source code logic on paper.
That can be useful in various cases and also to improve speed in doing exercize during certification exam.

For example:

Answering a question in the exam Im sure that code compile.
Now, what's the best way to analyze with pen and paper the source code logic?

I hope my question is clear(im not so good in english,I know...)

Thanks everybody!

Luca
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

When you say analyse I take it you mean walking through the code as if you are the computer to check the output will be as expected.

If I'm doing this I draw up a table with the first column being the code line number and then I have a column for each variable which will be in scope.
On the first row I enter the starting values of each of the variables and then I mentally execute the first line of code and enter the new values of each variable that has changed. I repeat this process for each line of code until I have completed the task.
 
Luca Cordero
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's what I meant.
Thank you!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!