[GSoC17] Introduction and questions about the Metrics Framework project

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[GSoC17] Introduction and questions about the Metrics Framework project

Clément Fournier
Hello everyone,

My name is Clément Fournier, and I'm a French undergraduate student in software engineering, currently studying in Rennes, Brittany, France. I don't have much experience with open-source development (although I'm writing a plug-in for the weka machine-learning environment at the moment), but I'm very interested in acquiring first-hand experience on more projects and getting a taste of the open-source culture. 

I first heard of the Google Summer of Code program a few days ago, and discovered the PMD project and its list of Project Ideas with enthusiasm not so long ago too. I'm impressed with the ease of use of the utility you're building, seeing its obvious underlying complexity. Moreover, your Project Ideas page describe some projects which seem to meet my level of Java programming, while being challenging enough to stay interesting and fun for a long time!

I'm specifically interested in the project that aims to implement an object-oriented code metrics framework. I have a few questions about it, and I believe (correct me if I'm wrong) that this mailing list is the place to discuss such projects.

--- Questions

The project description mentions integrating the metrics framework directly into the core module of PMD. 
  • Am I correct in assuming that the core Metric Framework should provide only language-independent utilities? 
  •  If so, since the expected output includes a refactoring of GodClassRule (which is Java-specific), does the project also, as I assume, imply producing a Java-specific framework inside pmd-java ?
  • Is the production of a language-independent metric framework that scales to any object-oriented language in the scope of this project? Or is that off-topic and I should concentrate on making a Java-specific framework?

I have begun to dive into the Data flow analysis and Type resolution frameworks to understand how your project is organised and how you mean the metric framework to be implemented. I'll most certainly follow-up with a few questions when I have a bigger picture. For now, could someone provide insight on this sentence of the project description : 

The metric gathering should probably work like Data Flow Analysis and type resolution, on a first stage before rules are applied, and only if any active rules needs it.
  • Does that mean metric calculations would be initialised by a preprocessing of the files before rules are applied, and then calculated by rules that ask for it? Or rather that the calculations are entirely performed before the rules are processed?

Side question: the project description mentions the book Object-Oriented Metrics in Practice, which I would gladly avoid buying if I can, since it's not freely available on the internet. Could anyone lend me a copy of the ebook in the event my project is accepted? 

---

Thank you for your time, and I'm looking forward to working with you! 

Cheers,

Clément Fournier
Institut National des Sciences Appliquées (INSA) Rennes

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Pmd-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmd-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GSoC17] Introduction and questions about the Metrics Framework project

Andreas Dangel-2

Hi Clément,

first of all: thanks for your interest in PMD!

This mailing list is indeed the correct place to discuss this project. I'll try to answer your questions:

Am I correct in assuming that the core Metric Framework should provide only language-independent utilities?
Not necessarily. I imagine there is a language-independent part like interfaces, reporting and calling the language-dependent code to calculate the metrics. This includes marking a language module as "metric-supported" (like type resolution supported) and somehow provide access to the collected metrics from within a rule. The other part is language-dependent, I guess. It covers the actual implementation of the metrics gathering and also the rules, that use and combine multiple metrics and compare it to specific thresholds in order to detect violations.


  •  If so, since the expected output includes a refactoring of GodClassRule (which is Java-specific), does the project also, as I assume, imply producing a Java-specific framework inside pmd-java ?

In theory, we could have a concept of generic object oriented metrics and generic rules, that operate on these metrics. But at the moment, there are no rules, that work with multiple languages at the same time. So I'd start by concentrating first on Java and have a look in the next step, what we could abstract/generalize to make it easier, to add such metric-based rules for other languages. If you start in this order, I assume, you'll have faster first visible results.

  • Is the production of a language-independent metric framework that scales to any object-oriented language in the scope of this project? Or is that off-topic and I should concentrate on making a Java-specific framework?

It would be nice, indeed. But the scope should be realistic. As mentioned above, I'd start with Java and improve/enhance it in the next steps as needed for other languages.



The metric gathering should probably work like Data Flow Analysis and type resolution, on a first stage before rules are applied, and only if any active rules needs it.
Does that mean metric calculations would be initialised by a preprocessing of the files before rules are applied, and then calculated by rules that ask for it? Or rather that the calculations are entirely performed before the rules are processed?

I guess, it will always be a combination :) The rules, as they are implement now, operate always on a single file/java class. So, the rule does not have an overview of the whole project, that is analyzed. That's why it makes sense, to have an extra step for the metrics gathering before actually executing a rule, since some metrics depend on the more than a single class (e.g. average method count per class). The rules, that opt-in for the metrics, will then be provided *somehow* with a set of precalculated metrics. I assume, that this makes a single rule very simple and short. The rules might share a common base case or need to implement an interface or there might be a Helper class for such rules.

If we take the GodClass rule as an example, it depends on 3 metrics: Access To Foreign Data (ATFD), Weighted Method Count (WMC) and Tight Class Cohesion (TCC). These metrics are calculated ideally before executing the rule, so that the rule just needs to compare these metrics to the configured thresholds.


Side question: the project description mentions the book Object-Oriented Metrics in Practice, which I would gladly avoid buying if I can, since it's not freely available on the internet. Could anyone lend me a copy of the ebook in the event my project is accepted?
Yes, that should not be a problem :)



In general, I'd start by cloning PMD from https://github.com/pmd/pmd , building it locally to ensure, all tools are working. And import it into your favorite IDE (if you didn't do that already). And I'd start to create a high-level plan of the steps ("building blocks") you want to do, so that we can better see, whether it's realistic in terms of time. We can always adjust the plan on the way, don't worry. Feel free to start a new page in the wiki https://github.com/pmd/pmd/wiki for the Metrics Framework.


And if you have any further questions, don't hesitate to ask! We are here to help :)


Regards,

Andreas




Am 09.03.2017 um 01:52 schrieb Clément Fournier:
Hello everyone,

My name is Clément Fournier, and I'm a French undergraduate student in software engineering, currently studying in Rennes, Brittany, France. I don't have much experience with open-source development (although I'm writing a plug-in for the weka machine-learning environment at the moment), but I'm very interested in acquiring first-hand experience on more projects and getting a taste of the open-source culture. 

I first heard of the Google Summer of Code program a few days ago, and discovered the PMD project and its list of Project Ideas with enthusiasm not so long ago too. I'm impressed with the ease of use of the utility you're building, seeing its obvious underlying complexity. Moreover, your Project Ideas page describe some projects which seem to meet my level of Java programming, while being challenging enough to stay interesting and fun for a long time!

I'm specifically interested in the project that aims to implement an object-oriented code metrics framework. I have a few questions about it, and I believe (correct me if I'm wrong) that this mailing list is the place to discuss such projects.

--- Questions

The project description mentions integrating the metrics framework directly into the core module of PMD. 
  • Am I correct in assuming that the core Metric Framework should provide only language-independent utilities? 
  •  If so, since the expected output includes a refactoring of GodClassRule (which is Java-specific), does the project also, as I assume, imply producing a Java-specific framework inside pmd-java ?
  • Is the production of a language-independent metric framework that scales to any object-oriented language in the scope of this project? Or is that off-topic and I should concentrate on making a Java-specific framework?

I have begun to dive into the Data flow analysis and Type resolution frameworks to understand how your project is organised and how you mean the metric framework to be implemented. I'll most certainly follow-up with a few questions when I have a bigger picture. For now, could someone provide insight on this sentence of the project description : 

The metric gathering should probably work like Data Flow Analysis and type resolution, on a first stage before rules are applied, and only if any active rules needs it.
  • Does that mean metric calculations would be initialised by a preprocessing of the files before rules are applied, and then calculated by rules that ask for it? Or rather that the calculations are entirely performed before the rules are processed?

Side question: the project description mentions the book Object-Oriented Metrics in Practice, which I would gladly avoid buying if I can, since it's not freely available on the internet. Could anyone lend me a copy of the ebook in the event my project is accepted? 

---

Thank you for your time, and I'm looking forward to working with you! 

Cheers,

Clément Fournier
Institut National des Sciences Appliquées (INSA) Rennes


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford


_______________________________________________
Pmd-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmd-devel


-- 
Andreas Dangel
https://github.com/adangel
skype: andreas_dangel

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Pmd-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pmd-devel