Code Monkey home page Code Monkey logo

patchbundle's Introduction

PatchBundle

A Framework for Manipulating Existing Datasets of Security Patches for Automatic Program Repair Techniques and Studies

Prerequisites

Python Dependencies

Baseline

The baseline usage involves three operations: collect, transform and filter.

Collect

Collect from the specified source the dataset. The dataset is downloaded to the folder PatchBundle/data/collected/'name_of_the_dataset'

$ ./tool/PatchBundle.py collect --datasets nvd, mozilla, secretpatch, secbench

Transform

Transforms the collected dataset's records into the PatchRecord format. The dataset is saved in the folder PatchBundle/data/transformed/'name_of_the_dataset'

$ ./tool/PatchBundle.py transform --datasets nvd, mozilla, secretpatch, secbench

Filter

Filters the transformed dataset's based on pre-defined decorators in the file PatchBundle/tool/decorators/filter.py.

$ ./tool/PatchBundle.py filter --datasets nvd, mozilla, secretpatch, secbench

Implement your own filter rules and update the filter method in the respective dataset file, PatchBundle/tool/datasets/'name_of_the_dataset'.py.

Example of a custom filter:

def custom(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        dataset = func(*args, **kwargs)
        return dataset.drop(columns=['commit', 'name'])
    return wrapper

Add the filter:

    @save
--> @custom
    @one_line_changes
    @equal_adds_dels
    @c_code
    @load
    def filter(self, path: Path):
        print(f"Filtering {self.name}")
        return self.transformed

patchbundle's People

Contributors

epicosy avatar

Watchers

 avatar

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.