Automated Program Minimization With Preserving of Runtime Errors
Automatická konstrukce minimálních programů která zachovává běhové chyby
bachelor thesis (DEFENDED)
View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/147559Identifiers
Study Information System: 226945
Collections
- Kvalifikační práce [10691]
Author
Advisor
Referee
Bednárek, David
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Programming and Software Systems
Department
Department of Distributed and Dependable Systems
Date of defense
2. 7. 2021
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
English
Grade
Excellent
Keywords (Czech)
automatické ladění|analýza kódu|syntaktický strom|redukce příkazů|clang libtoolingKeywords (English)
automated debugging|code analysis|syntax tree|statement reduction|clang libtoolingLadění velkých programů je časově náročný úkol, který dosud nebyl plně automati- zován. Vývojář musí nejprve reprodukovat danou běhovou chybu. Poté musí najít hlavní příčinu chyby a správně ji opravit. Automatizace může tento proces výrazně zefektivnit snížením množství kódu, se kterým musí vývojář pracovat. Tato práce představuje tři metodiky automatického redukování daného selhávajícího programu na jeho minimální spustitelnou podmnožinu. Techniky jsou založeny na existujících poznatcích v oblasti ladění. Automaticky minimalizovaný program musí vést ke stejné běhové chybě jako původní program. Minimalizace se zaměřuje na optimální výsledky v oblasti malých a jednoduchých aplikacích. Cílem této práce je popsat techniky, které jsou vhodné pro redukci programu. Tyto techniky jsou poté implementovány pomocí Clang LibTooling, knihovny pro nástroje postavené na projektu Clang. Práce vysvětluje vnitřní fungování každé implementace a poukazuje jejich omezení. Implementace jsou porovnány na sadě zdrojových souborů psaných v jazycích C a C++. Efektivita implementace je odvozena na základě velikosti generovaného výstupu a doby chodu algoritmu. 1
Debugging large programs is a complex and time-consuming task, which has not been fully automated yet. Given a runtime error, the developer must first reproduce it. He then has to find the root cause of the error and create a proper bug fix. Automation can make this process significantly more efficient by reducing the amount of code the developer has to look through. The goal of this thesis is to propose and discuss automated techniques for reducing a given failing program into its minimal runnable subset. We introduce three methodologies that are practical for program reduction. The automatically minimized program must result in the same runtime error as the original program. The process of minimization focuses on producing optimal results for the domain of small and simple applications. All three techniques are implemented using Clang LibTooling, a library for standalone Clang tools. In the thesis, we explain the inner workings of each implementation and discuss their limitations. Implementations are benchmarked on a set of C and C++ source files. Performance is evaluated with respect to the size of the generated output and the algorithm's running time. 1