1 of 149

PL + HCI Grand Tour!

CS294-184: Building User-Centered Programming Tools UC Berkeley 9/27/20 & 9/29/20

2 of 149

Templates for slides 1 - 3 of each mini presentation

3 of 149

one-sentence summary of the problem that the work tackles

Name

Paper (or Project) Title

Paper (or Project) Authors

Illustration of problem, if relevant

4 of 149

one-sentence summary of the solution the paper proposes

Paper (or Project) Title

Paper (or Project) Authors

Presenter Name

Illustration of solution, if relevant

5 of 149

Paper (or Project) Title

Paper (or Project) Authors

Presenter Name

Demo video

6 of 149

Insert your slides after here!

7 of 149

Day 1

8 of 149

“turn abstract statements written in familiar math-like notation into one or more possible visual representations”

Penrose

Ye et al. (CMU graphics crew)

Yifan

9 of 149

https://www.youtube.com/watch?v=OyD4LIv2PDc&ab_channel=KeenanCrane

10 of 149

“the visual representation is user-defined in a constraint-based specification language; diagrams are then generated automatically via constrained numerical optimization”

Penrose

Ye et al. (CMU graphics crew)

Yifan

11 of 149

https://www.youtube.com/watch?v=OyD4LIv2PDc&ab_channel=KeenanCrane

12 of 149

13 of 149

https://www.youtube.com/watch?v=O60RuV2gBMk&ab_channel=ACMSIGCHI

14 of 149

Penrose

Ye et al. (CMU graphics crew)

https://www.youtube.com/watch?v=OyD4LIv2PDc&ab_channel=KeenanCrane

15 of 149

One-liners can be… idiomatic, plus annoying to write code for

J.D. Zamfirescu-Pereira

Small Step Live Programming by Example (SnipPy)

Ferdowsifard, Ordookhanians, Peleg, Lerner, & Polikarpova

Illustration of problem, if relevant

Wants to return “A.A.K”

16 of 149

Build expressions programming-by-

example using a live-updating structured view of code

Small Step Live Programming by Example (SnipPy)

Ferdowsifard, Ordookhanians, Peleg, Lerner, & Polikarpova

J.D. Zamfirescu-Pereira

17 of 149

Background: Projection Boxes

Immediate view of program’s runtime state, for example:

I’d argue that this is the actual HCI contribution...though this paper does offer an interesting evaluation of a new use for Projection Boxes!

18 of 149

SnipPy Example

A video example can be found at https://youtu.be/VqIy4iuSpzI

19 of 149

SnipPy: Multiple demonstrations (examples)

20 of 149

SnipPy: System Diagram

21 of 149

SnipPy: Expression Grammar

* had to be a bit clever for string constants...

22 of 149

SnipPy: Evaluation

Method: standard battery of tasks; SnipPy vs. Projection Boxes conditions; measures of speed, correctness, use of synthesized code; final survey.

23 of 149

SnipPy: Findings

24 of 149

SnipPy: Findings

25 of 149

Help data scientists retrieve information from previous versions of Jupyter Notebooks

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

26 of 149

An augmentation of JupyterLab that

  • automatically records versions of notebook cells and artifacts*,
  • presents high-level visual summary of changes in each version, and
  • offers an intuitive UI for browsing past activities and checking out versions of artifacts

*

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

HCI

PL

27 of 149

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

28 of 149

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

29 of 149

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

30 of 149

Conducted the user study at JupyterCon ‘18

20 cell notebook contained over 300 versions

AVG(tasks/person) = 6

Doris Xin

Towards Effective Foraging by Data Scientists to Find Past Analysis Choices

Kery, M. et. al. (CHI ‘19)

“Baseline”: For comparison, data scientists interviewed in [17] reported making many local copies of their notebook files. Imagine giving our participants over 300 files and asking them to answer a series of detailed questions about them. Many participants would have run out of time or given up.

31 of 149

When we create a layout: fix the relative sizes and positions of visual elements with constraints.

  • Under-specification: Ambiguities
  • Over-specification: Conflicts

Qitian Liao

Programming by Manipulation for Layout

Thibaud Hottelier, Ras Bodik, Kimiko Ryokai

32 of 149

Programming by Manipulation:

  • Generalizations & Specializations
  • No more conflicts
  • Visual representations of ambiguities

Programming by Manipulation for Layout

Thibaud Hottelier, Ras Bodik, Kimiko Ryokai

Qitian Liao

Example Demo

33 of 149

HCI Demo

PL Demo

Programming by Manipulation for Layout

Thibaud Hottelier, Ras Bodik, Kimiko Ryokai

Qitian Liao

34 of 149

Evaluations:

  1. Can non-programmers successfully use PBM?
  2. Can proficient programmers benefit from PBM?

Conclusions:

  1. 10/11 successfully configured all five visualizations
  2. PBM increases the speed of programmers by a factor from 2.5 to 10.6

Programming by Manipulation for Layout

Thibaud Hottelier, Ras Bodik, Kimiko Ryokai

Qitian Liao

35 of 149

An enormous number of non-programmers use Excel, and bugs in their work can be costly, time-consuming, and dangerous in a myriad of domains.

Lisa Rennels

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

36 of 149

Produce a tool that uses static analysis to automatically find spreadsheet formula errors using a (a) visualization called ‘global view’ and (b) a proposed fixes tool called ‘guided audit’.

Lisa Rennels

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

37 of 149

HCI elements

  • tool design - a simple plug-in interface with four buttons
  • observations about organization (e.g. over 90% of spreadsheets are organized by users into rectangles, most problems are reference errors etc.)
  • visualization … “takes advantage of the keen human ability to quickly spot deviations in visual patterns”
  • speed … “Users tend to have a low tolerance for tools that make them wait”

PL elements

  • anomaly-detection (e.g. information-theoretic idea of entropy as a proxy for irregularity)
  • type and unit checking
  • fault localization and testing
  • inference of programmer intent (in lots of automated debugging tools)
  • dependence graphs and static analysis
  • visualization … graph coloring algorithm

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

38 of 149

“The evaluation of ExceLint focuses on answering the following research questions.

(1) Are spreadsheet layouts really rectangular?

(2) How does the proposed fix tool compare against a state-of-the-art pattern-based tool used as an error finder?

(3) Is ExceLint fast enough to use in practice?

(4) Does it find known errors in a professionally audited spreadsheet?”

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

39 of 149

“The evaluation of ExceLint focuses on answering the following research questions.

(1) Are spreadsheet layouts really rectangular?

(2) How does the proposed fix tool compare against a state-of-the-art pattern-based tool used as an error finder?

(3) Is ExceLint fast enough to use in practice?

(4) Does it find known errors in a professionally audited spreadsheet?”

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

Precision: TP / (TP + FP)

Recall: TP / (TP + FN)

40 of 149

“The evaluation of ExceLint focuses on answering the following research questions.

(1) Are spreadsheet layouts really rectangular?

(2) How does the proposed fix tool compare against a state-of-the-art pattern-based tool used as an error finder?

(3) Is ExceLint fast enough to use in practice?

(4) Does it find known errors in a professionally audited spreadsheet?”

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

Precision: TP / (TP + FP)

Recall: TP / (TP + FN)

41 of 149

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

42 of 149

ExceLint: Automatically Finding Spreadsheet Formula Errors

Daniel W. Barowy, Emery D. Berger, and Benjamin Zorn

Lisa Rennels

DEMO (if time):

great ~15 minute video from SIGPLAN:

https://dl.acm.org/doi/10.1145/3276518

43 of 149

How should compilers explain problems to developers?

Cristina Teodoropol

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

44 of 149

Solution: Follow design principles!�

  1. Allow developers the autonomy to elaborate arguments
  2. Distinguish fixes from explanations
  3. Apply argument structure and content to the design and evaluation of error messages

Cristina Teodoropol

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

45 of 149

But first, some background

  • Argumentation theory: �Toulmin’s model of argument�
  • Macrostructure (→ “structure”):�how components combine to support larger argument�
  • Microstructure (→ “content”): phrasing and composition of sentence-level statements

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

Cristina Teodoropol

46 of 149

Problem – Research questions

  • RQ1: Are compiler errors presented as explanations helpful to developers?�

  • RQ2: How is the structure of explanations in Stack Overflow different from compiler error messages?��
  • RQ3: How is the content of explanations in Stack Overflow different from compiler error messages?

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

Cristina Teodoropol

47 of 149

Approach RQ1

Survey of professional developers asking preferences of specific OpenJDK vs Jikes compiler error messages

→ 5 pairs of error messages:�same problem, different argument structures

�E1 Deficient argument vs. simple argument

E2 Deficient argument vs. extended argument

E3 Claim-resolution vs. extended argument

E4 Different claim, same extended argument

E5 Same claim, same simple argument

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

48 of 149

Results RQ1

E1 Deficient argument vs. simple argument�

E2 Deficient argument vs. extended argument

E3 Claim-resolution vs. extended argument

Preferred a resolution�

E4 Different claim, same extended argument

Content influenced preference: natural language�

E5 Same claim, same simple argument

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

Cristina Teodoropol

49 of 149

Approach/Results RQ2 How is the structure of explanations in Stack Overflow different from compiler error messages?

  • 30 question-answer (compiler error message-Stack Overflow answer) pairs for each of top 7 programming languages�
  • Used a statistical permutation testing approach by Simpson et. al.1 to test if group of CEM and group of SO are significantly non-overlapping in structure
    • True, p = 0.008 ± 0.001

����������

1 Simpson, S. L., Lyday, R. G., Hayasaka, S., Marsh, A. P., & Laurienti, P. J. (2013). A permutation testing framework to compare groups of brain networks. Frontiers in computational neuroscience7, 171.

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

Cristina Teodoropol

50 of 149

Results RQ2 Cont’d.

How Should Compilers Explain Problems to Developers?

Barik, Titus, et al.

Cristina Teodoropol

51 of 149

How does a compiler writer know what to optimize?

An empirical study of FORTRAN programs (1971)

Donald Knuth

Will Crichton

52 of 149

Quantitative analysis of source code and runtime information

An empirical study of FORTRAN programs (1971)

Donald Knuth

Will Crichton

We also found that less than 4 percent of a program generally accounts for more than half of its running time. This [...] means that programmers can make substantial improvements in their own routines by being careful in just a few places; and optimizing compilers can be made to run much faster since they need not study the whole program with the same amount of concentration.”

53 of 149

An empirical study of FORTRAN programs (1971)

Donald Knuth

Will Crichton

“A first idea for obtaining ‘typical’ programs was to go to Stanford’s Computation Center and rummage in the waste-baskets and the recycling bins. This gave results but showed immediately what should have been obvious: waste-baskets usually receive undebugged programs.”

“Our next method of obtaining programs was to post a man by the card reader [...] the job was very time-consuming since it was necessary to ask embarrassing questions about the status of people’s programs.”

“Was this sample representative? Perhaps the users of Stanford’s computers are more sophisticated than the general programmers to be found elsewhere; after all we have such a splendid Computer Science Department! [...] But it was distressing to see what little impact our courses seem to be having, since virtually all of the programs we saw were apparently written by people who had learned programming elsewhere.”

54 of 149

Problem: How do we synthesize a SQL query given an input-output pair?

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

55 of 149

Solution: System Scythe uses abstract language for queries that makes it easier to synthesize SQL queries

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

56 of 149

Language Grammar: similar to SQL but filter predicates are replaced with holes

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

57 of 149

Abstract queries synthesized w/ enumerative approach

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

58 of 149

Predicate Synthesis uses bit vector encodings and grouping/pruning techniques to reduce search time

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

59 of 149

Evaluation: Comparing Scythe to Enum method of program synthesis on stack overflow issues

(50 unsolved cases)

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

60 of 149

Evaluation: Does not produce the simplest solution

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

61 of 149

HCI

  • Need finding: Search stack overflow for benchmarks to find what queries users struggle w/
  • Easy UI to modify input-output pairs and ask system to synthesize

PL

  • * PROGRAM SYNTHESIS *
  • Declaration of grammar, Iterative Deepening, Pruning/Grouping to reduce search space

Synthesizing Highly Expressive SQL Queries from Input-Output Examples

Chenglong Wang, Alvin Cheung, Rastislav Bodik

Jerry Song

62 of 149

Why do some programming languages fail and others succeed?

Rolando Garcia

Socio-PLT: Principles for Programing Language Adoption

Leo Meyerovich and Ariel Rabkin

63 of 149

Rolando Garcia

Socio-PLT: Principles for Programing Language Adoption

Leo Meyerovich and Ariel Rabkin

64 of 149

Programmers often have misconceptions about what code actually does and waste time investigating false leads.

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

ant

65 of 149

Theseus visualizes a program’s run-time state using code coloring and marginal notes, illuminating how code actually behaves.

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

Illustration of solution, if relevant

66 of 149

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

Programming Languages

HCI

Understand how written code actually works.

Implemented using instrumentation hooks on JavaScript source code.

Uses a trace-collecting module that is injected into programs being debugged.

Rather than requesting information explicitly, as with other debugging tools, information is always visible.

Number of times a function is called is visible along with syntax highlighting of code that is never called.

An event-oriented summary of program execution with easy navigation of source code.

67 of 149

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

68 of 149

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

Evaluation 1: Lab Study; 7 participants (all graduate students) were given 5 programming tasks, some to be performed using Theseus, and others with standard debugging tools.

Results: Inconclusive. Due to small number of participants, there was no relationship between using Theseus and debugging success found. 4 of 7 would use; 6 of 7 would recommend. Participants were pleased with how much information Theseus made available.

Evaluation 2: Interviews with 9 professional JavaScript programmers encouraged to use Theseus for 1 week.

Results: Interviews revealed little evidence about perceived or actual time-wasting.4 of 7 subjects expressed interest in more always-on displays.

Evaluation & Results

69 of 149

Griffin Prechter

Addressing Misconceptions About Code with Always-On Programming Visualizations

Tom Lieber, Joel Brandt, Robert C. Miller

Some programmers did enjoy the availability of reachability color and call counts. Some programmers adopted new problem solving strategies.

In the future, work towards increasing Theseus’s omniscience. Capture finer-grained detail of control flow and function invocation to provide even more information through always-on visualization.

Conclusions & Future Work

70 of 149

Translating keyword commands into executable code in the context of the application

Max Yao

Translating keyword commands into executable code

Greg Little, Robert C. Miller

71 of 149

Tokenize and pre-process user command, then recursively match against permutations of possible functions (and parameters) via heuristic evaluation, with limited depth.

Translating keyword commands into executable code

Greg Little, Robert C. Miller

Max Yao

72 of 149

How this came from PL:

  • Learning programming interface is a hurdle, and there are two notable approaches: programming-by-demonstration (PBD) or structured editor
    • PBD is inaccurate and you need a GOOD example
    • Structured editor is really restricting, and can be difficult to use
  • Natural Language Programming is another approach, but they’re still very limiting and inflexible.
  • Enter Keyword commands!
    • Parsed keyword(s) can be used to find the best-matched simple executable code
    • Flexible, require little context, and potentially more user friendly
    • Can be useful to provide code hints for PLs like Java
    • Number of commands is limiting because of permutations (next slide)

Translating keyword commands into executable code

Greg Little, Robert C. Miller

Max Yao

73 of 149

Suppose the user’s input has n tokens, and every substring of tokens matches f functions in the library, each taking a arguments. The first call to the recursive algorithm must try every way to divide the n tokens into a + 1 substrings in any order (one for each argument plus the function name it-self), which is O(ana). And since each substring matches f functions, this gives O(fana) possibilities for each recursive call. ince the function tree for n tokens can have at most n nodes (ignoring function inference), the total search time would be O((fana)n). In practice, f should be small (tokens match few functions), a is small (most functions take few arguments), and n is small (users use few tokens), so this worst case is unlikely to bite.

Translating keyword commands into executable code

Greg Little, Robert C. Miller

Max Yao

Evaluations: Performance

74 of 149

Evaluation: User Study

  • A web prototype written in Java and built into Firefox
  • 9 Users from the University (MIT) - 4 were CS majors

Translating keyword commands into executable code

Greg Little, Robert C. Miller

Max Yao

75 of 149

Evaluation: User Study Results

The non-programmer group succeeded at 84% of the tasks, and the programmer group succeeded at 95% of the tasks. (We found this difference statistically significant using a two- tailed t-test, with p = 0.04.) Each group averaged 1.7 attempts per task. Non-programmers completed 72% of the tasks on the first try, with only one command. The programmers achieved this for 77% of the tasks. If the system under- stood only JavaScript, and we had offered no instructions, we would have expected a completion rate around 0% for both groups.

Translating keyword commands into executable code

Greg Little, Robert C. Miller

Max Yao

76 of 149

How do you give meaning to a program with expression and type holes?

If evaluation reaches a hole, intuitively we want to keep evaluating, but also track the context and then display the result to the developer.

Contributions

  • Formal description of Hazelnut Live
  • Example interface (not evaluated) at hazel.org

Live Functional Programming with Typed Holes

Cyrus Omar, Ian Voysey, Ravi Chugh, Matthew A. Hammer

Gabriel Matute

77 of 149

Gabriel Matute

Live Functional Programming with Typed Holes

Cyrus Omar, Ian Voysey, Ravi Chugh, Matthew A. Hammer

78 of 149

Day 2

79 of 149

Problem: Data visualization is time consuming and requires expertise in data wrangling and visualization.

Sam

Visualization by Example

Chenglong Wang, Yu Feng, Rastislav Bodik, Alvin Cheung, Isil Dillig

80 of 149

Solution: Program synthesis!

Sam

Visualization by Example

Wang et al.

Output: 2-part candidate programs (wrangling + vis)

Input: Data & Visualization “sketch”

81 of 149

HCI

  • Only need to specify the output on a small number of points

Sam

Visualization by Example

Wang et al.

  • No need to figure out the appropriate intermediate data structure

82 of 149

PL

  • Enumerative search with pruning

Table transformation language

Visualization language

Sam

Visualization by Example

Wang et al.

  • Two-step synthesis with intermediate table inclusion specification

83 of 149

Evaluation

  • 83 benchmark visualizations (collected online) - time & rank of desired output

Sam

Visualization by Example

Wang et al.

84 of 149

Evaluation

  • Impact of intermediate table specification

Sam

Visualization by Example

Wang et al.

  • Impact of their new table transformation algorithm

85 of 149

How can we create a (pedagogical) programming environment to encourage novices to plan?

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

86 of 149

Build a “serious game” where players, with asymmetric abilities, take turns to create a program one “construct” at a time

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

87 of 149

Build a “serious game” where players, with asymmetric abilities, take turns to create a program one “construct” at a time

Stack

Do While

For Loop

Conditional

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

88 of 149

Build a “serious game” where players, with asymmetric abilities, take turns to create a program one “construct” at a time

Discrete Actions

Distributed Resources

Failure Condition

Enforced Turntaking

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

89 of 149

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

PL

HCI

New programming environment with significant non-typing interactions

Constructs feel a bit like structured editors or schema/idioms

Levels of abstraction for construction

Serious Games: Games designed not primarily for entertainment

Behavior-Centered Game Design: Obstacle → Desired Behavior → Mechanics

Transcripts, logs, interviews, and surveys

90 of 149

Did it work? Kinda. Compared to pair programming… (n=18)

2x time spent planning solutions in Pyrus� ...including planning around Pyrus

Otherwise, ~1.4x, but not significant

Also ~3x slower to use Pyrus

Nate

Pyrus: Designing a Collaborative Game to Promote Problem Solving Behaviors

Shi et. al., Northwestern

91 of 149

How interactive can we make synthesis? How user-friendly and efficient are these interaction methods?

ameesh

Interactive Program Synthesis

Vu Le et. al., MSR

Sampling for Bayesian Program Learning, Ellis et al. 2018.

How does the synthesizer know which program to choose?

92 of 149

Approaches to interactive Program Synthesis:

Interactive Program Synthesis

Vu Le et. al., MSR

ameesh

1. Incremental (CEGIS + efficient twists)

3. Step-based (user-guided top-down)

2. Feedback-based (clarify ambiguities in solution space with questions)

Refine search space with each iteration!

Have user tell you which next step to take

93 of 149

evaluation

ameesh

Interactive Program Synthesis

Vu Le et. al., MSR

Incremental: leads to speedup over non-incremental methods (with relatively few iterations needed)

Step-based: required less intervention from the user than when all examples must be provided manually

Feedback-based: required fewer user inputs than providing examples manually

94 of 149

takeaways

Interactive Program Synthesis

Vu Le et. al., MSR

ameesh

  • Interactive methods of synthesis, when carefully designed, can make life much easier for the user

  • Work still needs to be done on comparing different modes of interaction against one another

  • This is a first step in demonstrating how we can leverage things like language semantics, inductive synthesis, CEGIS in an interactive setting

95 of 149

Data needs to be pre-processed (wrangled) before analysis / visualizing but tools are outside of notebooks

Wrex: A Unified Programming-by-Example Interaction for

Synthesizing Readable Code for Data Scientists

Ian Drosos, Titus Barik, Philip J. Guo, Robert DeLine, Sumit Gulwani

(UCSD, Microsoft)

🦆

Example data wrangling task: create derived field

96 of 149

Generate readable wrangling code via programming by example, in the notebook environment

Wrex: A Unified Programming-by-Example Interaction for

Synthesizing Readable Code for Data Scientists

Ian Drosos, Titus Barik, Philip J. Guo, Robert DeLine, Sumit Gulwani

(UCSD, Microsoft)

🦆

A: User creates data frame

B: Wrex presents an interactive grid view, and user can create a derived column and provide example values

C: Wrex synthesizes the data transformation program, as a new cell

D: Synthesized code can be inserted into a new cell

E: Derived columns can be used

97 of 149

Generate readable wrangling code via programming by example, in the notebook environment

Wrex: A Unified Programming-by-Example Interaction for

Synthesizing Readable Code for Data Scientists

Ian Drosos, Titus Barik, Philip J. Guo, Robert DeLine, Sumit Gulwani

(UCSD, Microsoft)

🦆

98 of 149

Generate readable wrangling code via programming by example, in the notebook environment

Wrex: A Unified Programming-by-Example Interaction for

Synthesizing Readable Code for Data Scientists

Ian Drosos, Titus Barik, Philip J. Guo, Robert DeLine, Sumit Gulwani

(UCSD, Microsoft)

🦆

Qualitative Feedback

  • Manual wrangling barriers: recall of APIs and syntax
  • Grids integrate into notebooks, and are familiar
    • Iterate wrangling and analysis
  • Trust from inspecting synthesized code
    • Especially for edge cases

99 of 149

Program synthesizers are not very interactive… (but a REPL is).

.

.

.

Justin

Programming with a Read-Eval-Synth Loop

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

for i in

print("

for i in

??

Synthesizer

examples

for i in

print("

if i <=

print

else:

for i in

??

Synthesizer

examples

examples

examples

for i in

print("

Evaluator

5

for i in

print("

if i <=

print

else:

Evaluator

5

8

100 of 149

Solution: Incorporate a program�synthesizer into a REPL to form a

RESL

Justin

Programming with a Read-Eval-Synth Loop

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

101 of 149

Justin

Programming with a Read-Eval-Synth Loop

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

102 of 149

  • Sketches
  • Programming-by-example
  • “Retain” specification� (also “exclude”)

Custom discriminators to create equivalence classes for observational equivalence in enumerative search

Justin

Programming with a Read-Eval-Synth Loop: The PL

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

103 of 149

Justin

Programming with a Read-Eval-Synth Loop: The PL

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

104 of 149

Justin

Programming with a Read-Eval-Synth Loop

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

105 of 149

Evaluation: user study (quantitative analysis)

  • 19 advanced programmers that didn’t know JavaScript
  • Completed four programming tasks in JavaScript
  • Within-subjects design
  • Various combinations of REPL, RESL, REDL

Justin

Programming with a Read-Eval-Synth Loop: The HCI

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

106 of 149

RQ1: Does RESL reduce the number of edit iterations and the portion of the code written by the user? → YES

RQ2: Does RESL bridge knowledge gaps and reduce the need for documentation? YES

RQ3: Does RESL reduce task abandonment? YES

RQ4: Does RESL speed up time to solution? ¯\_()_/¯

RQ5: Are RESL users correct?YES

RQ6: Does RESL improve knowledge of JavaScript?NO

Justin

Programming with a Read-Eval-Synth Loop: The HCI

Hila Peleg, Roi Gabay, Shachar Itzhaky, Eran Yahav

107 of 149

How can teachers explore the space of student solutions to programming assignments in large computer science courses?

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

108 of 149

Using static and dynamic analysis, OverCode clusters similar solutions together and provides a way to visualize these clusters.

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

109 of 149

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

PL

HCI

Static analysis to reformat solutions to have consistent line indentation and token spacing, also gets rid of comments

(Iterative design specifically for human readability) Visualization that shows similarity and variation among solutions, with cleaned code shown for each variant

Lightweight dynamic analysis algorithm that uses variable renaming to cluster solutions whose variables take on the same sequence of values when executed on an autograder test

(Need finding) Teachers find OverCode easy to use; it allows them to read code that represents many student solutions instead of having to tediously go through every single submission

Resulting algorithm is linear in the number of solutions and the size of each solution (compared to quadratic for pairwise AST methods based on edit distance)

Teachers provide more useful feedback to students and have a better view of students’ understanding and misconceptions

110 of 149

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

User study 1 and evaluation: Subjects were asked to browse thousands of student submissions and give feedback by writing a forum post. After the task, subjects found OverCode easier to use, more helpful, and less overwhelming when compared to the baseline.

111 of 149

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

User study 2 and evaluation: Subjects were given a fixed amount of time to look at student submissions and to identify the five most frequent strategies to solve a problem. In this study, the subjects were able to look at more student solutions in the given time frame with OverCode when compared to the baseline. Furthermore, the solutions they looked at represented a wider range of student solutions for the compDeriv task, which is the most challenging of the three tasks.

112 of 149

Allen

OverCode: Visualizing Variation in Student Solutions to Programming Problems at Scale

Elena L. Glassman, Jeremy Scott, Rishabh Singh, Philip Guo, Robert C. Miller

Takeaways and Limitations:

  • Primarily used to navigate the space of correct solutions but could potentially help identify edge cases that are not captured by autograder tests
  • Some minor syntactic changes are not clustered together (i.e. x *= 2 vs. x = x * 2), requiring manual intervention with rewrite rules (which are mostly limited to find and replace)
  • Only for Python but could potentially be generalized for other languages
  • User study was only for relatively simple problems with a limited set of data structures, generalizability to complicated programs is unclear
  • Nonetheless, helpful for looking at composition and style of student code (used to help grade composition for 61A projects at some point in the past!)

113 of 149

Problem:

Mesh decompilers synthesize flat output, which do not clearly capture repetitive patterns (such as the spokes in the image) and make edits tedious and error-prone.

 

 

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

114 of 149

Solution:

Szalinksy is a tool that

    • automatically infers loops from flat programs, synthesizing a simplified Caddy program from CSG expressions (PL)
    • loops make it easier for users to customize their CAD models by simplifying the editing process (HCI)

 

 

 

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

115 of 149

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

116 of 149

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

117 of 149

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

118 of 149

Synthesizing Structured CAD Models with Equality Saturation and Inverse Transformations

Nandi, Willsey, Anderson, Wilcox, Darulova, Grossman, Tatlock

Randy

119 of 149

This paper shows how formal verification methods can be used to encode correct and appropriate social norms into the interaction design of social robots including how getting the feedback from formal verification increases designers’ ability to accurately find errors within their designs.

Gloria Tumushabe

Authoring and Verifying Human-Robot Interactions by David Porfirio, Allison Sauppé, Aws Albarghouthi, Bilge Mutlu

A scenario that inspires this:

If a robot comes to a hospital emergency room and keeps announcing its arrival, that would be rather disruptive and people would not appreciate that. Such a robot does not align with social norms.

120 of 149

  1. Microinteractions: interaction between a human and a robot.
    1. Example: a question-answer microinteraction may involve the robot asking a question and the human responding.
  2. Groups: multiple microinteractions that run in parallel and make up more complex interactions.
    • Example: asking a question and gesturing toward an object can be grouped together into an “inquiry” group.
  3. Interactions: sequences of groups that form a complete interaction
    • Example: exchanging greetings, asking a question, and bidding farewell performed in a sequence.

Implementation of Formal Verification

Gloria Tumushabe

to Illustrate the interactions, the authors use LTL (Linear Temporal Logic) to specify correctness properties of software and hardware designs.

Using model operators such as:

G humanSpeaking → ¬ robotSpeaking

(G refers to the global operator: should hold every time)

F Farewell

(F is model operator for the future interactions)

[ robotSpeaking → ( X ¬ robotSpeaking ∨ X humanReady ) ] U humanReady

(X is the next operator and U is the until operator)

121 of 149

Rover

Gloria Tumushabe

On the left is the environment that the designer does the work in.

On the right is the completed implementation of the robert delivering a package to the user implemented in Rover.

The inside such as ask is a micro interaction, the handoff and remark are a group example

122 of 149

Results from the evaluation and study

Results from the user study show that verification assistance decreases error discrepancy and increases ease of finding and interpreting errors.

Gloria Tumushabe

123 of 149

Conclusion

This paper heavily focuses on HCI as it takes into account human factors in the design of the robot. The goal of the authors is to make sure that the robot and the human work together harmoniously which is the a major component in HCI. Another aspect of HCI that is covered is having the participants use Rover and evaluating how easy it is to find and interpret the errors.

In the implementation, the authors use Linear Temporal Logic to enforce formal verification which is an aspect of PL.

Gloria Tumushabe

124 of 149

Qutub

PUMICE: A Multi-Modal Agent that Learns Concepts and Conditionals from Natural Language and Demonstrations

Toby Jia-Jun et al.

Natural Language Programming is a useful approach for task automation using intelligent agents,

But

  1. Existing systems have limited support for letting users teach the agents new, ambiguous or unclear concepts.
  2. The problem space is restricted to specific task domains, and not robust enough to other domains.

“Cold Weather..”

“Heavy Traffic..”

125 of 149

Qutub

“a new multimodal domain-independent approach that combines natural language programming and programming-by-demonstration to allow users to first naturally describe tasks and associated conditions at a high level, and then collaborate with the agent to recursively resolve any ambiguities or vagueness through conversations and demonstrations.”

126 of 149

Qutub

FORMATIVE STUDY FINDINGS-

  1. App GUI grounding reduces unclear concept usage.
  2. Unmet user expectation of common sense reasoning.
  3. Frequent omission of Else statements.

PUMICE

An agent that supports understanding of ambiguous natural language instructions for task by recursive definition of new/vague concepts in a multi-level top-down process.

Design Features :

  • Support for Concept Learning
  • Concept Generalization & Reuse
  • Error Recovery & Backtracking

System Implementation:

  • Semantic Parsing
  • Demonstration Recording & Replaying
  • Knowledge Representation

127 of 149

HCI Elements

  • “Closeness of mapping” notion from cognitive dimensions of notations.
  • User-Centered design approach - PBD - leverage 3rd Party GUIs
  • Formative study for needfinding.
  • Evaluation - Post surveys.

PL Elements

  • Semantic Parsing - The parser parses user utterances into expressions in a simple functional DSL for PUMICE.
  • Natural Language Programming
  • Multi-modal approach - Part of a program synthesis problem. (why,what,how)

Qutub

128 of 149

Qutub

EVALUATION & RESULTS

  • Four types of tasks provided to 10 participants.
  • Task was to use PUMICE to create a new task automation, with conditionals/concepts.

  • Total time tasks ranged from 19.4-25 mins.
  • Avg. total time for programmers < non-programmers. Diff. not statistically significant.
  • Post Survey - On a 7-point Likert scale
    • Avg. 6.2 on “I feel PUMICE is easy to use”
    • 6.1 on “I find my interactions with PUMICE natural”
    • 6.9 on “I think PUMICE is a useful tool for automating tasks on smartphones,” indicating that our participants were generally satisfied with their experience using PUMICE.

129 of 149

Qutub

PUMICE Short Demo

130 of 149

Professional webpages embed stylesheets that are complex and difficult for novices to understand

Vibhor

Ply: A Visual Web Inspector for Learning from Professional Webpages

Sarah Lim et al.

131 of 149

Ply helps novices learn CSS concepts and design patterns using CSS pruning and dependency map

Ply: A Visual Web Inspector for Learning from Professional Webpages

Sarah Lim et al.

Vibhor

132 of 149

Needfinding Study

Problems

  • Surveyed 20 undergrad students (with some web development experience)
  • In lab study on 10 students with tasks to design a web page
  • Visually ineffective properties were the primary source of frustration
  • More sophisticated effects require coordination of CSS properties

Ply displays Implicit dependencies

Ply prunes Ineffective properties

Problem of Ineffective Properties

Problem of Implicit Dependencies

133 of 149

HCI elements

  • Interactive tool with User Interface
  • Needfinding and Usability Testing
  • Visual Regression

PL elements

  • Program slicing aims to approximate the minimal subset of a program necessary for the visual component
  • Redundancy analysis determines which style rules apply to which DOM elements

Ply: A Visual Web Inspector for Learning from Professional Webpages

Sarah Lim et al.

Vibhor

Demo: Ply on CalCentral

134 of 149

Results

  • 12 students (undergrad and grad)
    • Ply users completed their milestones about 50% faster
    • Novices could identify dependencies better

Ply: A Visual Web Inspector for Learning from Professional Webpages

Sarah Lim et al.

Vibhor

135 of 149

An Empirical Investigation of Programming Language Syntax

Andreas Stefik, Susanna Siebert

Pratyush Mishra

Programming language design is often ad-hoc and based on gut feelings and “best practices” (see: PL flamewars)

How to do evidence-based PL design?

136 of 149

An Empirical Investigation of Programming Language Syntax

Andreas Stefik, Susanna Siebert

Pratyush Mishra

This paper proposes an evidence-based approach to designing one aspect of PL design: syntax.�

  1. What is the most “intuitive” syntax for a concept? (loops, conditionals, assignment, etc)�
  2. Does syntax from existing languages accurately capture a concept?�
  3. Are new “evidence-based” languages better for novices?�
  4. Where does existing syntax fall short?

137 of 149

Questions 1 & 2

Results

  1. There’s a difference in “intuitiveness” b/w languages
  2. Different constructs have different intuitiveness
  3. Programming experience affects ratings

Method�Surveys asking students to rank the intuitiveness of code samples��Languages: Java, Python, ..., Quorum

1) What is the most “intuitive” syntax for a concept?

2) Does syntax from existing languages accurately capture a concept?

Evidence-based PL for novices

138 of 149

Questions 3 & 4

Results

  • Languages designed for novices via experimental feedback lead to fewer syntactic errors
  • Novices perform as bad on standard languages (Java, Perl) as on Randomo

Method�Asked students to look at code samples, and write new code��Languages: Java, Python, Ruby, Quorum, and Randomo

3) Are new “evidence-based” languages better for novices?�

4) Where does existing syntax fall short?

Like Quorum, but with random tokens

139 of 149

How to figure out which parts of syntax are confusing?

Technique: Token Attention Maps

Annotate each token with fraction of participants that used it correctly�

x = 1

for i in 1..50

x = x - i

// line 3 inside loop

end

140 of 149

Example: using TAMs to simplify Quorum

141 of 149

User Interaction Models for Disambiguation in Programming by Example

Mikaël Mayer, Gustavo Soares , Maxim Grechkin, Vu Le, Mark Marron, Oleksandr Polozov, Rishabh Singh, Benjamin Zorn, Sumit Gulwani

Peitong Duan

Problem: Programming by Example (PBE, i.e. synthesizing programs based on input examples specified by user) can be ambiguous

  • Many different programs may be consistent with the provided examples
  • This could lead to an unintended program being synthesized
    • Provide unexpected results for inputs the user cares about

142 of 149

User Interaction Models for Disambiguation in Programming by Example

Mayer et. al.

Peitong Duan

Solution: Two user interaction models to narrow down synthesized program candidates

Program Navigation

Conversational Clarification

143 of 149

User Interaction Models for Disambiguation in Programming by Example

Mayer et. al.

Peitong Duan

144 of 149

User Interaction Models for Disambiguation in Programming by Example

Mayer et. al.

Peitong Duan

HCI

Two novel interaction models of how users could resolve ambiguity in PBE

A new PBE framework that that utilizes both models

User study that evaluated the effectiveness of both models

PL

Utilize version space algebra to succinctly represent the program set based on shared subspaces

Program Navigation: Used templating-based strategy to paraphrase programs into English

Conversational Clarification: Algorithm to iteratively narrow down top subexpressions candidates based on clarifying questions

145 of 149

User Interaction Models for Disambiguation in Programming by Example

Mayer et. al.

Peitong Duan

RQ1: Program Navigation and Conversational Clarification both improve program correctness

RQ2: Conversational Clarification is perceived as more useful than Program Navigation

RQ3: Conversational Clarification increased trust in the PBE system.

146 of 149

Current methods for synthesis of code snippets are inexpressive and limited e.g. autocomplete

Richard Lin

CodeHint: Dynamic and Interactive Synthesis of Code Snippets

Sen et. al. (Go bears!)

Illustration of problem, if relevant

147 of 149

New method for code synthesis that is dynamic, easy to use, and interactive

CodeHint: Dynamic and Interactive Synthesis of Code Snippets

Sen et. al. (Go bears!)

Richard Lin

How?

  • Exploit the dynamic context by setting a breakpoint in the code and exploring possible results
  • Give specifications on values, types, or predicates to filter candidate statements
  • Evaluate candidates and iterate on specifications
  • It’s a plug-in! With a cool algorithm!

148 of 149

CodeHint: Dynamic and Interactive Synthesis of Code Snippets

Sen et. al. (Go bears!)

Richard Lin

4:18 - 6:32

149 of 149

Results

  • CodeHint allows subjects to complete more tasks in less time with fewer bugs than those without it by more than a factor of two!

HCI: Interactive, less ambiguity

PL: Generate possible candidates using dynamic context, suggest more likely statements, code synthesis

CodeHint: Dynamic and Interactive Synthesis of Code Snippets

Sen et. al. (Go bears!)

Richard Lin