Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2983990.2984007acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Computing repair alternatives for malformed programs using constraint attribute grammars

Published: 19 October 2016 Publication History

Abstract

Attribute grammars decorate the nodes of a program's parse tree with attributes whose values are defined by equations encoding the (static) semantics of a programming language. We show how replacing the equations of an attribute grammar with equivalent constraints that can be solved by a constraint solver allows us to compute repairs of a malformed program solely from a specification that was originally designed for checking its well-formedness. We present two repair modes --- shallow and deep fixing --- whose computed repair alternatives are guaranteed to repair every error on which they are invoked. While shallow fixing may introduce new errors, deep fixing never does; to make it tractable, we implement it using neighborhood search. We demonstrate the feasibility of our approach by implementing it on top of ExtendJ, an attribute grammar based Java compiler, and by applying it to an example from the Java EE context, detecting and fixing well-formedness errors (both real and injected) in a body of 14 open-source subject programs.

References

[1]
J. T. Boyland. Remote attribute grammars. J. ACM, 52(4): 627–687, 2005.
[2]
Y. Brun, R. Holmes, M. D. Ernst, and D. Notkin. Speculative analysis: exploring future development states of software. In Proceedings of the Workshop on Future of Software Engineering Research, FoSER 2010, at the 18th ACM SIGSOFT International Symposium on Foundations of Software Engineering, 2010, Santa Fe, NM, USA, November 7-11, 2010, pages 59–64, 2010.
[3]
F. Demarco, J. Xuan, D. L. Berre, and M. Monperrus. Automatic repair of buggy if conditions and missing preconditions with SMT. In Proceedings of the 6th International Workshop on Constraints in Software Testing, Verification, and Analysis, CSTVA 2014, Hyderabad, India, May 31, 2014, pages 30–39, 2014.
[4]
P. Deransart and J. Maluszynski. Relating logic programs and attribute grammars. J. Log. Program., 2(2):119–155, 1985.
[5]
W. Dietl, S. Dietzel, M. D. Ernst, K. Muslu, and T. W. Schiller. Building and using pluggable type-checkers. In Proceedings of the 33rd International Conference on Software Engineering, ICSE 2011, Waikiki, Honolulu, HI, USA, May 21-28, 2011, pages 681–690, 2011.
[6]
A. Egyed, E. Letier, and A. Finkelstein. Generating and evaluating choices for fixing inconsistencies in UML design models. In 23rd IEEE/ACM International Conference on Automated Software Engineering (ASE 2008), 15-19 September 2008, L’Aquila, Italy, pages 99–108, 2008. 2008.20.
[7]
T. Ekman and G. Hedin. The JastAdd extensible Java compiler. In Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2007, October 21-25, 2007, Montreal, Quebec, Canada, pages 1–18, 2007.
[8]
S. Erdweg, T. van der Storm, M. Völter, L. Tratt, R. Bosman, W. R. Cook, A. Gerritsen, A. Hulshout, S. Kelly, A. Loh, G. D. P. Konat, P. J. Molina, M. Palatnik, R. Pohjonen, E. Schindler, K. Schindler, R. Solmi, V. A. Vergu, E. Visser, K. van der Vlist, G. Wachsmuth, and J. van der Woning. Evaluating and comparing language workbenches: Existing results and benchmarks for the future. Computer Languages, Systems & Structures, 44:24–47, 2015.
[9]
M. Fowler. Domain-Specific Languages. The Addison-Wesley signature series. Addison-Wesley, 2011. ISBN 978-0-321- 71294-3.
[10]
E. C. Freuder and A. K. Mackworth, editors. Constraint-Based Reasoning. The MIT Press, 1994.
[11]
D. Gopinath, M. Z. Malik, and S. Khurshid. Specificationbased program repair using SAT. In Tools and Algorithms for the Construction and Analysis of Systems - 17th International Conference, TACAS 2011, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2011, Saarbrücken, Germany, March 26-April 3, 2011. Proceedings, pages 173–188, 2011.
[12]
J. Gosling. Algebraic Constraints. PhD thesis, Department of Computer Science, Carngeie-Mellon University, 1983. CMUCS-83-132.
[13]
G. Gottlob, G. Greco, and T. Mancini. Conditional constraint satisfaction: Logical foundations and complexity. In IJCAI 2007, Proceedings of the 20th International Joint Conference on Artificial Intelligence, Hyderabad, India, January 6-12, 2007, pages 88–93, 2007.
[14]
G. Hedin. Reference attributed grammars. Informatica (Slovenia), 24(3), 2000.
[15]
G. Hedin and E. Magnusson. Jastadd–an aspect-oriented compiler construction system. Sci. Comput. Program., 47 (1):37–58, 2003.
[16]
P. V. Hentenryck and L. Michel. Constraint-based local search. MIT Press, 2005. ISBN 978-0-262-22077-4.
[17]
T. Hottelier and R. Bodík. Synthesis of layout engines from relational constraints. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, part of SLASH 2015, Pittsburgh, PA, USA, October 25-30, 2015, pages 74–88, 2015.
[18]
M. Jourdan. An optimal-time recursive evaluator for attribute grammars. In International Symposium on Programming, 6th Colloquium, Toulouse, April 17-19, 1984, Proceedings, pages 167–178, 1984.
[19]
D. E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127–145, 1968. BF01692511.
[20]
Linda DeMichiel. JSR 317: Java Persistence API, Version 2.0. JSR Specification, online at https://jcp.org/en/jsr/detail?id=317.
[21]
S. Markstrum, D. Marino, M. Esquivel, T. D. Millstein, C. Andreae, and J. Noble. Javacop: Declarative pluggable types for java. ACM Trans. Program. Lang. Syst., 32(2), 2010.
[22]
K. Muslu, Y. Brun, R. Holmes, M. D. Ernst, and D. Notkin. Speculative analysis of integrated development environment recommendations. In Proceedings of the 27th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2012, part of SPLASH 2012, Tucson, AZ, USA, October 21-25, 2012, pages 669–682, 2012.
[23]
C. Nentwich, W. Emmerich, and A. Finkelstein. Consistency management with repair actions. In Proceedings of the 25th International Conference on Software Engineering, May 3-10, 2003, Portland, Oregon, USA, pages 455–464, 2003.
[24]
H. D. T. Nguyen, D. Qi, A. Roychoudhury, and S. Chandra. Semfix: program repair via semantic analysis. In 35th International Conference on Software Engineering, ICSE ’13, San Francisco, CA, USA, May 18-26, 2013, pages 772–781, 2013.
[25]
J. Palsberg and M. I. Schwartzbach. Object-oriented type systems. Wiley professional computing. Wiley, 1994. ISBN 978-0-471-94128-6.
[26]
A. Reder and A. Egyed. Computing repair trees for resolving inconsistencies in design models. In IEEE/ACM International Conference on Automated Software Engineering, ASE’12, Essen, Germany, September 3-7, 2012, pages 220–229, 2012.
[27]
H. Samimi, M. Schäfer, S. Artzi, T. D. Millstein, F. Tip, and L. J. Hendren. Automated repair of HTML generation errors in PHP applications using string constraint solving. In 34th International Conference on Software Engineering, ICSE 2012, June 2-9, 2012, Zurich, Switzerland, pages 277–287, 2012.
[28]
M. Schäfer, A. Thies, F. Steimann, and F. Tip. A comprehensive approach to naming and accessibility in refactoring Java programs. IEEE Trans. Software Eng., 38(6):1233–1257, 2012.
[30]
F. Steimann. From well-formedness to meaning preservation: model refactoring for almost free. Software and System Modeling, 14(1):307–320, 2015.
[31]
F. Steimann. Refactoring and beyond. In R. Lämmel, J. Saraiva, and J. Visser, editors, Grand and Timely Topics in Software Engineering V, International Summer School, GTTSE 2015, Braga, Portugal, July, 2015. Revised Papers, Lecture Notes in Computer Science. Springer, 2017. In preparation.
[32]
F. Steimann and B. Ulke. Generic model assist. In Model-Driven Engineering Languages and Systems - 16th International Conference, MODELS 2013, Miami, FL, USA, September 29 - October 4, 2013. Proceedings, pages 18–34, 2013.
[34]
F. Steimann and J. von Pilgrim. Constraint-based refactoring with foresight. In ECOOP 2012 - Object-Oriented Programming - 26th European Conference, Beijing, China, June 11-16, 2012. Proceedings, pages 535–559, 2012.
[35]
F. Steimann, C. Kollee, and J. von Pilgrim. A refactoring constraint language and its application to Eiffel. In ECOOP 2011 - Object-Oriented Programming - 25th European Conference, Lancaster, UK, July 25-29, 2011 Proceedings, pages 255–280, 2011.
[36]
F. Tip, R. M. Fuhrer, A. Kiezun, M. D. Ernst, I. Balaban, and B. D. Sutter. Refactoring using type constraints. ACM Trans. Program. Lang. Syst., 33(3):9, 2011.
[37]
[38]
B. Ulke and F. Steimann. OCL as a constraint generation language. In Proceedings of the MODELS 2013 OCL Workshop co-located with the 16th International ACM/IEEE Conference on Model Driven Engineering Languages and Systems (MODELS 2013), Miami, USA, September 30, 2013.
[39]
, pages 93–102, 2013.
[40]
H. van Antwerpen, P. Neron, A. P. Tolmach, E. Visser, and G. Wachsmuth. A constraint language for static semantic analysis based on scope graphs. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pages 49–60, 2016.
[41]
W. M. Waite and G. Goos. Compiler Construction. Texts and Monographs in Computer Science. Springer, 1984. ISBN 978-1-4612-9731-4.
[42]
D. A. Watt and O. L. Madsen. Extended attribute grammars. The Computer Journal, 26(2):142–153, 1983.
[43]
B. T. V. Zanden. Constraint grammars-a new model for specifying graphical applications. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, CHI 1989, Austin, Texas, USA, April 30 - June 4, 1989, pages 325–330, 1989.
[44]
B. T. V. Zanden, B. A. Myers, D. A. Giuse, and P. A. Szekely. Integrating pointer variables into one-way constraint models. ACM Trans. Comput.-Hum. Interact., 1(2):161–213, 1994.

Cited By

View all
  • (2025)Ranking guidance actions to support engineers in fulfilling process constraintsJournal of Software: Evolution and Process10.1002/smr.272937:1Online publication date: 22-Jan-2025
  • (2024)Supporting Engineering Process Compliance via Generation of Detailed Guidance ActionsProceedings of the 2024 International Conference on Software and Systems Processes10.1145/3666015.3666019(87-97)Online publication date: 4-Sep-2024
  • (2019)Detecting and exploring side effects when repairing model inconsistenciesProceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3357766.3359546(113-126)Online publication date: 20-Oct-2019
  • Show More Cited By

Index Terms

  1. Computing repair alternatives for malformed programs using constraint attribute grammars

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
      October 2016
      915 pages
      ISBN:9781450344449
      DOI:10.1145/2983990
      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 the author(s) 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

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 19 October 2016

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. attribute grammars
      2. constraints
      3. repair

      Qualifiers

      • Research-article

      Funding Sources

      Conference

      SPLASH '16
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 268 of 1,244 submissions, 22%

      Upcoming Conference

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

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

      Other Metrics

      Citations

      Cited By

      View all
      • (2025)Ranking guidance actions to support engineers in fulfilling process constraintsJournal of Software: Evolution and Process10.1002/smr.272937:1Online publication date: 22-Jan-2025
      • (2024)Supporting Engineering Process Compliance via Generation of Detailed Guidance ActionsProceedings of the 2024 International Conference on Software and Systems Processes10.1145/3666015.3666019(87-97)Online publication date: 4-Sep-2024
      • (2019)Detecting and exploring side effects when repairing model inconsistenciesProceedings of the 12th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3357766.3359546(113-126)Online publication date: 20-Oct-2019
      • (2018)Constraint-based run-time state migration for live modelingProceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3276604.3276611(108-120)Online publication date: 24-Oct-2018
      • (2018)ExtendJ: extensible Java compilerCompanion Proceedings of the 2nd International Conference on the Art, Science, and Engineering of Programming10.1145/3191697.3213798(234-235)Online publication date: 9-Apr-2018
      • (2018)Constraint-Based RefactoringACM Transactions on Programming Languages and Systems10.1145/315601640:1(1-40)Online publication date: 3-Jan-2018
      • (2017)Robust projectional editingProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136034(79-90)Online publication date: 23-Oct-2017
      • (2017)Partial evaluation of OCL expressionsProceedings of the ACM/IEEE 20th International Conference on Model Driven Engineering Languages and Systems10.1109/MODELS.2017.31(63-73)Online publication date: 17-Sep-2017

      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