Top Banner
Software Engineering for Spreadsheets: Challenges and Opportunities Martin Erwig Oregon State University Supported by NSF (ITR-0325273, CCF-0741584)
26

Software Engineering for Spreadsheets: Challenges and ...

Nov 12, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Software Engineering for Spreadsheets: Challenges and ...

Software Engineering for Spreadsheets: Challenges and Opportunities

Martin ErwigOregon State University

Supported by NSF (ITR-0325273, CCF-0741584)

Page 2: Software Engineering for Spreadsheets: Challenges and ...

Motivation

2

Spreadsheets are widely used

Spreadsheet are prone to errors

Spreadsheet errors have huge impact

Efforts to make spreadsheets more

dependable

Needed:

Page 3: Software Engineering for Spreadsheets: Challenges and ...

Spectrum of Viewpoints

3

ProgrammingLanguagesHCIPsychologyConsulting,

DevelopmentApplication

λ→⊦∀

Page 4: Software Engineering for Spreadsheets: Challenges and ...

Let’s Use Tools!

Processes is important ...

4

Tools are indispensable in all areas of our daily lives

... but humans are fallible

...

Page 5: Software Engineering for Spreadsheets: Challenges and ...

5

Contents

The Challenge

The Essence of Spreadsheet Computing

Opportunities for Tools

Example 1: Type Checking

Example 2: Debugging

Page 6: Software Engineering for Spreadsheets: Challenges and ...

Challenge

6

Editing Spreadsheets ≈ Software Engineering

Spreadsheet Users: End Users

Objective: get the job done

How to get end users to employ SE techniques?

Page 7: Software Engineering for Spreadsheets: Challenges and ...

Everybody is an End User

7

ProgrammingLanguagesHCIPsychologyConsulting,

DevelopmentApplication

λ→⊦∀

End Users

Page 8: Software Engineering for Spreadsheets: Challenges and ...

8

Contents

The Challenge

The Essence of Spreadsheet Computing

Opportunities for Tools

Example 1: Type Checking

Example 2: Debugging

Page 9: Software Engineering for Spreadsheets: Challenges and ...

The Essence of Spreadsheet Computing

9

e ::= v | o(e, …, e) | as = a → e

Cell AddressFormula

Value

Spreadsheet

Operation

Page 10: Software Engineering for Spreadsheets: Challenges and ...

The Essence of Spreadsheet Computing

10

e ::= v | o(e, …, e) | as = a → e

e ::= λx.e | e e | x

ReferenceApplicationValue

Variable Introduction

No Local ScopeNo Higher-Order Operations ⇒ No Recursion

Page 11: Software Engineering for Spreadsheets: Challenges and ...

11

Contents

The Challenge

The Essence of Spreadsheet Computing

Opportunities for Tools

Example 1: Type Checking

Example 2: Debugging

Page 12: Software Engineering for Spreadsheets: Challenges and ...

Opportunities

12

Spatial Embedding of Formulas

Limited Computation Model

No loops/recursion

Simplified Reasoning for Tools

Availability of Rich Contextual Information

[IEEE Software, Sept. 2009]

Page 13: Software Engineering for Spreadsheets: Challenges and ...

A Sweet Spot

13

Spreadsheets

Java, C, ...

Context InfoSparse Rich

Computation Model

Complex

Simple DSLs:SQL, ...

Page 14: Software Engineering for Spreadsheets: Challenges and ...

14

Contents

The Challenge

The Essence of Spreadsheet Computing

Opportunities for Tools

Example 1: Type Checking

Example 2: Debugging

Page 15: Software Engineering for Spreadsheets: Challenges and ...

End-User Type System?

15

ProblemAbstract concept of types is very difficult to convey to end users

End user

IdeaUse vocabulary from the spreadsheet as type information[PADL’02, HCC’02]

Type System

Page 16: Software Engineering for Spreadsheets: Challenges and ...

Type Checking

16

May AppleJune Orange

May Fruit

Page 17: Software Engineering for Spreadsheets: Challenges and ...

Labeling Rules

17

e : L and e : K ⇒ e : L & K

e : L and e’ : K ⇒ e+e’ : L | K

e : L and L : K ⇒ e : K⊳L

Fruit⊳Apple

Month⊳May & Fruit⊳Apple

May Apple | May OrangeMay (Apple | Orange) FactoringMay Fruit Generalization

Page 18: Software Engineering for Spreadsheets: Challenges and ...

A Summation Error

18

B5 = SUM(B2:B4)

B2 : FruitB3 : Fruit⊳AppleB4 : Fruit⊳Apple

B2’s label cannot be factored ⇒ prevents generalization step

Page 19: Software Engineering for Spreadsheets: Challenges and ...

Reflections

19

• We can infer label relationships automatically[VL/HCC’04, JVLC’07]

• Users do use labels to reason about formulas in spreadsheets to debug effectively [VL/HCC’07]

• Combining syntactic label checking with semantic dimension analysis finds even more faults [VL/HCC’08a, JVLC’09, VL/HCC’09]

• Is it actually practical?

Page 20: Software Engineering for Spreadsheets: Challenges and ...

Part of Real-World Tool

20

Page 21: Software Engineering for Spreadsheets: Challenges and ...

21

Contents

The Challenge

The Essence of Spreadsheet Computing

Opportunities for Tools

Example 1: Type Checking

Example 2: Debugging

Page 22: Software Engineering for Spreadsheets: Challenges and ...

22

A B

1 6 A1+2

2 5

Goal-Directed Debugging

Computed 8

Change Suggestions

A1+2 ↝ A1+1A1+2 ↝ A2+2A1+2 ↝ 7

Expected 7

Key Ideas

• Reason directly from failure to fault

• Propagate change expectations to derive change suggestions

• Rank suggestions employing heuristics

[VL/HCC’05]

Page 23: Software Engineering for Spreadsheets: Challenges and ...

Example

23

Value in

Value Expectation

CancelOK

should beD4 equal to 26

Page 24: Software Engineering for Spreadsheets: Challenges and ...

Example

24

D4 = B3 + C4

In formula: =B3+C4change B3 to C4change C4 to C3

Cell D3

More ...Ignore

Page 25: Software Engineering for Spreadsheets: Challenges and ...

Evaluation of GoalDebug

25

• Corrects 97% of faults

• Ranking of correct change suggestion

First 59%

Top 2 71%

Top 5 80%

2. Run GoalDebug

1. Introduce Mutation

F G

3. Find rank of correct change suggestions

...G ↝ ...G ↝ F...

k:[ICSE’07, VL/HCC’08b]

Page 26: Software Engineering for Spreadsheets: Challenges and ...

Conclusions

26

Simplified Computation Model & Spatial Embedding Facilitate

Effective, Easy-to-Use Software Engineering Tools

More Examples:• Generation of Correct Spreadsheet:

Gencel [VL/HCC’05, ICSE’05, ICSE’06, JFP’06]ClassSheets [ASE’05, JOT’07]

• Testing [VL/HCC’06, VL/HCC’08, TSE’09]

• Pattern Inference [PPDP’06, ICSE’06]