3 research outputs found

    An Empirical Validation of Cognitive Complexity as a Measure of Source Code Understandability

    Full text link
    Background: Developers spend a lot of their time on understanding source code. Static code analysis tools can draw attention to code that is difficult for developers to understand. However, most of the findings are based on non-validated metrics, which can lead to confusion and code, that is hard to understand, not being identified. Aims: In this work, we validate a metric called Cognitive Complexity which was explicitly designed to measure code understandability and which is already widely used due to its integration in well-known static code analysis tools. Method: We conducted a systematic literature search to obtain data sets from studies which measured code understandability. This way we obtained about 24,000 understandability evaluations of 427 code snippets. We calculated the correlations of these measurements with the corresponding metric values and statistically summarized the correlation coefficients through a meta-analysis. Results: Cognitive Complexity positively correlates with comprehension time and subjective ratings of understandability. The metric showed mixed results for the correlation with the correctness of comprehension tasks and with physiological measures. Conclusions: It is the first validated and solely code-based metric which is able to reflect at least some aspects of code understandability. Moreover, due to its methodology, this work shows that code understanding is currently measured in many different ways, which we also do not know how they are related. This makes it difficult to compare the results of individual studies as well as to develop a metric that measures code understanding in all its facets.Comment: 12 pages. To be published at ESEM '20: ACM / IEEE International Symposium on Empirical Software Engineering and Measuremen

    Komentar Semi Otomatis Untuk Memudahkan Pemahaman Pada Bahasa Pemrograman Java

    Get PDF
    Studi memperkirakan bahwa biaya perawatan perangkat lunak meningkat dengan sangat cepat hingga mencapai 90% dari biaya keseluruhan dalam daur hidup pengembangan perangkat lunak. Perawatan perangkat lunak menjadi sangat sulit dikarenakan tidak adanya dokumentasi pada program yang ada. Salah satu bentuk dokumentasi program adalah pemberian komentar program. Komentar sangat berguna dalam pemahaman program dan pemeliharaan program. Komentar memungkinkan pengembang dalam memahami kode lebih cepat dalam pembacaan kode program. Pemberian komentar program biasanya dilakukan manual oleh programmer. Pada tesis ini, dilakukan dua kegiatan pemberian komentar pada bahasa pemrograman java, yaitu pemberian komentar secara otomatis dan pemberian komentar secara semi otomatis. Komentar semi otomatis yang diberikan pada program secara langsung dapat mempermudah proses pemahaman pada program khususnya bahasa pemrograman java. Penggunaan ekspresi regular sangat membantu dalam mempolakan baris kode sumber. Aplikasi yang dibangun oleh peneliti telah mampu memberikan kontribusi pemahaman terhadap program sebesar 14.29% sampai dengan 42.86% ==================================================================================================================The study estimates that the cost of software maintenance is increasing very rapidly until it reaches 90% of the overall cost of the software development life cycle. Software maintenance becomes very difficult due to the lack of documentation on the existing program. One form of program documentation was commenting program. Comments are very useful in understanding the program and maintenance program. The comment allows developers to understand the code faster in reading the program code. Commenting program is usually done manually by the programmer. In this thesis, carried out two activities commenting on the Java programming language, the automatic comment and semi-automatic comment. Semi-automatic comments given on direct program is expected to simplify the process of understanding the particular program java programming language. The use of regular expressions is helpful in patterns of lines of source code. Applications built by the researchers have been able to contribute to the understanding of the program at 14.29% to 42.86%
    corecore