Can we determine if a program is well working by considering the following questions?
- Memory is succesfully reclaimed by the Operating system
- There is no Stack Overflow
after writing and running some code to determine whether there is any overflowing going on?
Our assistant give us feedback after running our program through some other program.
In the feedback, it shows whether if there was an overflow , whether we were using using free / delete in wrong way, and some other things.
I wonder How did she found out ?
You say that person has the source code – that means he can analyze the program – either by reading and thinking or by using some clever program.
For example he could see the following:
and then it’s obvious to him that once
someConditionisn’t metdelete[]is not called and that’s a sure memory leak.That’s called static code analysis.