skip to main content
10.1145/1992896.1992910acmconferencesArticle/Chapter ViewAbstractPublication PagesuccsConference Proceedingsconference-collections
research-article

A bottom-up approach to understand functional programs

Published: 16 May 2011 Publication History

Abstract

One affective way to carry out a program comprehension process is by refactoring the source code. In this paper we explore this approach in the functional programming paradigm, on Haskell programs specifically. As result, we have identified many correlations between the traditional (procedural and object-oriented) program comprehension process and the so called understanding-oriented refactorings, in the functional programming context. Besides, we have identified a catalog of refactorings used to improve program efficiency which, applied in reverse order, are valuable for program understanding purposes. Coupled to these refactorings, there is a calculational process by (means of) which we obtain a full formal description of program functionality. All together, a bottom-up program comprehension strategy in the functional setting is described.

References

[1]
M. Barr and C. Wells. Toposes, Triples and Theories. November 2002. Revised version - Version 1.1.
[2]
N. Benton, J. Hughes, and E. Moggi. Monads and effects. In APPSEM:International Summer School on Applied Semantics, volume 2395 of LNCS. Springer Verlag, 2000.
[3]
R. Bird and O. de Moor. Algebra of Programming. Series in Computer Science. Prentice-Hall International, 1997. C. A. R. Hoare, series editor.
[4]
B. D. Bois, S. Demeyer, and J. Verelst. Does the "refactor to understand" reverse engineering pattern improve program comprehension. In Ninth European Conference on Software Maintenance and Reengineering (CSMR'05). IEEE CS Press, March 2005.
[5]
C. Brown. Tool Support for Refactoring Haskell Programs. PhD thesis, University of Kent, Canterbury, Kent, England, September 2008.
[6]
C. Brown and S. Thompson. Clone detection and elimination for haskell. In PEPM'10, Madrid, Spain, January 2010. ACM.
[7]
A. Cunha. Point-free programming with hylomorphisms. In Workshop on Datatype-Generic Programming, Oxford, England, June 2004.
[8]
A. Cunha. Drhylo. http://wiki.di.uminho.pt/twiki/bin/view/Personal/Alcino/DrHylo, 2007.
[9]
A. Cunha, J. S. Pinto, and J. Proenca. A framework for point-free program transformation. In A. Butterfield, C. Grelck, and F. Huch, editors, 17th International Workshop on Implementation and Application of Functional Languages, volume 4015, pages 1--18. Springer-Verlag, 2006.
[10]
M. M. Fokkinga. A Gentle Introduction to Category Theory -- calculational approach, pages 1--72. University of Utrecht, Utrecht, Netherlands, 1992.
[11]
M. Fowler. Refactoring home page. http://www.refactoring.com, 2010.
[12]
N. Ghani and C. Lüth. Composing monads using coproducts. Intl. Conference on Functional Programming 2002, 37(9):133--144, 2002.
[13]
J. Gibbons. An introduction to the Bird-Meertens formalism. New Zeland Formal Program Development Colloquium Seminar, November 1994.
[14]
J. Gibbons. Lecture notes on algebraic and co-algebraic methods for calculating functional programs, March 1999.
[15]
J. Gibbons. Design patters as higher-order datatype generic programs. In Workshop on Generic Programming, Portland, Oregon, USA, September 2006. ACM SIGPLAN.
[16]
J. Gibbons. Fission for program comprehesion. In T. Uustalu, editor, 8th Int.Conference on Mathematics of Program Construction, volume 4014 of LNCS, Kuressaare, Estonia, July 2006. Springer Verlag.
[17]
C. Group. Vdm tools. http://www.vdmtools.jp/en/, 2010.
[18]
Y. G. Guéhéneuc, S. Monnier, and G. Antoniol. Evaluating the use of design patterns during program comprehension - experimental setting. In Proceedings of the 1st International Workshop in Design Pattern Theory and Practice. IEEE CS Press, 2005.
[19]
Z. Hu, T. Yokoyama, and M. Takeichi. Optimizations and transformations in calculation form. In R. Lämmel, J. Saraiva, and J. Visser, editors, Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE'05), volume 4143 of LNCS, Braga, Portugal, July 2006. Springer.
[20]
M. Jones and L. Duponcheel. Composing monads. Technical Report YALEU/DCS/RR-1004, Dept. of Computer Science, Yale University, New Haven, Connecticut, USA, December 1993.
[21]
D. King and P. Wadler. Combining monads. In Glasgow workshop on functional programming, Workshops in Computing. Springer Verlag, July 1992.
[22]
A. Lakhotia, J. Li, A. Walenstein, and Y. Yang. Towards a clone detection benchmark suite and results archive. In 11th IEEE International Workshop on Program Comprehension, IWPC'03. IEEE, 2003.
[23]
H. Li and S. Thompson. Formalisation of Haskell Refactorings. In M. van Eekelen and K. Hammond, editors, Trends in Functional Programming, September 2005.
[24]
H. Li, S. Thompson, and C. Reinke. The Haskell Refactorer: HaRe, and its API. In J. Boyland and G. Hedin, editors, Proceedings of the 5th workshop on Language Descriptions, Tools and Applications (LDTA 2005), April 2005. Published as Volume 141, Number 4 of Electronic Notes in Theoretical Computer Science.
[25]
S. Liang, P. Hudak, and M. Jones. Monad transformers and modular interpreters. In 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, CA, January 1995. ACM Press, New York, 1995.
[26]
L. Meertens. Category theory for program construction by calculation. Lecture Notes for ESSLLI'95, 1995. Barcelona, España.
[27]
E. Meijer and J. Jeuring. Merging monads and folds for functional programming. In J. Jeuring and E. Meijer, editors, Tutorial Text 1st Int. Spring School on Advanced Functional Programming Techniques, Båstad, Sweden, 24--30 May 1995, volume 925, pages 228--266. Springer-Verlag, Berlin, 1995.
[28]
T. Mens and T. Tourwe. A survey of software refactoring. IEEE Transactions on Software Engineering, 30(2):126--139, February 2004.
[29]
E. Moggi. Computational lambda-calculus and monads. In IEEE Symposium on Logic in Computer Science, pages 14--23, California, USA, June 1989.
[30]
E. Moggi. Notions of computations and monads. Informations and Computations, 93(1):55--92, 1991.
[31]
O. D. Moor and G. Sittampalam. Generic program transformation. In Proc. 3rd International Summer School on Advanced Functional Programming, LNCS 1608, pages 116--149. Springer-Verlag, 1998.
[32]
J. Oliveira. An introduction to point-free programming, 1999. Departamento de Informática, Universidade do Minho. 37p., chapter of book in preparation.
[33]
J. N. Oliveira and G. Villavicencio. Reverse program calculation supported by code slicing. In Proceedings of the 8th Working Conference on Reverse Engineering, pages 35--45, Stuttgart, Germany, October 2001. IEEE CS Press, California, USA.
[34]
A. Pardo. Fusion of recursive programs with computational effects. Theoretical Computer Science, 260(Issue 1-2):165--207, June 2001.
[35]
A. Pardo. Combining datatypes and effects. In V. Vene and T. Uustalu, editors, Advanced Functional Programming, volume 3622 of LNCS, pages 171--209. Springer Verlag, 2005.
[36]
M.-A. Storey. Theories, tools and research methods in program comprehension: past, present and future. Software Quality Control, 14(3):187--208, 2006.
[37]
M. Takeichi and Z. Hu. Calculation carrying programs - how to code program transformation. In International Symposium on Principles of Software Evolution (ISPSE'00), Kanazawa, Japan, November 2000. IEEE. Invited talk.
[38]
M. A. Tullsen. PATH, a Program Transformation System for Haskell. PhD thesis, Yale University, May 2002.
[39]
G. Villavicencio. Reverse program calculation by conditioned slicing. In Proceedings of the 7th European Conference on Software Maintenance and Reengineering, pages 368--378, Benevento, Italy, March 2003. IEEE CS Press, California, USA.
[40]
P. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73:231--248, 1990.
[41]
P. Wadler. Monads for functional programming. In Advanced Functional Programming, number 925 in LNCS. Springer Verlag, 1995.
[42]
M. Weiser. Program slicing. In Fifth International Conference on Software Engineering, San Diego, California, March 1981.

Cited By

View all
  • (2012)A New Software Maintenance Scenario Based on Refactoring TechniquesProceedings of the 2012 16th European Conference on Software Maintenance and Reengineering10.1109/CSMR.2012.41(341-346)Online publication date: 27-Mar-2012

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
C3S2E '11: Proceedings of The Fourth International C* Conference on Computer Science and Software Engineering
May 2011
162 pages
ISBN:9781450306263
DOI:10.1145/1992896
  • General Chair:
  • Bipin C. Desai,
  • Program Chairs:
  • Alain Abran,
  • Sudhir P. Mudur
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: 16 May 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. formal methods
  2. program comprehension
  3. refactorings

Qualifiers

  • Research-article

Conference

C3S2E '11
Sponsor:
  • ACM
  • Concordia University

Acceptance Rates

Overall Acceptance Rate 12 of 42 submissions, 29%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2012)A New Software Maintenance Scenario Based on Refactoring TechniquesProceedings of the 2012 16th European Conference on Software Maintenance and Reengineering10.1109/CSMR.2012.41(341-346)Online publication date: 27-Mar-2012

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media