Hairball: Lint-inspired Static Analysis of Scratch Projects

27
Hairball: Lint- inspired Static Analysis of Scratch Projects Bryce Boe 2013/03/07 University of California Santa Barbara Bryce Boe, Charlotte Hill, Michelle Len, Greg Dreschler, Phillip Conrad, Diana Franklin

description

Hairball: Lint-inspired Static Analysis of Scratch Projects. Bryce Boe 2013/03/07 University of California Santa Barbara. Motivation. Scratch project assessment is tedious and error prone takes away from student interaction time Scratch programming - PowerPoint PPT Presentation

Transcript of Hairball: Lint-inspired Static Analysis of Scratch Projects

Page 1: Hairball: Lint-inspired Static Analysis of Scratch Projects

Bryce Boe, Charlotte Hill, Michelle Len, Greg Dreschler, Phillip Conrad, Diana Franklin

Hairball: Lint-inspired Static Analysis of Scratch Projects

Bryce Boe2013/03/07

University of California Santa Barbara

Page 2: Hairball: Lint-inspired Static Analysis of Scratch Projects

Motivation

• Scratch project assessment– is tedious and error prone– takes away from student interaction time

• Scratch programming– becomes relatively more difficult to manage as the

project size grows– has nearly no tools to check for correctness

Page 3: Hairball: Lint-inspired Static Analysis of Scratch Projects

Related Work

• J. C. Adams and A. R. Webster. What do students learn about programming from game, music video and storytelling projects? SIGCSE 2012.

• Q. Burke and Y. B. Kafai. The writers’ workshop for youth programmers: digital storytelling with scratch in middle school classrooms. SIGCSE 2012.

Page 4: Hairball: Lint-inspired Static Analysis of Scratch Projects

Background

• Assessed four Scratch concepts from a two week summer camp– 58 projects across 5 assignments– See tomorrow’s talk:• Assessment of Computer Science Learning in a Scratch-

Based Outreach Program• 11:30 in Governors 16

Page 5: Hairball: Lint-inspired Static Analysis of Scratch Projects

Hairball

• A Scratch program static analysis tool– Flag items that are potentially incorrect– can be extended through Python plugins

• Goals– Provide automated assistance for manual analysis– Warn students about potential mistakes

Page 6: Hairball: Lint-inspired Static Analysis of Scratch Projects

Methodology

• Manual Analysis (intended ground truth)– For each concept, 3 staff members each manually counted

and classified instances of the CS concept– Reconciled any discrepancies

• Hairball Analysis– Programmed hairball plugins to attempt detect and classify

the same instances• Actual Ground Truth– Set of similarly classified instances between manual and

hairball, plus the result of a second manual analysis for any discrepancies

Page 7: Hairball: Lint-inspired Static Analysis of Scratch Projects

Instance Classification

• Correct– Properly demonstrates the Scratch concept

• Semantically incorrect– May appear to work correctly upon execution, but

implemented in a non-robust way• Incorrect– Implemented in way that doesn’t work

• Incomplete– Missing necessary components

Page 8: Hairball: Lint-inspired Static Analysis of Scratch Projects

Terminology

• False negatives– Instances that are not labeled correct when they

in fact are

• False Positives– Instances that are labeled correct that are not

actually correct

Page 9: Hairball: Lint-inspired Static Analysis of Scratch Projects

Hairball Plugins

Page 10: Hairball: Lint-inspired Static Analysis of Scratch Projects

Initialization

• Checks that the project initializes attributes that are modified

INCORRECT

CORRECT

Initialization Zone

Page 11: Hairball: Lint-inspired Static Analysis of Scratch Projects

Initialization Evaluation32 false

positives33 false

negatives

Page 12: Hairball: Lint-inspired Static Analysis of Scratch Projects

Say and Sound Synchronization

• Checks that say bubbles are synchronized with sound files

S. INCORRECT CORRECT

Page 13: Hairball: Lint-inspired Static Analysis of Scratch Projects

Say and Sound Synchronization Evaluation

4 false positives

4 missing instances

2 missing instances

Page 14: Hairball: Lint-inspired Static Analysis of Scratch Projects

Broadcast and Receive

• Checks that each event has matching broadcast and receive blocks and only one broadcast through any one path of a script

Page 15: Hairball: Lint-inspired Static Analysis of Scratch Projects

Broadcast and Receive Evaluation

3 false positives

79 false positives

100% detection

12 missing instances

Page 16: Hairball: Lint-inspired Static Analysis of Scratch Projects

Complex Animation

• Checks that a sequence of position and/or orientation changes occur along with costume changes and a delay

Page 17: Hairball: Lint-inspired Static Analysis of Scratch Projects

Complex Animation

3 missing instances

2 false negatives

11 extra instances

Page 18: Hairball: Lint-inspired Static Analysis of Scratch Projects

Hairball Summary

Page 19: Hairball: Lint-inspired Static Analysis of Scratch Projects

Hairball Summary

Page 20: Hairball: Lint-inspired Static Analysis of Scratch Projects

Hairball Summary

Page 21: Hairball: Lint-inspired Static Analysis of Scratch Projects

Live Demo

• http://hairball.herokuapp.com/

Page 22: Hairball: Lint-inspired Static Analysis of Scratch Projects

Conclusions

• Manual assessment is both time-consuming and quite error-prone

• Hairball is useful to augment manual analysis (finds things that humans miss)

• Hairball is incredibly accurate at detecting correct items

Page 23: Hairball: Lint-inspired Static Analysis of Scratch Projects

Future Work

• Add additional plugins for other sorts of analysis

• Test Hairball on a larger set of assignments– (Anyone have Scratch projects they need

assessed?)• Measure effectiveness of Hairball as a lint tool

Page 24: Hairball: Lint-inspired Static Analysis of Scratch Projects

Questions

• Contact Information– [email protected]– https://twitter.com/bboe

• Links– http://hairball.herokuapp.com/– https://github.com/ucsb-cs-education/hairball

• Tomorrow’s talk (11:30 in Governors 16)– “Assessment of Computer Science Learning in a

Scratch-Based Outreach Program”

Page 25: Hairball: Lint-inspired Static Analysis of Scratch Projects

Bonus Slides

Page 26: Hairball: Lint-inspired Static Analysis of Scratch Projects

Initialization Check Weakness

• Visibility initialization properly detected

• Position and orientation initialization does not occur in the initialization zone

Page 27: Hairball: Lint-inspired Static Analysis of Scratch Projects

Say Sound Sync Weakness

• Blocks between say and sound block

• Resulting code may still produce desired effect