Investigating Type Declaration Mismatches in Python

Luca Pascarella, Achyudh Ram, Azqa Nadeem, Dinesh Bisesser, Norman Knyazev, Alberto Bacchelli

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

2 Citations (Scopus)
44 Downloads (Pure)


Past research provided evidence that developers making code changes sometimes omit to update the related documentation, thus creating inconsistencies that may contribute to faults and crashes. In dynamically typed languages, such as Python, an inconsistency in the documentation may lead to a mismatch in type declarations only visible at runtime.
With our study, we investigate how often the documentation is inconsistent in a sample of 239 methods from five Python open- source software projects. Our results highlight that more than 20% of the comments are either partially defined or entirely missing and that almost 1% of the methods in the analyzed projects contain type inconsistencies. Based on these results, we create a tool, PyID, to early detect type mismatches in Python documentation and we evaluate its performance with our oracle.
Original languageEnglish
Title of host publication2018 IEEE Workshop on Machine Learning Techniques for Software Quality Evaluation (MaLTeSQuE)
Place of PublicationPiscataway, NJ
Number of pages6
ISBN (Electronic)978-1-5386-5920-5
Publication statusPublished - 2018
EventMaLTeSQuE 2018: 2nd Workshop on Machine Learning Techniques in Software Quality Evaluation - Campobasso, Italy
Duration: 20 Mar 201820 Mar 2018
Conference number: 2


WorkshopMaLTeSQuE 2018
OtherCollocated with SANER
Internet address

Bibliographical note

Accepted Author Manuscript


  • Documentation
  • Python
  • Tools
  • Runtime
  • Computer crashes
  • Libraries


Dive into the research topics of 'Investigating Type Declaration Mismatches in Python'. Together they form a unique fingerprint.

Cite this