ICSE 2024
Fri 12 - Sun 21 April 2024 Lisbon, Portugal
Fri 19 Apr 2024 16:30 - 16:45 at Fernando Pessoa - Program Repair 4 Chair(s): João Pascoal Faria

Gradual typing enables developers to annotate types of their own choosing, offering a flexible middle ground between no type annotations and a fully statically typed language. As more and more code bases get type-annotated, static type checkers detect an increasingly large number of type errors. Unfortunately, fixing these errors requires manual effort, hampering the adoption of gradual typing in practice. This paper presents PyTy, an automated program repair approach targeted at statically detectable type errors in Python. The problem of repairing type errors deserves specific attention because it exposes particular repair patterns, offers a warning message with hints about where and how to apply a fix, and because gradual type checking serves as an automatic way to validate fixes. We addresses this problem through three contributions: (i) an empirical study that investigates how developers fix Python type errors, showing a diverse set of fixing strategies with some recurring patterns; (ii) an approach to automatically extract type error fixes, which enables us to create a dataset of 2,766 error-fix pairs from 176 GitHub repositories, named PyTyDefects; (iii) the first learning-based repair technique for fixing type errors in Python. Motivated by the relative data scarcity of the problem, the neural model at the core of PyTy is trained via cross-lingual transfer learning. Our evaluation shows that PyTy offers fixes for ten frequent categories of type errors, successfully addressing 85.4% of 281 real-world errors. This effectiveness clearly outperforms both a previous technique aimed at type errors that manifest at runtime (by 10x) and state-of-the-art large language models asked to repair type errors (by 2.1x). Finally, 20 out of 30 pull requests with PyTy-suggested fixes have been merged by developers, showing the usefulness of PyTy in practice.

Slides (PyTy - ICSE 2024.pdf)2.27MiB

Fri 19 Apr

Displayed time zone: Lisbon change

16:00 - 17:30
Program Repair 4Journal-first Papers / Research Track at Fernando Pessoa
Chair(s): João Pascoal Faria Faculty of Engineering, University of Porto and INESC TEC
16:00
15m
Talk
Comprehensive Semantic Repair of Obsolete GUI Test Scripts for Mobile Applications
Research Track
Shaoheng Cao Nanjing University, Minxue Pan Nanjing University, Yu Pei The Hong Kong Polytechnic University, Wenhua Yang Nanjing University of Aeronautics and Astronautics, Tian Zhang Nanjing University, Linzhang Wang Nanjing University, Xuandong Li Nanjing University
16:15
15m
Talk
Exploring Experiences with Automated Program Repair in Practice
Research Track
Fairuz Nawer Meem George Mason University, Justin Smith Lafayette College, Brittany Johnson George Mason University
16:30
15m
Talk
PyTy: Repairing Static Type Errors in Python
Research Track
Yiu Wai Chow University of Stuttgart, Luca Di Grazia Università della Svizzera italiana (USI), Michael Pradel University of Stuttgart
Link to publication DOI Pre-print File Attached
16:45
15m
Talk
Rust-lancet: Automated Ownership-Rule-Violation Fixing with Behavior Preservation
Research Track
Wenzhang Yang University of Science and Technology of China, Linhai Song Programme Committee, Yinxing Xue University of Science and Technology of China
17:00
7m
Talk
Improving Automated Program Repair with Domain Adaptation
Journal-first Papers
Armin Zirak University of Calgary, Hadi Hemmati York University
17:07
7m
Talk
Invalidator: Automated Patch Correctness Assessment Via Semantic and Syntactic Reasoning
Journal-first Papers
Le-Cong Thanh The University of Melbourne, Duc-Minh Luong Hanoi University of Science and Technology, Xuan-Bach D. Le University of Melbourne, David Lo Singapore Management University, Nhat-Hoa Tran Hanoi University of Science and Technology, Quang-Huy Bui Hanoi University of Science and Technology, Quyet Thang Huynh Hanoi University of Science and Technology
Media Attached