GithubHelp home page GithubHelp logo

renatahodovan / picire Goto Github PK

View Code? Open in Web Editor NEW
46.0 7.0 9.0 249 KB

Parallel Delta Debugging Framework

License: Other

Python 99.04% Shell 0.47% Batchfile 0.49%
delta-debugging test-reduction test-automation hacktoberfest

picire's People

Contributors

akosthekiss avatar drmaciver avatar loki04 avatar renatahodovan avatar vincedani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

picire's Issues

"Initial test contains 15 boths" message when running picire in --atom=both mode

As per title: If you use the --atom=both flag then the initial message about the test case size says that the file contains (say) 15 "boths". This is presumably the line count (at least, the numbers agree), so it should say 15 lines.

It correctly reports "characters" rather than "boths" for the second run when it minimizes by character.

(I apologise for how incredibly nitpicky this issue is)

AssertionError if initial run is not interesting

When I try to run picire with an uninteresting initial run, it crashes with an assertion failure:

Initial test contains 4 lines
Iteration #0
Run #0
	Config size: 4
Traceback (most recent call last):
  File "REDACTED/picire/.venv/bin/picire", line 8, in <module>
    sys.exit(execute())
  File "REDACTED/picire/picire/cli.py", line 286, in execute
    out_src = reduce(args.src,
  File "REDACTED/picire/picire/cli.py", line 249, in reduce
    min_set = dd(list(range(len(src))))
  File "REDACTED/picire/picire/dd.py", line 63, in __call__
    assert self._test_config(config, (f'r{run}', 'assert')) is Outcome.FAIL
AssertionError

I expected picire to exit and state that the initial run is uninteresting.

Steps to reproduce

Here is the example I used:

(.venv) picire % cat foo.txt
a
b
c
d
(.venv) picire % cat dumb_tester.sh
#!/usr/bin/env bash

exit 1
(.venv) picire % picire -i foo.txt --test ./dumb_tester.sh

I'm using commit 63668bb0409f4078ff84564065d161661bd388ae

Misc

I'm currently using the following patch as a workaround:

diff --git a/picire/dd.py b/picire/dd.py
index 888679d..ffeef28 100644
--- a/picire/dd.py
+++ b/picire/dd.py
@@ -60,7 +60,12 @@ class DD(object):
             for run in itertools.count():
                 logger.info('Run #%d', run)
                 logger.info('\tConfig size: %d', len(config))
-                assert self._test_config(config, (f'r{run}', 'assert')) is Outcome.FAIL
+                outcome = self._test_config(config, (f'r{run}', 'assert'))
+                if run == 0 and outcome is Outcome.PASS:
+                    # Initial run is not interesting, so we can't expect any
+                    # reductions or subsets to be interesting either.
+                    break
+                assert outcome is Outcome.FAIL

                 # Minimization ends if the configuration is already reduced to a single unit.
                 if len(config) < 2:

but it cannot distinguish between an uninteresting initial run and an interesting run that requires all inputs.

P.S. This tool is great! It's saved me a lot of debugging time.

EDIT: updated the patch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.