On Tue, Jun 24, 2014 at 01:48:42PM +0200, Josef Reidinger wrote:
On Fri, 13 Jun 2014 15:16:52 +0200 Martin Vidner <mvidner@suse.cz> wrote:
Some options how to decide WHAT to refactor:
1. Measure code quality everywhere (with metric_fu) and pick the worst code. 2. Measure code changes (metric_fu churn), assuming what has changed in the past will need change in the future. 3. Count bugs. Probably hard on a file level but easy on a package level by counting "bnc" in *.changes. That counts fixed bugs, not reported ones. 4. Count feature requests (done and pending).
I think 2 and 4 make sense, as 3 is usually just subset of 2 and 1 can affect code that we do not want to touch and hope noone use it :)
Problem of 2-4 is that it only count final place, but often when I debug code or considering where to implement it I need to study how it works now and it often need to read some ugly code and found, that in the end I need to modify different file used from this ugly code, but I think it is acceptable tradeoff.
What to refactor I have used dirty cheap tricks to produce some initial metrics to help us decide what to refactor, on a package level. Pepa has also suggested other metrics, but they work on file level and are not so cheap. Top 10 results are inlined, complete in attachments. 1) Churn Take the number of version bumps for a package between oS 13.1 and SLE12. Conveniently, they all start at 3.1.0 :) cd ~/github-checkout/yast grep ^Version yast-*/package/*.spec | sort -k2 -V -r yast-installation/package/yast2-installation.spec:Version: 3.1.97 yast-yast2/package/yast2.spec:Version: 3.1.82 yast-registration/package/yast2-registration.spec:Version: 3.1.82 yast-network/package/yast2-network.spec:Version: 3.1.67 yast-bootloader/package/yast2-bootloader.spec:Version: 3.1.61 yast-autoinstallation/package/autoyast2.spec:Version: 3.1.41 yast-storage/package/yast2-storage.spec:Version: 3.1.33 yast-users/package/yast2-users.spec:Version: 3.1.27 yast-packager/package/yast2-packager.spec:Version: 3.1.25 yast-theme/package/yast2-theme.spec:Version: 3.1.21 2) Features Count "FATE" in the changelog. Cheat by going over the whole changelog, not cutting off at oS 13.1. grep --ignore-case --count fate yast*/package/*.changes | sort -t: -k2 -n -r yast-installation/package/yast2-installation.changes:126 yast-network/package/yast2-network.changes:69 yast-yast2/package/yast2.changes:60 yast-storage/package/yast2-storage.changes:60 yast-packager/package/yast2-packager.changes:50 yast-bootloader/package/yast2-bootloader.changes:43 yast-autoinstallation/package/autoyast2.changes:33 yast-pkg-bindings/package/yast2-pkg-bindings.changes:19 yast-users/package/yast2-users.changes:17 yast-registration/package/yast2-registration.changes:14 3) Bugs Analogous to Features grep --ignore-case --count bnc yast*/package/*.changes | sort -t: -k2 -n -r yast-installation/package/yast2-installation.changes:392 yast-network/package/yast2-network.changes:379 yast-yast2/package/yast2.changes:340 yast-storage/package/yast2-storage.changes:338 yast-packager/package/yast2-packager.changes:291 yast-bootloader/package/yast2-bootloader.changes:234 yast-autoinstallation/package/autoyast2.changes:150 yast-registration/package/yast2-registration.changes:128 yast-printer/package/yast2-printer.changes:123 yast-country/package/yast2-country.changes:116 Have you noticed Features and Bugs have the exact same packages in top 7 places? -- Martin Vidner, Cloud & Systems Management Team http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu