scholarly journals The charming code that error messages are talking about

Author(s):  
Joshua C Campbell ◽  
Abram Hindle

The intent of high test coverage is to ensure that the dark nooks and crannies of code are exercised and tested. In a language like Python this is especially important as syntax errors can lurk in unevaluated blocks, only to be discovered once they are finally executed. Bugs that present themselves as error messages mentioning a line of code which is unrelated to the cause of the bug can be difficult and time-consuming to fix when a developer must first determine the actual location of the fault. A new code metric, charm, is presented. Charm can be used by developers, researchers, and automated tools to gain a deeper understanding of source code and become aware of potentially hidden faults, areas of code which are not sufficiently tested, and areas of code which may be more difficult to debug. Charm quantifies the property that error messges caused by a fault at one location don't always reference that location. In fact, error messages seem to prefer to reference some locations far more often than others. The quantity of charm can be estimated by averaging results from a random sample of similar programs to the one being measured by a procedure of random-mutation testing. Charm is estimated for release-quality Python software, requiring many thousands of similar Python programs to be executed. Charm has some correlation with a standard software metric, cyclomatic complexity. 21 code features which may have some relationship with charm and cyclomatic complexity are investigated, of which five are found to be significantly related with charm. These five features are then used to build a linear model which attempts to estimate charm cheaply.

2015 ◽  
Author(s):  
Joshua C Campbell ◽  
Abram Hindle

The intent of high test coverage is to ensure that the dark nooks and crannies of code are exercised and tested. In a language like Python this is especially important as syntax errors can lurk in unevaluated blocks, only to be discovered once they are finally executed. Bugs that present themselves as error messages mentioning a line of code which is unrelated to the cause of the bug can be difficult and time-consuming to fix when a developer must first determine the actual location of the fault. A new code metric, charm, is presented. Charm can be used by developers, researchers, and automated tools to gain a deeper understanding of source code and become aware of potentially hidden faults, areas of code which are not sufficiently tested, and areas of code which may be more difficult to debug. Charm quantifies the property that error messges caused by a fault at one location don't always reference that location. In fact, error messages seem to prefer to reference some locations far more often than others. The quantity of charm can be estimated by averaging results from a random sample of similar programs to the one being measured by a procedure of random-mutation testing. Charm is estimated for release-quality Python software, requiring many thousands of similar Python programs to be executed. Charm has some correlation with a standard software metric, cyclomatic complexity. 21 code features which may have some relationship with charm and cyclomatic complexity are investigated, of which five are found to be significantly related with charm. These five features are then used to build a linear model which attempts to estimate charm cheaply.


2015 ◽  
Author(s):  
Joshua C Campbell ◽  
Abram Hindle

The intent of high test coverage is to ensure that the dark nooks and crannies of code are exercised and tested. In a language like Python this is especially important as syntax errors can lurk in unevaluated blocks, only to be discovered once they are finally executed. Bugs that present themselves as error messages mentioning a line of code which is unrelated to the cause of the bug can be difficult and time-consuming to fix when a developer must first determine the actual location of the fault. A new code metric, charm, is presented. Charm can be used by developers, researchers, and automated tools to gain a deeper understanding of source code and become aware of potentially hidden faults, areas of code which are not sufficiently tested, and areas of code which may be more difficult to debug. Charm quantifies the property that error messges caused by a fault at one location don't always reference that location. In fact, error messages seem to prefer to reference some locations far more often than others. The quantity of charm can be estimated by averaging results from a random sample of similar programs to the one being measured by a procedure of random-mutation testing. Charm is estimated for release-quality Python software, requiring many thousands of similar Python programs to be executed. Charm has some correlation with a standard software metric, cyclomatic complexity. 21 code features which may have some relationship with charm and cyclomatic complexity are investigated, of which five are found to be significantly related with charm. These five features are then used to build a linear model which attempts to estimate charm cheaply.


2021 ◽  
Vol 10 (3) ◽  
pp. 438-443
Author(s):  
Ryan Aji Wijaya ◽  
Karmilasari Karmilasari

Website Pengurus Cabang Nahdlatul Ulama (PCNU) Depok dibuat sebagai sarana penyimpanan dan pengelolaan data dalam organisasi tersebut. Penelitian ini bertujuan untuk mengukur kualitas website PCNU Depok dilihat dari maintainability, flexibility dan testability. Tahapan penelitian yang dilakukan : analisis modul website, instalasi website PCNU, instalasi composer, instalasi PHPMetrics, menjalankan aplikasi PHPMetrics untuk mengukur kualitas website PCNU, menganalisis hasil pengukuran dari PHPMetrics.Penelitian kualitas website dengan metode maintainability index mehasilkan nilai 63,57 yang diklasifikasikan sebagai low maintainability. Low maintainibility index berdampak kepada lemahnya modul website untuk dilakukan perawatan dan pengembangan berdasarkan Lines Of Code, Cyclomatic Complexity, dan Halstead Volume. Faktor flexibility, website mendapatkan klasifikasi moderate atau batas wajar karena memiliki coupling = cohesion. Testability pada website memiliki klasifikasi baik dengan nilai rata-rata 16,65. Dengan nilai testability baik website mendapatkan nilai positip pada proses testing dan maintenance sehingga modul tidak sulit untuk dimengerti dan dikembangkan.


Author(s):  
Natarajan Meghanathan ◽  
Alexander Roy Geoghegan

The high-level contribution of this book chapter is to illustrate how to conduct static code analysis of a software program and mitigate the vulnerabilities associated with the program. The automated tools used to test for software security are the Source Code Analyzer and Audit Workbench, developed by Fortify, Inc. The first two sections of the chapter are comprised of (i) An introduction to Static Code Analysis and its usefulness in testing for Software Security and (ii) An introduction to the Source Code Analyzer and the Audit Workbench tools and how to use them to conduct static code analysis. The authors then present a detailed case study of static code analysis conducted on a File Reader program (developed in Java) using these automated tools. The specific software vulnerabilities that are discovered, analyzed, and mitigated include: (i) Denial of Service, (ii) System Information Leak, (iii) Unreleased Resource (in the context of Streams), and (iv) Path Manipulation. The authors discuss the potential risk in having each of these vulnerabilities in a software program and provide the solutions (and the Java code) to mitigate these vulnerabilities. The proposed solutions for each of these four vulnerabilities are more generic and could be used to correct such vulnerabilities in software developed in any other programming language.


Author(s):  
Girish Babu ◽  
Charitra Kamalaksh Patil

Robust DevOps plays a huge role in the health and sanity of software. The metadata generated during DevOps need to be harnessed for deriving useful insights on the health of the software. This area of work can be classified as code analytics and comprises of the following (but not limited to): 1. commit history from the source code management system (SCM); 2. the engineers that worked on the commit; 3. the reviewers on the commit; 4. the extent of build (if applicable) and test validation prior to the commit, the types of failures found in iterative processes, and the fixes done; 5. test extent of test coverage on the commit; 6. any static profiling on the code in the commit; 7. the size and complexity of the commit; 8. many more. This chapter articulates many ways the above information can be used for effective software development.


2019 ◽  
Vol 18 (03) ◽  
pp. 833-866 ◽  
Author(s):  
Mi Li ◽  
Huan Chen ◽  
Xiaodong Wang ◽  
Ning Zhong ◽  
Shengfu Lu

The particle swarm optimization (PSO) algorithm is simple to implement and converges quickly, but it easily falls into a local optimum; on the one hand, it lacks the ability to balance global exploration and local exploitation of the population, and on the other hand, the population lacks diversity. To solve these problems, this paper proposes an improved adaptive inertia weight particle swarm optimization (AIWPSO) algorithm. The AIWPSO algorithm includes two strategies: (1) An inertia weight adjustment method based on the optimal fitness value of individual particles is proposed, so that different particles have different inertia weights. This method increases the diversity of inertia weights and is conducive to balancing the capabilities of global exploration and local exploitation. (2) A mutation threshold is used to determine which particles need to be mutated. This method compensates for the inaccuracy of random mutation, effectively increasing the diversity of the population. To evaluate the performance of the proposed AIWPSO algorithm, benchmark functions are used for testing. The results show that AIWPSO achieves satisfactory results compared with those of other PSO algorithms. This outcome shows that the AIWPSO algorithm is conducive to balancing the abilities of the global exploration and local exploitation of the population, while increasing the diversity of the population, thereby significantly improving the optimization ability of the PSO algorithm.


Water ◽  
2021 ◽  
Vol 13 (17) ◽  
pp. 2432
Author(s):  
Rubén Antona ◽  
Renato Vacondio ◽  
Diego Avesani ◽  
Maurizio Righetti ◽  
Massimiliano Renzi

This paper studies the convergence properties of an arbitrary Lagrangian–Eulerian (ALE) Riemann-based SPH algorithm in conjunction with a Weighted Essentially Non-Oscillatory (WENO) high-order spatial reconstruction, in the framework of the DualSPHysics open-source code. A convergence analysis is carried out for Lagrangian and Eulerian simulations and the numerical results demonstrate that, in absence of particle disorder, the overall convergence of the scheme is close to the one guaranteed by the WENO spatial reconstruction. Moreover, an alternative method for the WENO spatial reconstruction is introduced which guarantees a speed-up of 3.5, in comparison with the classical Moving Least-Squares (MLS) approach.


2015 ◽  
Vol 25 (09n10) ◽  
pp. 1727-1731
Author(s):  
Rodrigo A. Vilar ◽  
Anderson A. Lima ◽  
Hyggo O. Almeida ◽  
Angelo Perkusich

Unanticipated Software Evolution (USE) techniques enable developers to easily change any element of the software without being obligated to anticipate and isolate extension points. However, we have not found empirical validations of the impact of USE on development cost and quality. In this work, we design and execute an experiment for USE, in order to compare its resulting metrics — time, lines of code, test coverage and complexity — using OO systems as baseline. 30 undergraduate students were subjects in this experiment. The results suggest that USE has significant impact on the lines of code and complexity metrics, reducing the amount of lines changed and the McCabe cyclomatic complexity on software evolution.


2020 ◽  
Vol 10 (20) ◽  
pp. 7253
Author(s):  
Tong Li ◽  
Shiheng Wang ◽  
David Lillis ◽  
Zhen Yang

Maintaining traceability links of software systems is a crucial task for software management and development. Unfortunately, dealing with traceability links are typically taken as afterthought due to time pressure. Some studies attempt to use information retrieval-based methods to automate this task, but they only concentrate on calculating the textual similarity between various software artifacts and do not take into account the properties of such artifacts. In this paper, we propose a novel traceability link recovery approach, which comprehensively measures the similarity between use cases and source code by exploring their particular properties. To this end, we leverage and combine machine learning and logical reasoning techniques. On the one hand, our method extracts features by considering the semantics of the use cases and source code, and uses a classification algorithm to train the classifier. On the other hand, we utilize the relationships between artifacts and define a series of rules to recover traceability links. In particular, we not only leverage source code’s structural information, but also take into account the interrelationships between use cases. We have conducted a series of experiments on multiple datasets to evaluate our approach against existing approaches, the results of which show that our approach is substantially better than other methods.


2021 ◽  
Vol 5 (1) ◽  
pp. 132-138
Author(s):  
Hataw Jalal Mohammed ◽  
Kamaran Hama Ali Faraj

The web servers (WSGI-Python) and (PHP-Apache) are in middleware tier architecture. Middleware architecture is between frontend tier and backend tier, otherwise it’s a connection between frontend tier and backend tier for three tier architecture. The ELearning systems are designed by two different dynamic web technologies. First is by Python-WSGI and the second is by Personal Home Page (PHP-Apache). The two websites were designed with different open source and cross platform web technologies programming language namely; Python and PHP in the same structure and weight will evaluate perform over two different operating systems (OSs): 1) Windows-16 and 2) Linux-Ubuntu 20.4. Both systems run over the same computer architecture (64bit) as a server side with a common backend MySQL web database for both of them. Nevertheless, the middleware for PHP is a cross Apache MySQL PHP Perl (XAMPP), but the middleware for Python is Pycharm and the web server gateway interface (WSGI). WSGI and Apache are both web servers and this paper will show which of them has a better response time (RT). On the one hand, the experimental results demonstrate that the Python-WSGI is even weightier in Mbyte than PHP-Apache, on the other hand Python is still faster and more accurate than PHP. The designed SPG is by handwriting codes: one time designed the SPG by PHP source code and the other time designed by Python source code. Both Python-WSGI and PHP-Apache results are targeted to compare by the least time in milliseconds and take in to account enhanced performance.


Sign in / Sign up

Export Citation Format

Share Document