Part of the QA steps required for a project I am tangentially involved with requ
ID: 653046 • Letter: P
Question
Part of the QA steps required for a project I am tangentially involved with require the person who is responsible to integrate new version of source file to first calculate how many lines have been added, removed and "changed". Changes may include physically move a whole function or procedure around the source file (without altering the content, just reorganization) and this is counted as "no change" while actually altering a line, say from
a=b;
to
a=b--;
Of course the matching should not include extra spaces or comments.
The question is: can you point to something (I suppose a Perl script would be enough as a starter) that given two version of a file can:
Remove comments Count added, removed and "modified" lines, giving the three results, and not counting whole functions/procedures which have been moved up or down in the file without altering the workings?
Language is C/C++.
At the moment this is done by diff-ing the two source files and manually counting the lines. The result needs not to be precise to the line - basically if you get over a certain quota of "significant changes" the source goes through a more complicated integration/testing phase, so as long as the results are close enough to actual changes it's ok, in case of "too many changes" it will be reviewed by a human anyway.
Explanation / Answer
Scooter Software do a great tool - Beyond Compare. that is language aware and can filter unimportant changes. However it is commercial and GUI - so may not be able to do what you ask. They have a full function eval period and it's not expensive if you want to check it out.
Beyond that, one of the rules of software development in an environment such as yours is (I will get slaughtered here for saying, but please here me out.) "If it ain't broke don't fix it". In your case, QA needs to carefully define "broken" for you work place. Why are people changing white space? Did that routine really need to be moved? Did the "a=a+1;" really need to be re-factored to "a++;" Software engineering (where you have a QA process) is no longer an individual choice.
As far as your QA rules go, I would suggest any change to source code is a change that needs measuring. You need to do measure "trivial", "meaningless" and "unimportant" changes - these are costing money - is it needlessly, as if so its wasted effort. If it's adding value, why is the tool not reporting it- either way it's a QA function to know this - the tool should report it. If you are ignoring these changes, you are not really doing QA.
You won't be able to automate it either - For instance, no tool can tell you if a comment change was needed or not - only a person can read a comment and check it's validity, what about code formatting, or variable naming (e.g. This change makes it more readable). Its all very subjective.......
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.