Metrics for Change Size when using diff tools

本秂侑毒 提交于 2019-12-11 11:51:31

问题


Does anybody know any diff tool which counts some metrics for "Change Size". I'm searching for a diff tool that uses the diff output and reports something like:

  1. The number of changed/added/removed attributes;

  2. The number of changed/added/removed operations;

  3. The nunmber of changed class' "extends/implements";

  4. The nunmber of changed class' name/package

    ...

It should be, of course, an AST diff tool. A simple text-based diff tool won't be able to do that.

This report would be interesting to give the designer the dimension of a change between two versions of the code.


回答1:


See our SD Smart Differencer, which computes an AST-based (tree) difference and reports the changes made in terms of grammar tokens (terminals and nonterminals) and the actions applied to them (insert, delete, move, copy, rename-identifier-within).

It doesn't provide the statistics you want directly, but you could use the identified grammar tokens to classify the changes according to your categories above (you'd need the grammar to do that; use the one in the Java reference manual).



来源:https://stackoverflow.com/questions/4376977/metrics-for-change-size-when-using-diff-tools

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!