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

Add Boolean replacer #155

Merged
merged 3 commits into from Jul 14, 2016

Conversation

Projects
None yet
2 participants
@atodorov
Contributor

atodorov commented Jul 13, 2016

@abingham I've fixed a minor issue with the --full-report option which you probably want to cherry-pick.

Next I've enabled reports in CI to see what's going on wrong and added a Boolean replacement operator which simply flips True and False values.

ATM I'm missing tests in cosmic_ray/test/test_operators.py b/c I'm not quite sure what is the format.
Also the adam tests are failing b/c there is a while True: loop which becomes while False. I can modify the loop somehow so we always trigger an infinite loop and not conflict with the BooleanReplacer operator or maybe you can tell me what other tests to add.

Show outdated Hide outdated test_project/adam.py
@abingham

This comment has been minimized.

Show comment
Hide comment
@abingham

abingham Jul 13, 2016

Contributor

Regarding test_operators.py, what you need to do is add an entry to OPERATOR_SAMPLES containing a) the operator to be tested and b) some code that it can modify. So something like (BooleanReplacer, "True"). Basically, the tests loop over that list and ensure that each operator seems to do something sensible.

They're not perfect tests by any means, but they make sure the plumbing seems sane.

Contributor

abingham commented Jul 13, 2016

Regarding test_operators.py, what you need to do is add an entry to OPERATOR_SAMPLES containing a) the operator to be tested and b) some code that it can modify. So something like (BooleanReplacer, "True"). Basically, the tests loop over that list and ensure that each operator seems to do something sensible.

They're not perfect tests by any means, but they make sure the plumbing seems sane.

@atodorov

This comment has been minimized.

Show comment
Hide comment
@atodorov

atodorov Jul 13, 2016

Contributor

@abingham - I think I fixed it for now. while True becomes while object(), see the comments in the code.

Contributor

atodorov commented Jul 13, 2016

@abingham - I think I fixed it for now. while True becomes while object(), see the comments in the code.

# we use `while object()` instead of `while True` b/c the later becomes
# `while False` when BooleanReplacer is applied and we don't trigger an
# infinite loop.
while object():

This comment has been minimized.

@abingham

abingham Jul 14, 2016

Contributor

This is a good idea!

@abingham

abingham Jul 14, 2016

Contributor

This is a good idea!

atodorov added some commits Jul 13, 2016

Modify the infinite loop function
Don't use `while True` b/c BooleanReplacer breaks this function's
test. This is a bit ugly but until Issue #97 is fixed there is
no other way around it.

atodorov added a commit to atodorov/mutation-testing-example that referenced this pull request Jul 14, 2016

@abingham abingham merged commit a9930be into sixty-north:master Jul 14, 2016

2 checks passed

code-quality/landscape Code quality increased by 0.03%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@atodorov atodorov deleted the MrSenko:boolean_replacer branch Oct 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment