Cieľom práce je navrhnúť a implementovať systém na správu programovacích konvencií v projekte. Pred navrhnutím samotného systému bol vykonaný prieskum benefitov progra...
详细信息
Cieľom práce je navrhnúť a implementovať systém na správu programovacích konvencií v projekte. Pred navrhnutím samotného systému bol vykonaný prieskum benefitov programovacích konvencií, analýza používaných konvencií v open source projektoch v službe GitHub a analýza existujúcich technológií spravujúcich programovacie konvencie. Na ich základe boli navrhnuté scenáre použitia, špecifikované požiadavky a určená architektúra. Následne bol systém implementovaný ako webová aplikácia postavená na technológiách Blazor a EditorConfig. Hlavným zámerom bolo vytvoriť systém, ktorý umožní uchovávať všetky druhy používaných programovacích konvencií a zároveň umožní užívateľovi dané konvencie automaticky kontrolovať a generovať. Zverejnený je pod open source licenciou v službe GitHub a nasadený v cloudovej platforme Azure.
Tato práce se zabývá tvorbou nástroje, jenž by umožňoval kontrolu a hodnocení úhlednosti zdrojových kódů v jazyce C. Primární cílovou skupinou jsou studenti před...
详细信息
Tato práce se zabývá tvorbou nástroje, jenž by umožňoval kontrolu a hodnocení úhlednosti zdrojových kódů v jazyce C. Primární cílovou skupinou jsou studenti předmětu Základy programování. Způsob realizace uvažuje využití nástroje Clang-Tidy, rozšířeného o vlastní sadu kontrol a programu vyhodnocující výsledky kontrol na základě vstupní konfigurace. Vytvořený program je schopen bodově hodnotit zdrojové kódy za pomoci 16 kontrol dle konfigurace. Tyto kontroly odhalují různé začátečnické chyby. Z testování studentských projektů vyplynulo, že nejčastější chybou je využívání tzv. magických čísel. Program je možno s vhodným poučením studentů nasadit v předmětu Základy programování (IZP).
Ensuring the consistent usage of formatting conventions is an important aspect of modern software quality assurance. To do so, the source code of a project should be checked against the formatting conventions (or rule...
详细信息
Ensuring the consistent usage of formatting conventions is an important aspect of modern software quality assurance. To do so, the source code of a project should be checked against the formatting conventions (or rules) adopted by its development team, and then the detected violations should be repaired if any. While the former task can be automatically done by format checkers implemented in linters, there is no satisfactory solution for the latter. Manually fixing formatting convention violations is a waste of developer time and code formatters do not take into account the conventions adopted and configured by developers for the used linter. In this paper, we present Styler, a tool dedicated to fixing formatting rule violations raised by format checkers using a machine learning approach. For a given project, Styler first generates training data by injecting violations of the project-specific rules in violation-free source code files. Then, it learns fixes by feeding long short-term memory neural networks with the training data encoded into token sequences. Finally, it predicts fixes for real formatting violations with the trained models. Currently, Styler supports a single checker, Checkstyle, which is a highly configurable and popular format checker for Java. In an empirical evaluation, Styler repaired 41% of 26,791 Checkstyle violations mined from 104 GitHub projects. Moreover, we compared Styler with the IntelliJ plugin CheckStyle-IDEA and the machine-learning-based code formatters Naturalize and CodeBuff. We found out that Styler fixes violations of a diverse set of Checkstyle rules (24/25 rules), generates smaller repairs in comparison to the other systems, and predicts repairs in seconds once trained on a project. Through a manual analysis, we identified cases in which Styler does not succeed to generate correct repairs, which can guide further improvements in Styler. Finally, the results suggest that Styler can be useful to help developers repair Checkstyle
暂无评论