{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,5]],"date-time":"2026-03-05T18:15:17Z","timestamp":1772734517490,"version":"3.50.1"},"reference-count":67,"publisher":"Association for Computing Machinery (ACM)","issue":"6","license":[{"start":{"date-parts":[[2024,6,27]],"date-time":"2024-06-27T00:00:00Z","timestamp":1719446400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"funder":[{"name":"National Key Research and Development Program of China","award":["2022YFF0712100"],"award-info":[{"award-number":["2022YFF0712100"]}]},{"DOI":"10.13039\/501100001809","name":"National Natural Science Foundation of China","doi-asserted-by":"crossref","award":["62302222"],"award-info":[{"award-number":["62302222"]}],"id":[{"id":"10.13039\/501100001809","id-type":"DOI","asserted-by":"crossref"}]},{"name":"Natural Science Foundation of Jiangsu Province, China","award":["BK20220937"],"award-info":[{"award-number":["BK20220937"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Softw. Eng. Methodol."],"published-print":{"date-parts":[[2024,7,31]]},"abstract":"<jats:p>Python\u2019s dynamic typing nature provides developers with powerful programming abstractions. However, many type-related bugs are accumulated in code bases of Python due to the misuse of dynamic typing. The goal of this article is to aid in the understanding of developers\u2019 high-risk practices toward dynamic typing and the early detection of type-related bugs. We first formulate the rules of six types of risky dynamic typing-related practices (type smells for short) in Python. We then develop a rule-based tool named RUPOR, which builds an accurate type base to detect type smells. Our evaluation shows that RUPOR outperforms the existing type smell detection techniques (including the Large Language Models\u2013based approaches, Mypy, and PYDYPE) on a benchmark of 900 Python methods. Based on RUPOR, we conduct an empirical study on 25 real-world projects. We find that type smells are significantly related to the occurrence of post-release faults. The fault-proneness prediction model built with type smell features slightly outperforms the model built without them. We also summarize the common patterns, including inserting type check to fix type smell bugs. These findings provide valuable insights for preventing and fixing type-related bugs in the programs written in dynamic-typed languages.<\/jats:p>","DOI":"10.1145\/3649593","type":"journal-article","created":{"date-parts":[[2024,2,26]],"date-time":"2024-02-26T12:35:42Z","timestamp":1708950942000},"page":"1-35","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":4,"title":["Risky Dynamic Typing-related Practices in Python: An Empirical Study"],"prefix":"10.1145","volume":"33","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-3475-6979","authenticated-orcid":false,"given":"Zhifei","family":"Chen","sequence":"first","affiliation":[{"name":"School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2352-2226","authenticated-orcid":false,"given":"Lin","family":"Chen","sequence":"additional","affiliation":[{"name":"State Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1153-2013","authenticated-orcid":false,"given":"Yibiao","family":"Yang","sequence":"additional","affiliation":[{"name":"State Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1667-8062","authenticated-orcid":false,"given":"Qiong","family":"Feng","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9199-9205","authenticated-orcid":false,"given":"Xuansong","family":"Li","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-4324-3382","authenticated-orcid":false,"given":"Wei","family":"Song","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Nanjing University of Science and Technology, Nanjing, China"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2024,6,27]]},"reference":[{"key":"e_1_3_2_2_2","unstructured":"2010. bottlepy\/bottle\/issues#85. Retrieved from https:\/\/github.com\/bottlepy\/bottle\/issues\/85"},{"key":"e_1_3_2_3_2","unstructured":"2018. How to Check if an Object has an Attribute? Retrieved from https:\/\/stackoverflow.com\/questions\/610883\/how-to-know-if-an-object-has-an-attribute-in-python\/610923#610923"},{"key":"e_1_3_2_4_2","unstructured":"2019. Scikit-Learn\/Scikit-Learn\/Issues#12953. Retrieved from https:\/\/github.com\/scikit-learn\/scikit-learn\/issues\/12953"},{"key":"e_1_3_2_5_2","unstructured":"2020. numpy\/numpy\/issues#16538. Retrieved from https:\/\/github.com\/numpy\/numpy\/issues\/16538"},{"key":"e_1_3_2_6_2","unstructured":"2020. numpy\/numpy\/issues#16687. Retrieved from https:\/\/github.com\/numpy\/numpy\/issues\/16687"},{"key":"e_1_3_2_7_2","unstructured":"2020. numpy\/numpy\/issues#16909. Retrieved from https:\/\/github.com\/numpy\/numpy\/issues\/16909"},{"key":"e_1_3_2_8_2","unstructured":"2020. numpy\/numpy\/issues#17194. Retrieved from https:\/\/github.com\/numpy\/numpy\/issues\/17194"},{"key":"e_1_3_2_9_2","unstructured":"2020. numpy\/numpy\/issues#17466. Retrieved from https:\/\/github.com\/numpy\/numpy\/issues\/17466"},{"key":"e_1_3_2_10_2","unstructured":"2021. ansible\/ansible\/pull#73319. Retrieved from https:\/\/github.com\/ansible\/ansible\/pull\/73319"},{"key":"e_1_3_2_11_2","unstructured":"2022. Retrieved in March 2022 from https:\/\/github.com\/"},{"key":"e_1_3_2_12_2","unstructured":"2023. The Top Programming Languages 2023. Retrieved from https:\/\/spectrum.ieee.org\/the-top-programming-languages-2023"},{"key":"e_1_3_2_13_2","doi-asserted-by":"publisher","DOI":"10.1145\/2597073.2597103"},{"key":"e_1_3_2_14_2","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3385997"},{"key":"e_1_3_2_15_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.jss.2009.06.055"},{"key":"e_1_3_2_16_2","doi-asserted-by":"publisher","DOI":"10.1109\/32.544352"},{"key":"e_1_3_2_17_2","doi-asserted-by":"publisher","DOI":"10.1145\/3340571"},{"key":"e_1_3_2_18_2","first-page":"1877","article-title":"Language models are few-shot learners","volume":"33","author":"Brown Tom","year":"2020","unstructured":"Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D. Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et\u00a0al. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems, Vol. 33, 1877\u20131901.","journal-title":"Advances in Neural Information Processing Systems"},{"key":"e_1_3_2_19_2","doi-asserted-by":"publisher","DOI":"10.1177\/0049124104268644"},{"key":"e_1_3_2_20_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10664-012-9203-2"},{"key":"e_1_3_2_21_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.infsof.2017.09.011"},{"key":"e_1_3_2_22_2","doi-asserted-by":"publisher","DOI":"10.1145\/3387904.3389253"},{"key":"e_1_3_2_23_2","unstructured":"Dropbox. 2017. PyAnnotate. Retrieved from https:\/\/github.com\/dropbox\/pyannotate"},{"key":"e_1_3_2_24_2","doi-asserted-by":"publisher","DOI":"10.1145\/1035292.1028990"},{"key":"e_1_3_2_25_2","doi-asserted-by":"publisher","DOI":"10.1109\/32.935855"},{"key":"e_1_3_2_26_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2017.75"},{"key":"e_1_3_2_27_2","doi-asserted-by":"publisher","DOI":"10.1145\/2771783.2771809"},{"key":"e_1_3_2_28_2","volume-title":"Effect Sizes for Research: A Broad Practical Approach.","author":"Grissom Robert J.","year":"2005","unstructured":"Robert J. Grissom and John J. Kim. 2005. Effect Sizes for Research: A Broad Practical Approach. Lawrence Erlbaum Associates."},{"key":"e_1_3_2_29_2","doi-asserted-by":"publisher","DOI":"10.1145\/1869459.1869462"},{"key":"e_1_3_2_30_2","first-page":"19","volume-title":"Proceedings of the 32nd Australasian Conference on Computer Science-Volume 91","author":"Holkner Alex","year":"2009","unstructured":"Alex Holkner and James Harland. 2009. Evaluating the dynamic behaviour of Python applications. In Proceedings of the 32nd Australasian Conference on Computer Science-Volume 91. 19\u201328."},{"key":"e_1_3_2_31_2","unstructured":"Instagram. 2017. MonkeyType. Retrieved from https:\/\/github.com\/Instagram\/MonkeyType"},{"key":"e_1_3_2_32_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICSM.2010.5609530"},{"key":"e_1_3_2_33_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2012.70"},{"key":"e_1_3_2_34_2","article-title":"An empirical study of type-related defects in Python projects","author":"Khan Faizan","year":"2021","unstructured":"Faizan Khan, Boqi Chen, Daniel Varro, and Shane Mcintosh. 2021. An empirical study of type-related defects in Python projects. IEEE Trans. Softw. Eng. 48, 8 (2021), 3145-3158.","journal-title":"IEEE Trans. Softw. Eng."},{"key":"e_1_3_2_35_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2012.6240483"},{"key":"e_1_3_2_36_2","unstructured":"Jukka Lehtosalo. 2014. Mypy. Retrieved from http:\/\/mypy-lang.org\/"},{"key":"e_1_3_2_37_2","doi-asserted-by":"publisher","DOI":"10.1145\/2398857.2384666"},{"key":"e_1_3_2_38_2","doi-asserted-by":"publisher","DOI":"10.1145\/1540438.1540448"},{"key":"e_1_3_2_39_2","doi-asserted-by":"publisher","DOI":"10.1109\/CSMR.2010.18"},{"key":"e_1_3_2_40_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2007.256941"},{"key":"e_1_3_2_41_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10515-010-0069-5"},{"key":"e_1_3_2_42_2","doi-asserted-by":"publisher","DOI":"10.1145\/2544173.2509515"},{"key":"e_1_3_2_43_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICPC.2017.33"},{"key":"e_1_3_2_44_2","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510124"},{"key":"e_1_3_2_45_2","doi-asserted-by":"publisher","DOI":"10.1145\/1062455.1062514"},{"key":"e_1_3_2_46_2","doi-asserted-by":"publisher","DOI":"10.1145\/3439775"},{"key":"e_1_3_2_47_2","doi-asserted-by":"publisher","DOI":"10.1145\/2889160.2889227"},{"key":"e_1_3_2_48_2","doi-asserted-by":"publisher","DOI":"10.1145\/3510003.3510038"},{"key":"e_1_3_2_49_2","doi-asserted-by":"publisher","DOI":"10.1109\/SANER50967.2021.00012"},{"key":"e_1_3_2_50_2","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE.2015.51"},{"key":"e_1_3_2_51_2","first-page":"519","volume-title":"Proceedings of 29th European Conference on Object-Oriented Programming","author":"Pradel Michael","year":"2015","unstructured":"Michael Pradel and Koushik Sen. 2015. The good, the bad, and the ugly: An empirical study of implicit type conversions in JavaScript. In Proceedings of 29th European Conference on Object-Oriented Programming. 519\u2013541."},{"key":"e_1_3_2_52_2","unstructured":"PSF. 2001. Python. Retrieved from https:\/\/www.python.org\/"},{"key":"e_1_3_2_53_2","doi-asserted-by":"publisher","DOI":"10.1145\/2393596.2393669"},{"key":"e_1_3_2_54_2","doi-asserted-by":"publisher","DOI":"10.1145\/3426422.3426981"},{"key":"e_1_3_2_55_2","doi-asserted-by":"publisher","DOI":"10.1145\/2635868.2635922"},{"key":"e_1_3_2_56_2","doi-asserted-by":"publisher","DOI":"10.1145\/1809028.1806598"},{"key":"e_1_3_2_57_2","unstructured":"SciTools. 2023. Understand. Retrieved from https:\/\/scitools.com\/"},{"key":"e_1_3_2_58_2","doi-asserted-by":"publisher","DOI":"10.1145\/1082983.1083147"},{"key":"e_1_3_2_59_2","doi-asserted-by":"publisher","DOI":"10.1145\/2168696.2047861"},{"key":"e_1_3_2_60_2","doi-asserted-by":"publisher","DOI":"10.18293\/SEKE2015-097"},{"key":"e_1_3_2_61_2","unstructured":"Yin Wang. 2016. Pysonar2. Retrieved from https:\/\/github.com\/yinwang0\/pysonar2"},{"key":"e_1_3_2_62_2","doi-asserted-by":"publisher","DOI":"10.1145\/2950290.2950357"},{"key":"e_1_3_2_63_2","doi-asserted-by":"publisher","DOI":"10.1145\/2950290.2950343"},{"key":"e_1_3_2_64_2","doi-asserted-by":"publisher","DOI":"10.1145\/2970276.2970353"},{"issue":"2","key":"e_1_3_2_65_2","first-page":"1","article-title":"Mining python fix patterns via analyzing fine-grained source code changes","volume":"27","author":"Yang Yilin","year":"2022","unstructured":"Yilin Yang, Tianxing He, Yang Feng, Shaoying Liu, and Baowen Xu. 2022. Mining python fix patterns via analyzing fine-grained source code changes. Emp. Softw. Eng. 27, 2 (2022), 1\u201337.","journal-title":"Emp. Softw. Eng."},{"key":"e_1_3_2_66_2","doi-asserted-by":"publisher","DOI":"10.1109\/TSE.2014.2370048"},{"key":"e_1_3_2_67_2","doi-asserted-by":"publisher","DOI":"10.1145\/2556777"},{"key":"e_1_3_2_68_2","doi-asserted-by":"publisher","DOI":"10.1145\/1368088.1368161"}],"container-title":["ACM Transactions on Software Engineering and Methodology"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3649593","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3649593","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T23:56:54Z","timestamp":1750291014000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3649593"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,6,27]]},"references-count":67,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2024,7,31]]}},"alternative-id":["10.1145\/3649593"],"URL":"https:\/\/doi.org\/10.1145\/3649593","relation":{},"ISSN":["1049-331X","1557-7392"],"issn-type":[{"value":"1049-331X","type":"print"},{"value":"1557-7392","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,6,27]]},"assertion":[{"value":"2023-01-07","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-02-15","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-06-27","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}