382 research outputs found
The Good, the Bad, and the Ugly: An Empirical Study of Implicit Type Conversions in JavaScript
Most popular programming languages support situations where a value of one type is converted into a value of another type without any explicit cast. Such implicit type conversions, or type coercions, are a highly controversial language feature. Proponents argue that type coercions enable writing concise code. Opponents argue that type coercions are error-prone and that they reduce the understandability of programs. This paper studies the use of type coercions in JavaScript, a language notorious for its widespread use of coercions. We dynamically analyze hundreds of programs, including real-world web applications and popular benchmark programs. We find that coercions are widely used (in 80.42% of all function executions) and that most coercions are likely to be harmless (98.85%). Furthermore, we identify a set of rarely occurring and potentially harmful coercions that safer subsets of JavaScript or future language designs may want to disallow. Our results suggest that type coercions are significantly less evil than commonly assumed and that analyses targeted at real-world JavaScript programs must consider coercions
Recommended from our members
Final Report for the Emmy Noether Project : ConcSys: Reliable and Efficient Complex, Concurrent Software Systems
The ConcSys project aims to develop techniques for testing and analyzing complex software systems, with a focus on increasing the correctness and performance of such systems. The project was running from March 2015 until December 2024. In this period, we made significant progress, both in terms of scientific results and in terms of building up a research group. The scientific results include novel techniques for (i) finding and preventing concurrency bugs, (ii) understanding and analyzing software performance, (iii) automated test generation, (iv) program analysis for WebAssembly, and (v) foundations of dynamic analysis. These results are presented in 83 peer-reviewed publications at top-tier conferences and journals in software engineering and programming languages, e.g., ICSE, OOPSLA, PLDI, and FSE. Beyond these scientific results, the project has enabled the PI, Michael Pradel, to build up his own a research group, to establish himself as an internationally recognized leader in the field, and to secure a permanent professorship at the University of Stuttgart. The project has directly and indirectly contributed to the careers of 12 doctoral students, out of which seven have been partially funded by the project and six have already graduated.Das ConcSys-Projekt hat zum Ziel, Techniken zum Testen und Analysieren komplexer Softwaresysteme zu entwickeln, mit einem Schwerpunkt auf der Erhöhung der Korrektheit und Leistungsfähigkeit solcher Systeme. Das Projekt lief von März 2015 bis Dezember 2024. In diesem Zeitraum haben wir bedeutende Fortschritte erzielt, sowohl in wissenschaftlicher Hinsicht als auch beim Aufbau einer Forschungsgruppe. Zu den wissenschaftlichen Ergebnissen gehören neuartige Techniken für (i) das Finden und Verhindern von Nebenläufigkeitsfehlern, (ii) das Verständnis und die Analyse der Software-Effizienz, (iii) die automatische Testgenerierung, (iv) die Programmanalyse für WebAssembly und (v) die Grundlagen der dynamischen Analyse. Diese Ergebnisse wurden in 83 von Fachkollegen/innen begutachteten Veröffentlichungen auf erstklassigen Konferenzen und in renommierten Zeitschriften im Bereich Software Engineering und Programmiersprachen präsentiert, z.B. ICSE, OOPSLA, PLDI und FSE. Über diese wissenschaftlichen Ergebnisse hinaus hat das Projekt dem Projektleiter, Michael Pradel, ermöglicht, eine eigene Forschungsgruppe aufzubauen, sich als international anerkannte Führungspersönlichkeit auf diesem Gebiet zu etablieren und eine W3 Professur an der Universität Stuttgart zu erhalten. Das Projekt hat direkt und indirekt zur Karriere von 12 Doktorandinnen und Doktoranden beigetragen, von denen sieben teilweise durch das Projekt finanziert wurden und sechs
bereits promoviert haben
Code Search (Dagstuhl Seminar 24172)
This report documents the program and the outcomes of Dagstuhl Seminar "Code Search" (24172). The seminar brought together researchers and practitioners working on techniques that enable software developers to find code and artifacts related to code. The participants discussed the state of the art in code search, identified open problems, and discussed future directions for research and practice. The seminar was structured with keynote talks, short talks, and breakout groups. Breakout groups identified how researchers can situate their code search research in terms of the targeted user groups, the access point for the developer, and the stage of software development that is most relevant to the code search tasks. Synergies between generative AI and Code Search were discussed, concluding that for some users and some tasks, generative AI can work with Code Search to enhance the developer experience and effectiveness. For other tasks, code search without generative AI would be more effective because of concerns regarding data provenance, update frequency, privacy, and the need for correctness
Front Matter - ECOOP 2017 Artifacts, Table of Contents, Preface, Artifact Evaluation Committee
Front Matter - ECOOP 2017 Artifacts, Table of Contents, Preface, Artifact Evaluation Committe
Automated Program Repair (Dagstuhl Seminar 17022)
This report documents the program and the outcomes of Dagstuhl Seminar 17022 "Automated Program Repair". The seminar participants presented and discussed their research through formal and informal presentations. In particular, the seminar covered work related to search-based program repair, semantic program repair, and repair of non-functional properties. As a result of the seminar, several participants plan to launch various follow-up activities, such as a program repair competition, which would help to further establish and guide this young field of research
Programming Language Processing (Dagstuhl Seminar 23062)
This report documents the program and the outcomes of Dagstuhl Seminar 23062 "Programming Language Processing" (PLP). The seminar brought together researchers and practitioners from three communities-software engineering, programming languages, and natural language processing- providing a unique opportunity for cross-fertilization and inter-disciplinary progress. We discussed machine learning models of code, integrating learning-based and traditional program analysis, and learning from natural language information associated with software. The seminar lead to a better understanding of the commonalities and differences between natural and programming languages, and an understanding of the challenges and opportunities in industry adoption of PLP
TypeWriter: Neural Type Prediction with Search-Based Validation
Maintaining large code bases written in dynamically typed languages, such as JavaScript or Python, can be challenging due to the absence of type annotations: simple data compatibility errors proliferate, IDE support is limited, and APIs are hard to comprehend. Recent work attempts to address those issues through either static type inference or probabilistic type prediction. Unfortunately, static type inference for dynamic languages is inherently limited, while probabilistic approaches suffer from imprecision. This paper presents TypeWriter, the first combination of probabilistic type prediction with search-based refinement of predicted types. TypeWriter’s predictor learns to infer the return and argument types for functions from partially annotated code bases by combining the natural language properties of code with programming language-level information. To validate predicted types, TypeWriter invokes a gradual type checker with different combinations of the predicted types, while navigating the space of possible type combinations in a feedback-directed manner. We implement the TypeWriter approach for Python and evaluate it on two code corpora: a multi-million line code base at Facebook and a collection of 1,137 popular open-source projects. We show that TypeWriter’s type predictor achieves an F1 score of 0.64 (0.79) in the top-1 (top-5) predictions for return types, and 0.57 (0.80) for argument types, which clearly outperforms prior type prediction models. By combining predictions with search-based validation, TypeWriter can fully annotate between 14% to 44% of the files in a randomly selected corpus, while ensuring type correctness. A comparison with a static type inference tool shows that TypeWriter adds many more non-trivial types. TypeWriter currently suggests types to developers at Facebook and several thousands of types have already been accepted with minimal changes.Software Engineerin
Analyzing code corpora to improve the correctness and reliability of programs
Bugs in software are commonplace, challenging, and expensive to deal with. One widely used direction is to use program analyses and reason about software to detect bugs in them. In recent years, the growth of areas like web application development and data analysis has produced large amounts of publicly available source code corpora, primarily written in dynamically typed languages, such as Python and JavaScript. It is challenging to reason about programs written in such languages because of the presence of dynamic features and the lack of statically declared types.
This dissertation argues that, to build software developer tools for detecting and understanding bugs, it is worthwhile to analyze code corpora, which can uncover code idioms, runtime information, and natural language constructs such as comments. The dissertation is divided into three corpus-based approaches that support our argument. In the first part, we present static analyses over code corpora to generate new programs, to perform mutations on existing programs, and to generate data for effective training of neural models. We provide empirical evidence that the static analyses can scale to thousands of files and the trained models are useful in finding bugs in code. The second part of this dissertation presents dynamic analyses over code corpora. Our evaluations show that the analyses are effective in uncovering unexpected behaviors when multiple JavaScript libraries are included together and to generate data for training bug-finding neural models. Finally, we show that a corpus-based analysis can be useful for input reduction, which can help developers to find a smaller subset of an input that still triggers the required behavior.
We envision that the current dissertation motivates future endeavors in corpus-based analysis to alleviate some of the challenges faced while ensuring the reliability and correctness of software. One direction is to combine data obtained by static and dynamic analyses over code corpora for training. Another direction is to use meta-learning approaches, where a model is trained using data extracted from the code corpora of one language and used for another language
- …
