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

Developer-Oriented Amplification for the Test Cube Plugin #993

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

lacinoire
Copy link
Contributor

This pull request contains the adaptations I made to DSpot to let it generated smaller and better explained (though maybe weaker) test cases for the Test Cube IntelliJ Plugin.

As it contains many changes, I want to summarize and explain the main points:

New "main" class DevFriendlyAmplification

This class is analogous to the class DSpot , orchestrates the developer friendly test amplification and is called from DSpot when the option --dev-friendly is passed.

In a nutshell, the developer-friendly amplification:

  • removes assertions at the end of a test case completely (also the statements in the assertions)
  • adds only one new assertion per test case, so returns multiple test cases with the same input-amplification but each different assertions
  • uses the ExtendedCoverageSelector to keep test cases that cover more instructions on any line

New ExtendedCoverageSelector + connected classes

Selects test cases that cover more instructions (than the original test suite) on any line of code and provides a detailed report in which lines how many more instructions are covered.

The selector uses the new, more detailed information from test-runner 2.3.0

Fine-grained options for generated comments

I extended the comment generation to each amplifier.

In addition, the JacocoCoverageSelector and the ExtendedCoverageSelector can add JavaDoc comments about the improved coverage above each test case.

The new CommentEnum allows to configure which comments should be included (None, only Amplifiers, only Coverage, all comments).

Tests of new functionality

This PR includes the following tests:

  • a new MainTest with the --dev-friendly option
  • tests of the new comments, especially for the two coverage selectors. Adaptations to some existing tests to correctly set comment option.
  • tests of the ExtendedCoverageSelector , especially calculation of the difference in coverage per line

@danglotb
Copy link
Member

Thank you for the hard work! :feelsgood:

I parse most of the code and did appreciate your pull-request.

The new mode of dev seems really cool!

On one hand, I would like to see some details in the README, on the other hand, the README is already pretty big.
Anyway, if you can, maybe later, gives some details and maybe a real use case example, it would be great!

I'm ok to merge the code changes, if it is ok for you.

Thank.

@lacinoire
Copy link
Contributor Author

Thanks for the review 😊u

Indeed, the new functionality is not really documented. Or shown off how cool it is! 😉
I'll add sometihng with my next changes (is in the works for the current paper submission anyways).i

I would be happy with a merge 😄

@danglotb
Copy link
Member

Great! I then merge this one and wait to see your next contributions.

Happy hacking and I wish you good findings 😃

@danglotb danglotb merged commit 481a680 into STAMP-project:master Jul 22, 2021
@lacinoire lacinoire deleted the test-cube-squashed branch July 22, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants