Upload
rui-pereira
View
49
Download
5
Embed Size (px)
DESCRIPTION
Paper talk: Refactoring meets Model-Driven Spreadsheet Evolution Guimarães, Portugal
Citation preview
Rui Pereira, Jácome Cunha, João Paulo Fernandes,Pedro Martins and João Saraiva
Refactoring meets Model-Driven Spreadsheet Evolution
QUATIC 2014Guimarães, Portugal
Spreadsheets
1
› Programming language and environment of choice for many people/companies
› 50% of all spreadsheets are the basis of decisions› 85% of companies use them for financial reporting› 11 million end-users in the USA
Spreadsheets
2
› Very error prone › Research papers on spreadsheet problems› Websites on spreadsheet problems› Google: “spreadsheet errors”
Spreadsheet Errors
3
› Only recently has this been researched (~10 years!!)› Various techniques were developed› One of them is ClassSheets
ClassSheets
4
Spreadsheets Models
ClassSheets
Instance
Instance
Instance Instance
Instance
ClassSheets: Example
5
conforms to
ClassSheets
6
› Everything is according to the model› Control of every spreadsheet› You only have to do it right once› What if you don’t do it right once?
ClassSheets Quality
7
› ClassSheets still suffer from traditional problems› Readability› Maintainability› Extensibility
› A ClassSheet may be hard to understand› May have complicated design› New rules can force changes to spreadsheet structure › Refactorings!
MDSheet
8
ClassSheet
Spreadsheet
ClassSheet’
Spreadsheet’
MDSheet
9
data ModelOperation : Model Model =-- add a new column
addColumnM Where Index-- delete a column
| delColumnM Index-- add a new row
| addRowM Where Index-- delete a row
| delRowM Index-- set a label
| setLabelM (Index, Index) Label-- set a formula
| setFormulaM (Index, Index) Formula-- replicate a class
| replicateM ClassName Direction Int Int-- add a static class
| addClassM ClassName (Index, Index)-- add an expandable class
| addClassExpM ClassName Direction (Index, Index) (Index, Index)
MDSheet
10
data ModelRefactoring: Spreadsheet [ModelOperation] =-- add a formula and shift cells
AddShiftForm ClassName Value Index Label Index-- add an attribute and shift cells
| AddShiftAtt ClassName Value Index Label Index-- delete a cell and shift cells
| DeleteShift ClassName Value Label-- add a reference and shift cells
| AddShiftRef ClassName ClassName Index-- delete a reference and shift cells
| DeleteShiftRef ClassName ClassName-- create a new class
| CreateClass ClassName Direction Index-- delete a class and shift cells
| DeleteClassShift ClassName
Refactorings
11
1. Move Formula
2. Move Attribute
3. Extract Class
4. Inline Class
5. Remove Middle-Man
Refactorings: Example
12
Refactorings: Move Formula
13
› When/Why› Feature Envy› Semantically makes more sense elsewhere
…
› Refactoring
…
Refactorings: Move Attribute
14
› When/Why› Visually enhance readability› Information evolution› Incorrect normalization in a relational class
…
…› Refactoring
Refactorings: Extract Class
15
› When/Why› Complicated and hard to understand models› Neglected subset of information
› Refactoring
Refactorings: Inline Class
16
› When/Why› Insufficient justification of the existence of a class› Not pulling its own weight› Often consulted information
› Refactoring
Refactorings: Remove Middle-Man
17
› When/Why› Delegator class with little responsibility or purpose› Useless class which only complicated structure
› Refactoring
Refactorings: Final Model
18
refactorings
Refactorings: Final Instance
19
yrefactorings
Quality of Refactored Models: Quick Analysis
20
Model› Removed one class
› Organized data to be semantically correct
› Readability
› Joining attributes closer to their formulas
› Placed often used attributes in easier to access areas
Instance› 14 less data cells (15% reduction)
› One more Client 22 less cells (17% reduction)
› Two more Clients 30 less cells (18% reduction)
› Larger our instances, more impactful are the refactorings
› Spreadsheet bad smell detector also showed a reduction in smells
Conclusions and Future Work
21
› Presented a set of refactorings for ClassSheets› Implemented in a tool› First analysis shows model quality improvement› Further validation
› Quality assessment metrics› Empirical studies with professionals who use models daily
› More info?› http://ssaapp.di.uminho.pt› Read the paper› Ask me!
Rui Pereira, Jácome Cunha, João Paulo Fernandes,Pedro Martins and João Saraiva
Refactoring meets Model-Driven Spreadsheet Evolution
QUATIC 2014Guimarães, Portugal