Back to results

Australian National University

Comprehensive Analysis of Programming Language Idioms and Their Application to Software Quality

Abstract

dc:description.abstract

Achieving high-quality code is fundamental to the success and sustainability of software development projects. Software quality encompasses multiple facets, including maintainability, readability, and performance, each posing its unique challenges. Achieving these goals requires a deep understanding of best practices and effective coding conventions. Programming idioms, known for their conciseness and improved performance, offer substantial benefits but also introduce complexity that can hinder their adoption. Compared to idioms in other programming languages, Pythonic idioms are particularly well-regarded and receive significant attention from the Python community and developers. This thesis explores the enhancement of software quality through the strategic use of Pythonic idioms and systematic bi-directional transformation between idiomatic and non-idiomatic Python code, focusing on three critical aspects: code maintainability, readability, and performance optimization. Firstly, we introduce an automated refactoring tool, RIdiom that transforms non-idiomatic Python code into idiomatic forms, significantly enhancing maintainability and reducing manual effort. By leveraging Large Language Models (LLMs) in a hybrid knowledge-driven approach, we synergize rule-based methods with the adaptability of LLMs to improve code detection and refactoring accuracy. This integration addresses common challenges in code transformation, boosting both precision and consistency. Additionally, our approach promotes the consistent use of best practices across codebases, ultimately contributing to more maintainable and robust software. To aid developers' understanding and proper utilization of Pythonic idioms, we explain these idioms into equivalent non-idiomatic code, bridging comprehension gaps and ensuring semantic accuracy. This intuition is particularly beneficial for developers less familiar with Pythonic constructs, helping them to avoid common pitfalls and write more idiomatic Python code. Furthermore, we conduct an empirical study to evaluate the performance impacts of Pythonic idioms, providing developers with clear, evidence-based guidelines for optimal code performance. Our study reveals that while Pythonic idioms generally enhance performance, their impact can vary based on specific usage contexts and data characteristics. Our findings reveal nuanced insights into the benefits and limitations of Pythonic idioms, supporting developers in writing more maintainable, readable and efficient code.

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Zhang, Zejun
Advisor local:contributor.supervisor
  • Xing, Zhenchang
ResearcherID local:identifier.researcherid
  • KIJ-3024-2024

Rights

Language dc:language.iso
en_AU

Identifiers

dc:identifier.*
Local Identifier Proquest
Yes
Local Identifier DOI
10.25911/NT6Z-2H53

Chain of custody

source
Harvested from
Australian National University
Base URL
openresearch-repository.anu.edu.au/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
related terms
citation

Zhang, Zejun. Comprehensive Analysis of Programming Language Idioms and Their Application to Software Quality. 2024. https://hdl.handle.net/1885/733724837