Git Product home page Git Product logo

pmorvalho / multipas Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 374 KB

MultIPAs: Applying Program Transformations to Introductory Programming Assignments for Data Augmentation

License: MIT License

Python 15.87% Shell 1.76% C 82.31% Batchfile 0.06%
program-repair software-engineering data-augmentation introductory-programming ipas program-transformation programming-assignments program-mutation program-mutilation c

multipas's People

Contributors

pmorvalho avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lv2020

multipas's Issues

'MutatorVisitor' object has no attribute 'pn'

Hi, thanks for the contribution! I run your code with "python3 prog_mutator.py -d inputs-demo -o mutated_programs -fw -v" and get:

Dealing with student  sum
Traceback (most recent call last):
  File "prog_mutator.py", line 847, in <module>
    gen_program_mutations(input_dir, output_dir)
  File "prog_mutator.py", line 813, in gen_program_mutations
    s_muts = instrument_file(p, output_dir+"/"+stu_id)
  File "prog_mutator.py", line 659, in instrument_file
    n_ast = v.visit(ast)
  File "prog_mutator.py", line 78, in visit
    return c_ast.NodeVisitor.visit(self, node)
  File "/home/liwei/miniconda3/envs/IPA/lib/python3.8/site-packages/pycparser/c_ast.py", line 158, in visit
    return visitor(node)
  File "prog_mutator.py", line 86, in visit_FileAST
    n_ext.append(self.visit(x))
  File "prog_mutator.py", line 78, in visit
    return c_ast.NodeVisitor.visit(self, node)
  File "/home/liwei/miniconda3/envs/IPA/lib/python3.8/site-packages/pycparser/c_ast.py", line 158, in visit
    return visitor(node)
  File "prog_mutator.py", line 207, in visit_FuncDef
    n_body_1 = self.visit(body)
  File "prog_mutator.py", line 78, in visit
    return c_ast.NodeVisitor.visit(self, node)
  File "/home/liwei/miniconda3/envs/IPA/lib/python3.8/site-packages/pycparser/c_ast.py", line 158, in visit
    return visitor(node)
  File "prog_mutator.py", line 246, in visit_Compound
    n_block_items.append(self.visit(x))
  File "prog_mutator.py", line 78, in visit
    return c_ast.NodeVisitor.visit(self, node)
  File "/home/liwei/miniconda3/envs/IPA/lib/python3.8/site-packages/pycparser/c_ast.py", line 158, in visit
    return visitor(node)
  File "/home/liwei/MultIPAs/helper.py", line 469, in visit_Return
    prv_pn = self.pn
AttributeError: 'MutatorVisitor' object has no attribute 'pn'

While I'm using the same environment as mentioned in README. And when I add a 'self.pn' under prog_mutator.py/MutatorVisitor, it works. Is it a correct fix? Thanks!

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.