Analýza toku výjimek v Kotlinu
Exception flow analysis for Kotlin
dc.contributor.advisor | Hunka Jiří | |
dc.contributor.author | Filip Dolník | |
dc.date.accessioned | 2022-06-02T22:53:07Z | |
dc.date.available | 2022-06-02T22:53:07Z | |
dc.date.issued | 2022-06-02 | |
dc.identifier | KOS-1065781912005 | |
dc.identifier.uri | http://hdl.handle.net/10467/101043 | |
dc.description.abstract | Ošetřování výjimek je nezbytnou součástí vývoje softwaru, je však zároveň také jednou z nejnáročnějších. Chyby ve zpracování výjimek mohou způsobit mnoho problémů - od špatného uživatelského rozhraní až po bezpečnostní zranitelnosti. Tyto chyby se často vyskytují na rozhraní dvou systémů. Důvodem je mimo jiné to, že API těchto systémů obvykle není správně zdokumentováno, zejména pokud jde o výjimky. Ruční dokumentování výjimek v API je časově náročné, a navíc náchylné na chyby. Tato práce navrhuje řešení v podobě automatické tvorby této dokumentace. Tím řešením je statická analýza propagace výjimek, která vytvoří seznam potenciálně vyhozených výjimek z API. Výsledkem této práce je návrh této statické analýzy, konkrétně pro programovací jazyk Kotlin. Vytvořený návrh lze použít k implementaci nástroje pro automatické dokumentování API. Navržená analýza je založena na abstraktní interpretaci a klade důraz na vysokou přesnost. Analýza si poradí jak s objektově orientovanými, tak s funkcionálními aspekty Kotlinu. Návrh je modulární a používá dvě různé IR. Díky tomu lze snadno přidat podporu dalších programovacích jazyků. Součástí této práce je také implementace prototypu navržené analýzy. Vyvinutý prototyp interně používá kompilátor Kotlinu pro převod analyzovaného zdrojového kódu do IR Kotlinu. Tato IR je poté převedena na jednu ze dvou IR statické analýzy. Tento proces převodu je v práci podrobně zdokumentován spolu s významnou částí IR Kotlinu. Vzniklá dokumentace také vysvětluje sémantiku funkcí Kotlinu, zejména těch, které souvisí s propagací výjimek. Tato dokumentace může být užitečná při implementaci zásuvných modulů pro kompilátor Kotlinu nebo jiných statických analýz. Vytvořený prototyp lze použít na experimentování s většinou vzniklého návrhu analýzy. Jeho implementace však není úplná, takže jej nelze použít k analýze reálných projektů. Součástí prototypu je mnoho akceptačních testů zaměřených na propagaci výjimek. Prototyp i tyto testy lze použít při implementaci nástroje na dokumentování API. | cze |
dc.description.abstract | Exception handling is one of the most challenging parts of the software development, yet it is essential. An improper exception handling can cause many problems - from bad UX to security vulnerabilities. Mistakes in exception handling frequently occur at the boundaries of two systems. Part of the reason is that the API of those systems is usually not correctly documented, especially when it comes to exceptions. Manually documenting API exceptions is a time-consuming and error-prone process. This thesis proposes a solution for creating the documentation automatically. The solution is a static analysis of exception propagation. This static analysis produces a list of potentially thrown exceptions by API endpoints. The result of this thesis is a design of such static analysis for the Kotlin programming language. The created design can be used to implement a tool for documenting APIs. The designed analysis is based on abstract interpretation, focusing on high precision. The analysis can handle both object-oriented and functional programming aspects of Kotlin. The design is modular and uses two different intermediate representations. As a result, the design can be easily extended to support other programming languages. This thesis also includes a prototype of the proposed analysis. The prototype internally uses the Kotlin compiler to parse the analyzed source code into the Kotlin IR. The produced Kotlin IR is then converted to one of the intermediate representations. The thesis describes this process in detail and, at the same time, it documents a significant part of the Kotlin IR. The documentation also explains the semantics of Kotlin features that the analysis handles. This documentation can be helpful when implementing compiler plugins or other static analyses. The created prototype can be used to experiment with most of the analysis design. However, it does not implement the entire design, so it cannot be used to analyze real-world projects. The prototype contains many acceptance tests focused on the exception propagation. Together the prototype and the tests can be used as a starting point for implementing the tool for documenting APIs. | eng |
dc.publisher | České vysoké učení technické v Praze. Vypočetní a informační centrum. | cze |
dc.publisher | Czech Technical University in Prague. Computing and Information Centre. | eng |
dc.rights | A university thesis is a work protected by the Copyright Act. Extracts, copies and transcripts of the thesis are allowed for personal use only and at one?s own expense. The use of thesis should be in compliance with the Copyright Act http://www.mkcr.cz/assets/autorske-pravo/01-3982006.pdf and the citation ethics http://knihovny.cvut.cz/vychova/vskp.html | eng |
dc.rights | Vysokoškolská závěrečná práce je dílo chráněné autorským zákonem. Je možné pořizovat z něj na své náklady a pro svoji osobní potřebu výpisy, opisy a rozmnoženiny. Jeho využití musí být v souladu s autorským zákonem http://www.mkcr.cz/assets/autorske-pravo/01-3982006.pdf a citační etikou http://knihovny.cvut.cz/vychova/vskp.html | cze |
dc.subject | statická analýza | cze |
dc.subject | tok výjimek | cze |
dc.subject | propagace výjimek | cze |
dc.subject | doménové výjimky | cze |
dc.subject | dokumentace API | cze |
dc.subject | Kotlin | cze |
dc.subject | kompilátor Kotlinu | cze |
dc.subject | Kotlin IR | cze |
dc.subject | static analysis | eng |
dc.subject | exception flow | eng |
dc.subject | exception propagation | eng |
dc.subject | domain exceptions | eng |
dc.subject | API documentation | eng |
dc.subject | Kotlin | eng |
dc.subject | Kotlin compiler | eng |
dc.subject | Kotlin IR | eng |
dc.title | Analýza toku výjimek v Kotlinu | cze |
dc.title | Exception flow analysis for Kotlin | eng |
dc.type | diplomová práce | cze |
dc.type | master thesis | eng |
dc.contributor.referee | Křikava Filip | |
theses.degree.discipline | Systémové programování | cze |
theses.degree.grantor | katedra teoretické informatiky | cze |
theses.degree.programme | Informatika | cze |
Soubory tohoto záznamu
Tento záznam se objevuje v následujících kolekcích
-
Diplomové práce - 18101 [208]