Direct Manipulation for Imperative Programs

Direct manipulation is a programming paradigm in which the programmer conveys the intended program behavior by modifying program values at runtime. The programming environment then finds a modification of the original program that yields the manipulated values. In this paper, we propose the first framework for direct manipulation of imperative programs. First, we introduce direct state manipulation, which allows programmers to visualize the trace of a buggy program on an input, and modify variable values at a location. Second, we propose a synthesis technique based on program sketching and quantitative objectives to efficiently find the “closest” program to the original one that is consistent with the manipulated values. We formalize the problem and build a tool JDial based on the Sketch synthesizer. We investigate the effectiveness of direct manipulation by using JDial to fix benchmarks from introductory programming assignments. In our evaluation, we observe that direct state manipulations are an effective specification mechanism: even when provided with a single state manipulation, JDial can produce desired program modifications for 66% of our benchmarks while techniques based only on test cases always fail.

[1]  Koushik Sen,et al.  CodeHint: dynamic and interactive synthesis of code snippets , 2014, ICSE.

[2]  Viktor Kuncak,et al.  An Update on Deductive Synthesis and Repair in the Leon Tool , 2016, SYNT@CAV.

[3]  Emina Torlak,et al.  Angelic debugging , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[4]  Rishabh Singh,et al.  Modular Synthesis of Sketches Using Models , 2014, VMCAI.

[5]  Sumit Gulwani,et al.  Learning Syntactic Program Transformations from Examples , 2016, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[6]  Mark Weiser,et al.  Program Slicing , 1981, IEEE Transactions on Software Engineering.

[7]  Ben Shneiderman,et al.  Direct manipulation: A step beyond programming languages (abstract only) , 1981, CHI '81.

[8]  Claire Le Goues,et al.  A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[9]  Christian von Essen,et al.  Program repair without regret , 2013, Formal Methods Syst. Des..

[10]  Philip J. Guo Online python tutor: embeddable web-based program visualization for cs education , 2013, SIGCSE '13.

[11]  Subhajit Roy,et al.  Synergistic debug-repair of heap manipulations , 2017, ESEC/SIGSOFT FSE.

[12]  Abhik Roychoudhury,et al.  DirectFix: Looking for Simple Program Repairs , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[13]  Thomas Ball,et al.  Modular and verified automatic program repair , 2012, OOPSLA '12.

[14]  Amey Karkare,et al.  A feasibility study of using automated program repair for introductory programming assignments , 2017, ESEC/SIGSOFT FSE.

[15]  Rastislav Bodík,et al.  Programming by manipulation for layout , 2014, UIST.

[16]  Rupak Majumdar,et al.  Cause clue clauses: error localization using maximum satisfiability , 2010, PLDI '11.

[17]  Michael Striewe,et al.  A Review of Static Analysis Approaches for Programming Exercises , 2014, CAA.

[18]  Ben Shneiderman,et al.  Direct Manipulation: A Step Beyond Programming Languages , 1983, Computer.

[19]  Sumit Gulwani,et al.  Automated clustering and program repair for introductory programming assignments , 2016, PLDI.

[20]  Björn Hartmann,et al.  TraceDiff: Debugging unexpected code behavior using trace divergences , 2017, 2017 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[21]  David Lo,et al.  S3: syntax- and semantic-guided repair synthesis via programming by examples , 2017, ESEC/SIGSOFT FSE.

[22]  Sumit Gulwani,et al.  Automated feedback generation for introductory programming assignments , 2012, PLDI.

[23]  Nikolai Tillmann,et al.  Code hunt: gamifying teaching and learning of computer science at scale , 2014, L@S.

[24]  Rishabh Singh,et al.  Qlose: Program Repair with Quantitative Objectives , 2016, CAV.

[25]  Ravi Chugh,et al.  Semi-Automated SVG Programming via Direct Manipulation , 2016, UIST.

[26]  Mayur Naik,et al.  From symptom to cause: localizing errors in counterexample traces , 2003, POPL '03.

[27]  E. Allen Emerson,et al.  Cost-Aware Automatic Program Repair , 2013, SAS.

[28]  Ravi Chugh,et al.  Programmatic and direct manipulation, together at last , 2015, PLDI.

[29]  Xiangyu Zhang,et al.  Apex: automatic programming assignment error explanation , 2016, OOPSLA.

[30]  Roderick Bloem,et al.  Automated error localization and correction for imperative programs , 2011, 2011 Formal Methods in Computer-Aided Design (FMCAD).

[31]  Dawei Qi,et al.  SemFix: Program repair via semantic analysis , 2013, 2013 35th International Conference on Software Engineering (ICSE).