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

How to make pynguin continue even when coverage reach to 100% #38

Closed
exKAZUu opened this issue Jan 23, 2023 · 1 comment
Closed

How to make pynguin continue even when coverage reach to 100% #38

exKAZUu opened this issue Jan 23, 2023 · 1 comment

Comments

@exKAZUu
Copy link

exKAZUu commented Jan 23, 2023

I want to generate various test inputs, but pynguin seems to stop when coverage is 100%.
(I plan to use pynguin to generate robust test cases from the code of the model answer in order to evaluate code submitted by various users.)

StoppingConfiguration provides maximum options, but there are no minimum (at least) options.
Is there a way to keep pynguin continue?

@exKAZUu exKAZUu changed the title How to make pynguin continue even if coverage reached 100% How to make pynguin continue even when coverage reach to 100% Jan 23, 2023
@stephanlukasczyk
Copy link
Member

stephanlukasczyk commented Feb 15, 2023

Sorry for the late reply.

Actually, there currently is no easy way of achieving this, except directly modifying the code of Pynguin's test-generation algorithms. I've just checked and each algorithm has a hard-coded early exit of the generation loop, as soon as 100% coverage is reached (e.g.

while self.resources_left() and combined_chromosome.get_fitness() != 0.0:
,
while self.resources_left() and len(self._archive.uncovered_goals) > 0:
).

If you change the source code of Pynguin and remove the respective check (the second predicate in the and conjunction, just leaving the condition to the while loop calling self.resources_left()), this should be doable. Maybe, at this point, I should add a note to my list of future features for Pynguin that this might be a good one.

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

No branches or pull requests

2 participants