Magpie: your software, but more efficient!
Magpie is a tool for automated software improvement. It implements MAGPIE, using the genetic improvement methodology to traverse the search space of different software variants to find improved software.
Magpie provides support for improvement of both functional (automated bug fixing) and non-functional (e.g., execution time) properties of software.
Two types of language-agnostic source code representations are supported: line-by-line, and XML trees.
For the latter we recommend the srcML tool with out-of-the-box support for C/C++/C# and Java.
Finally, Magpie also enables parameter tuning and algorithm configuration, both independently and concurrently of the source code search process.
Requirements:
- Python 3.8+
- Pytest [optional: for running tests]
Install Magpie by cloning the git repository:
git clone https://github.com/bloa/magpie.git
Optionally, run Magpie's unit tests:
pytest magpie
Try one of the following examples:
python3 -m bin.local_search --scenario examples/scenario/triangle-cpp_runtime.txt
python3 -m bin.local_search --scenario examples/scenario/triangle-java_repair.txt
python3 -m bin.show_patch --scenario examples/scenario/triangle-cpp_runtime.txt --patch "StmtDeletion(('triangle.cpp.xml', 'stmt', 3))"
python3 -m bin.minify_patch --scenario examples/scenario/triangle-py_runtime.txt --patch "LineInsertion(('triangle.py', '_inter_line', 31), ('triangle.py', 'line', 7)) | LineInsertion(('triangle.py', '_inter_line', 33), ('triangle.py', 'line', 21)) | LineReplacement(('triangle.py', 'line', 9), ('triangle.py', 'line', 37)) | LineInsertion(('triangle.py', '_inter_line', 4), ('triangle.py', 'line', 7))"
Magpie is based on PyGGI 2.0, developped at COINSE KAIST in collaboration with UCL SOLAR.
Part of its development was supported by UK EPSRC Fellowship EP/P023991/1.
If you use Magpie for a publication, we kindly ask you to cite the following ArXiV paper that describes MAGPIE's approach:
@article{blot:2022:corr_1,
author = {Aymeric Blot and
Justyna Petke},
title = {{MAGPIE:} {M}achine Automated General Performance Improvement via Evolution of Software},
journal = {Computing Research Repository},
volume = {abs/2208.02811},
url = {https://arxiv.org/abs/2208.02811},
year = {2022},
}
