skip to main content
10.1145/1321631.1321645acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Automatic code stylizing

Published: 05 November 2007 Publication History

Abstract

Coding style is an important aspect of software development. We present a system that uses machine learning to deduce the coding style from a corpus of code and then applies this knowledge to convert arbitrary code to the learned style. We use a broad definition of coding style that includes spacing, indentation, naming, ordering, and equivalent programming constructs. The result provides a more flexible and powerful approach to code stylizing than current techniques.

References

[1]
Ronald M. Baecker and Aaron Marcus, Human Factors and Typography for More Readable Programs, Addison-Wesley (1990).
[2]
Jason Baldridge, Tom Morton, and Gann Bierner, "OpenNLP: The Maximum Entropy Framework," http://maxent.sourceforge.net/about.html, (October 2001).
[3]
Robert D. Cameron, "An abstract pretty printer," IEEE Software Vol. 5(6) pp. 61--67 (November 1988).
[4]
D. E. Critchlow, Metric Methods for Analyzing Partially Ranked Data, Springer-Verlag, Lecture Notes in Statistics, Volume 34 (1985).
[5]
Erich Gamma and Kent Beck, Contributing to Eclipse: Principles, Patterns, and Plug-ins, Addison-Wesley (2004).
[6]
James Gosling, Unix Emacs, Carnegie-Mellon Computer Science Department (August 1982).
[7]
Matti O. Jokinen, "A language-independent prettyprinter," Software Practice and Experience Vol. 19(9) pp. 839--856 (September 1989).
[8]
Brian W. Kernighan and P. J. Plauger, The Elements of Programming Style, McGraw-Hill (1974).
[9]
Richard Kirkby and Eibe Frank, "WEKA explorer user guide for version 3--5--3," University of Waikato, (June 2006).
[10]
Andrew Kachites McCallum, "MALLET: a machine learning for language toolkit," University of Massachusetts Computer Science, http://mallet.cs.umass.edu, (2002).
[11]
Scott Meyers, Effective C++, Addison-Wesley (1997).
[12]
Dereck C. Oppen, "Prettyprinting," ACM Trans. Programming Lanaguages and Systems Vol. 2(4) pp. 465--483 (October 1980).
[13]
Steven P. Reiss, "PECAN: program development systems that support multiple views," IEEE Trans. Soft. Eng. Vol. SE-11 pp. 276--284 (March 1985).
[14]
Steven P. Reiss, "The Desert environment," ACM TOSEM Vol. 8(4) pp. 297--342 (October 1999).
[15]
Lisa F. Rubin, "Syntax-directed pretty printing: a first step towards a syntax-directed editor," COMPSAC 1981, (1981).
[16]
Allan Vermeulen, Scott W. Ambler, Greg Bumgardner, Eldon Metz, Trevor Misfeldt, Jim Shur, and Patrick Thompson, The Elements of Java Style, Cambridge University Press (2000).
[17]
Philip Wadler, "A prettier printer," Bell Laboratories, (March 1998).
[18]
Ian H. Witten and Eibe Frank, Data Mining: Practical Machine Learning Tools and Techniques, 2nd Edition, Morgan Kaufmann (2005).

Cited By

View all
  • (2023)A Comprehensive Taxonomy for Prediction Models in Software EngineeringInformation10.3390/info1402011114:2(111)Online publication date: 10-Feb-2023
  • (2023)How Well Can Masked Language Models Spot Identifiers That Violate Naming Guidelines?2023 IEEE 23rd International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM59687.2023.00023(131-142)Online publication date: 2-Oct-2023
  • (2023)DUETCS: Code Style Transfer through Generation and RetrievalProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00198(2362-2373)Online publication date: 14-May-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ASE '07: Proceedings of the 22nd IEEE/ACM International Conference on Automated Software Engineering
November 2007
590 pages
ISBN:9781595938824
DOI:10.1145/1321631
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 November 2007

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. formatting
  2. pretty-printing
  3. programming style

Qualifiers

  • Research-article

Conference

ASE07

Acceptance Rates

Overall Acceptance Rate 82 of 337 submissions, 24%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)26
  • Downloads (Last 6 weeks)8
Reflects downloads up to 20 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)A Comprehensive Taxonomy for Prediction Models in Software EngineeringInformation10.3390/info1402011114:2(111)Online publication date: 10-Feb-2023
  • (2023)How Well Can Masked Language Models Spot Identifiers That Violate Naming Guidelines?2023 IEEE 23rd International Working Conference on Source Code Analysis and Manipulation (SCAM)10.1109/SCAM59687.2023.00023(131-142)Online publication date: 2-Oct-2023
  • (2023)DUETCS: Code Style Transfer through Generation and RetrievalProceedings of the 45th International Conference on Software Engineering10.1109/ICSE48619.2023.00198(2362-2373)Online publication date: 14-May-2023
  • (2023)Source Code Recommender Systems: The Practitioners' Perspective2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)10.1109/ICSE48619.2023.00182(2161-2172)Online publication date: May-2023
  • (2023)Automated variable renaming: are we there yet?Empirical Software Engineering10.1007/s10664-022-10274-828:2Online publication date: 14-Feb-2023
  • (2022)Styler: learning formatting conventions to repair Checkstyle violationsEmpirical Software Engineering10.1007/s10664-021-10107-027:6Online publication date: 1-Nov-2022
  • (2022)Using code reviews to automatically configure static analysis toolsEmpirical Software Engineering10.1007/s10664-021-10076-427:1Online publication date: 1-Jan-2022
  • (2021)A Deep Method Renaming Prediction and Refinement Approach for Java Projects2021 IEEE 21st International Conference on Software Quality, Reliability and Security (QRS)10.1109/QRS54544.2021.00052(404-413)Online publication date: Dec-2021
  • (2021)Toward automatic feedback of coding style for programming courses2021 International Conference on Advanced Learning Technologies (ICALT)10.1109/ICALT52272.2021.00017(33-35)Online publication date: Jul-2021
  • (2020)Applying probabilistic models to C++ code on an industrial scaleProceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops10.1145/3387940.3391477(595-602)Online publication date: 27-Jun-2020
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media