Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide project-specific preferences #77

Open
echebbi opened this issue Jun 15, 2019 · 4 comments
Open

Provide project-specific preferences #77

echebbi opened this issue Jun 15, 2019 · 4 comments
Labels
a: feature request 📧 Ask for a new feature to be implemented for: IDE 🌒 Related to the integration of Pitclipse within Eclipse IDE for: pitest 🐦 Related to PIT integration impacts: ux 😄 Related to the user experience is: available 🏁 No one works on this yet so you can pick it priority: medium 🌥️ Must be done

Comments

@echebbi
Copy link
Collaborator

echebbi commented Jun 15, 2019

Motivation

Currently Pitclipse only allows for workspace-scope preferences. However, it would be great to allow users to set their preferences per project.

Implementation

In term of UI, this requires creating a project property page. This is not really complicated but sadly we cannot reuse the code written for the Preferences page (actually there is a way but I don't know whether it is worth the effort).

In term of core, this requires an abstraction layer between the core and the preferences so that we can uniformely use either workspace-specific or project-specific preferences. At the moment preferences are retrieved through PitCoreActivator.getConfiguration().

To this end, creating a Pitest project nature might be useful.

@echebbi echebbi added the a: feature request 📧 Ask for a new feature to be implemented label Jun 15, 2019
@echebbi echebbi added for: pitest 🐦 Related to PIT integration impacts: ux 😄 Related to the user experience is: available 🏁 No one works on this yet so you can pick it priority: medium 🌥️ Must be done for: IDE 🌒 Related to the integration of Pitclipse within Eclipse IDE labels Oct 9, 2019
@LorenzoBettini
Copy link
Collaborator

It's already possible to store a Pitclipe launch configuration in a project, but one cannot specify in the launch configuration the set of mutators to enable (by the way, it would be great to have a finer grain control on mutators to enable, e.g., for excluding/including single mutators, but probaly that's a separate issue?). I think having the set mutators (default, stronger, all) in the launch configuration would already be useful by itself

@echebbi
Copy link
Collaborator Author

echebbi commented Feb 12, 2020

It's already possible to store a Pitclipe launch configuration in a project

True, but I would consider the following points:

  • leaving RCP developers aside, I'm not sure that most Eclipse IDE users use or are even aware of launch configurations (disclaimer: I don't have any study or experience to support this point, it's just a personal feeling),
  • dedicated UI forms are easier to edit than XML (AFAIK there's no editor for launch configurations),
  • Pitclipse allows to analyze all workspace projects at once and does not take launch configurations into account,
  • in a big project one may want to run Pitest on specific packages; each one would require a distinct launch configuration,
  • configuring project's preferences from Maven (Configure project-specific preferences from Maven POM #78) requires Pitclipse to be able to handle project-specific preferences anyway.

IMO, storing a launch configuration file is more like a workaround and providing a dedicated UI would be more convenient.

it would be great to have a finer grain control on mutators to enable

Sure, but that would be a separate issue. Pitclipse currently relies on Pitest's CLI so we should be able to easily support every option available from the CLI. Regarding the mutators themselves, it seems to be only a question of UI (everything else seems to be already implemented); maybe a table with the name of the mutator, a short description and a checkable box would do? I invite you to create a dedicated issue if you want to see it implemented.

@LorenzoBettini
Copy link
Collaborator

First of all, I agree this feature would be really nice

It's already possible to store a Pitclipe launch configuration in a project

True, but I would consider the following points:

  • leaving RCP developers aside, I'm not sure that most Eclipse IDE users use or are even aware of launch configurations (disclaimer: I don't have any study or experience to support this point, it's just a personal feeling),

well, launch configurations are a crucial part in the Eclipse workbench, thus the users should be aware of that (including the fact they can store such configurations in the projects) ;)

  • dedicated UI forms are easier to edit than XML (AFAIK there's no editor for launch configurations),

launch configurations are meant to be edited through the Eclipse dialog, not directly

  • Pitclipse allows to analyze all workspace projects at once and does not take launch configurations into account,

mh... I didn't know that... or maybe I don't understand what you say

  • in a big project one may want to run Pitest on specific packages; each one would require a distinct launch configuration,

Again, that's pretty standard, even with plain JUnit launch configurations: you can have many of them, possibly stored in the projects

IMO, storing a launch configuration file is more like a workaround and providing a dedicated UI would be more convenient.

As I said, I didn't mean to decrease the importance of this feature; I was only saying that you can already store launch configurations. It's not a workaround: it's a different use case

it would be great to have a finer grain control on mutators to enable

Sure, but that would be a separate issue. Pitclipse currently relies on Pitest's CLI so we should be able to easily support every option available from the CLI. Regarding the mutators themselves, it seems to be only a question of UI (everything else seems to be already implemented); maybe a table with the name of the mutator, a short description and a checkable box would do? I invite you to create a dedicated issue if you want to see it implemented.

Yes, I will ASAP

@echebbi
Copy link
Collaborator Author

echebbi commented Feb 13, 2020

As I said, I didn't mean to decrease the importance of this feature; I was only saying that you can already store launch configurations. It's not a workaround: it's a different use case

Excuse me, I misunderstood you.

  • Pitclipse allows to analyze all workspace projects at once and does not take launch configurations into account

mh... I didn't know that... or maybe I don't understand what you say

I took a deeper look and in fact it's not all projects in the workspace but rather "selected project and the projects in its classpath". To activate this "mode":

  1. Window > Preferences > Pitest > Check All projects in workspace under Pit execution scope
  2. Create two Java projects with some tests and add the second to the classpath of the first
  3. Run Pitest on the first project
  4. Pitclipse will also run Pitest on the second project

I discovered the feature while looking at the tests and have been confused by the wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: feature request 📧 Ask for a new feature to be implemented for: IDE 🌒 Related to the integration of Pitclipse within Eclipse IDE for: pitest 🐦 Related to PIT integration impacts: ux 😄 Related to the user experience is: available 🏁 No one works on this yet so you can pick it priority: medium 🌥️ Must be done
Projects
None yet
Development

No branches or pull requests

2 participants