Hi, I’m Sam, a PhD student at UC San Diego.
Last summer, I worked with Microsoft Research in Cambridge on TweakIt.
TweakIt is a system that supports end-user programmers who transmogrify code.
One of my co-authors, his dad is a microbiologist, and he has a problem.
He’s working with protein sequences in a spreadsheet.
But he can’t find a formula that works with his specific protein structures.
He does a web search and the first result is a code example that uses a Python package
for proteins.
It looks promising!
But now he has a few more problems.
First, there’s no obvious way to run Python code in his spreadsheet.
Second, the code example needs a bit of tweaking to work on his data.
Formative interviews with 10 data analysts found this story common among analysts.
For these analysts, it was less about writing code and more about transmogrifying it.
They didn’t write code from scratch.
Instead, they cobbled together code snippets from websites like Stack Overflow.
They needed grit _and_ serendipity to get these snippets working, because they used
trial-and-error in lieu of detailed understanding of the program.
To help these end-users, we developed TweakIt, a system that supports code tweaking through
a familiar live interaction.
We evaluated TweakIt’s usability through an in-lab study.
Let’s say we have a user named Robin who wants to take the complement of RNA sequences.
She finds code examples from the web.
Robin opens TweakIt, an extension to Excel that provides a scratchpad for Python code.
She pastes in her examples.
TweakIt automatically tries to install missing packages, in this case the biopython package.
To understand what the code does, TweakIt lets Robin click on code expressions.
TweakIt previews the output of the code expression directly in the spreadsheet.
If Robin edits the code, TweakIt will update the preview.
TweakIt also displays the previous output in orange.
This lets Robin quickly compare any two code expressions by clicking on them in sequence.
Now, she wants to apply the code onto the data in her spreadsheet.
TweakIt provides Python variables that always match Robin’s currently selected Excel data.
Robin replaces the hard-coded examples with that Python variable.
Now, she can select different data to check each output.
And, she can select a column to apply the code on all her data at once.
Finally, she can click the Save Output to Sheet button to persist the previews into
her sheet.
When my co-author’s dad was trying to use Python code, I pointed out two problems he
faced: running the code and tweaking the code.
To address the first problem, TweakIt is embedded directly inside the analyst’s existing spreadsheet
workflow.
To address the second problem, TweakIt provides live output previews to make the code more
concrete.
To see how analysts use TweakIt’s live output previews, we conducted a small lab study.
We asked 14 analysts to perform data cleaning tasks using TweakIt.
For each task, we provided several code examples from web search that analysts had to sift
through.
Analysts found the live previews useful, and preferred using live previews to make guesses
about what the code did instead of looking up documentation.
They used live previews to explore the code examples, and felt that live previews gave
them more confidence in working with the examples.
But, analysts struggled to make successful code edits and only completed a third of the
tasks we provided.
We speculate that TweakIt helps with understanding what existing code examples do, but doesn’t
provide much help with actually editing the code.
Still, analysts as a whole were enthusiastic about using TweakIt in their workflows to
work with code.
In sum, we identified problems that data analysts face in transmogrifying code.
To address these problems, we designed TweakIt, a system that sits in analysts’ existing
workflows and uses live previews to make code more concrete.
Analysts felt that TweakIt’s affordances empowered them to understand and reuse unfamiliar
code.
For me, TweakIt points to a future where any data analyst can make use of the many code
examples available today.