SlideShare a Scribd company logo
1 of 23
Refactoring meets Model-Driven 
Spreadsheet Evolution 
Rui Pereira, Jácome Cunha, João Paulo Fernandes, 
Pedro Martins and João Saraiva 
QUATIC 2014 
Guimarã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 
refactyorings
Quality of Refactored Models: Quick Analysis 
Model 
20 
› 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!
Refactoring meets Model-Driven 
Spreadsheet Evolution 
Rui Pereira, Jácome Cunha, João Paulo Fernandes, 
Pedro Martins and João Saraiva 
QUATIC 2014 
Guimarães, Portugal

More Related Content

Similar to Refactoring Model-Driven Spreadsheet Evolution

Changing Your Habits: Tips to Tune Your T-SQL
Changing Your Habits: Tips to Tune Your T-SQLChanging Your Habits: Tips to Tune Your T-SQL
Changing Your Habits: Tips to Tune Your T-SQLGrant Fritchey
 
PeopleSoft 9.2 HCM Features and Functions Including Fluid Mobile
PeopleSoft 9.2 HCM Features and Functions Including Fluid MobilePeopleSoft 9.2 HCM Features and Functions Including Fluid Mobile
PeopleSoft 9.2 HCM Features and Functions Including Fluid MobileNERUG
 
Understanding Knowledge Services
Understanding Knowledge ServicesUnderstanding Knowledge Services
Understanding Knowledge ServicesAlbert Simard
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012CarlosFloresRoman
 
Bsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.comBsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.comMcdonaldRyan190
 
H2O World - Top 10 Data Science Pitfalls - Mark Landry
H2O World - Top 10 Data Science Pitfalls - Mark LandryH2O World - Top 10 Data Science Pitfalls - Mark Landry
H2O World - Top 10 Data Science Pitfalls - Mark LandrySri Ambati
 
quality_and_statistical_process_control.ppt
quality_and_statistical_process_control.pptquality_and_statistical_process_control.ppt
quality_and_statistical_process_control.pptHassanHani5
 
Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeValerio Maggio
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaDatabricks
 
Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Steve Feldman
 
Bsop 326 Enhance teaching - tutorialrank.com
Bsop 326  Enhance teaching - tutorialrank.comBsop 326  Enhance teaching - tutorialrank.com
Bsop 326 Enhance teaching - tutorialrank.comLeoTolstoy37
 
BSOP 326 Effective Communication/tutorialrank.com
 BSOP 326 Effective Communication/tutorialrank.com BSOP 326 Effective Communication/tutorialrank.com
BSOP 326 Effective Communication/tutorialrank.comjonhson255
 
problem-solving.pptx
problem-solving.pptxproblem-solving.pptx
problem-solving.pptxhadi261715
 
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thi
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thiBMGT 364 Project 4 (Week 7) - Controlling Purpose In thi
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thiJeniceStuckeyoo
 
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...Daniel Valcarce
 
Introduction to Database Systems(CLO.pdf
Introduction to Database Systems(CLO.pdfIntroduction to Database Systems(CLO.pdf
Introduction to Database Systems(CLO.pdfSawairaKazmi
 
Top 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsTop 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsSri Ambati
 
Database and application performance vivek sharma
Database and application performance vivek sharmaDatabase and application performance vivek sharma
Database and application performance vivek sharmaaioughydchapter
 
Top 3 design patterns in Map Reduce
Top 3 design patterns in Map ReduceTop 3 design patterns in Map Reduce
Top 3 design patterns in Map ReduceEdureka!
 

Similar to Refactoring Model-Driven Spreadsheet Evolution (20)

Changing Your Habits: Tips to Tune Your T-SQL
Changing Your Habits: Tips to Tune Your T-SQLChanging Your Habits: Tips to Tune Your T-SQL
Changing Your Habits: Tips to Tune Your T-SQL
 
PeopleSoft 9.2 HCM Features and Functions Including Fluid Mobile
PeopleSoft 9.2 HCM Features and Functions Including Fluid MobilePeopleSoft 9.2 HCM Features and Functions Including Fluid Mobile
PeopleSoft 9.2 HCM Features and Functions Including Fluid Mobile
 
Understanding Knowledge Services
Understanding Knowledge ServicesUnderstanding Knowledge Services
Understanding Knowledge Services
 
Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012Consultas en MS SQL Server 2012
Consultas en MS SQL Server 2012
 
Bsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.comBsop 330Education Redefined / snaptutorial.com
Bsop 330Education Redefined / snaptutorial.com
 
H2O World - Top 10 Data Science Pitfalls - Mark Landry
H2O World - Top 10 Data Science Pitfalls - Mark LandryH2O World - Top 10 Data Science Pitfalls - Mark Landry
H2O World - Top 10 Data Science Pitfalls - Mark Landry
 
quality_and_statistical_process_control.ppt
quality_and_statistical_process_control.pptquality_and_statistical_process_control.ppt
quality_and_statistical_process_control.ppt
 
Refactoring: Improve the design of existing code
Refactoring: Improve the design of existing codeRefactoring: Improve the design of existing code
Refactoring: Improve the design of existing code
 
Final
FinalFinal
Final
 
FlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at HumanaFlorenceAI: Reinventing Data Science at Humana
FlorenceAI: Reinventing Data Science at Humana
 
Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07Sfeldman performance bb_worldemea07
Sfeldman performance bb_worldemea07
 
Bsop 326 Enhance teaching - tutorialrank.com
Bsop 326  Enhance teaching - tutorialrank.comBsop 326  Enhance teaching - tutorialrank.com
Bsop 326 Enhance teaching - tutorialrank.com
 
BSOP 326 Effective Communication/tutorialrank.com
 BSOP 326 Effective Communication/tutorialrank.com BSOP 326 Effective Communication/tutorialrank.com
BSOP 326 Effective Communication/tutorialrank.com
 
problem-solving.pptx
problem-solving.pptxproblem-solving.pptx
problem-solving.pptx
 
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thi
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thiBMGT 364 Project 4 (Week 7) - Controlling Purpose In thi
BMGT 364 Project 4 (Week 7) - Controlling Purpose In thi
 
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...
When Recommenders Met Big Data: an Architectural Proposal and Evaluation [CER...
 
Introduction to Database Systems(CLO.pdf
Introduction to Database Systems(CLO.pdfIntroduction to Database Systems(CLO.pdf
Introduction to Database Systems(CLO.pdf
 
Top 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner PitfallsTop 10 Data Science Practitioner Pitfalls
Top 10 Data Science Practitioner Pitfalls
 
Database and application performance vivek sharma
Database and application performance vivek sharmaDatabase and application performance vivek sharma
Database and application performance vivek sharma
 
Top 3 design patterns in Map Reduce
Top 3 design patterns in Map ReduceTop 3 design patterns in Map Reduce
Top 3 design patterns in Map Reduce
 

Recently uploaded

Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024eCommerce Institute
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 

Recently uploaded (20)

Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
Andrés Ramírez Gossler, Facundo Schinnea - eCommerce Day Chile 2024
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 

Refactoring Model-Driven Spreadsheet Evolution

  • 1. Refactoring meets Model-Driven Spreadsheet Evolution Rui Pereira, Jácome Cunha, João Paulo Fernandes, Pedro Martins and João Saraiva QUATIC 2014 Guimarães, Portugal
  • 2. 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
  • 3. Spreadsheets 2 › Very error prone › Research papers on spreadsheet problems › Websites on spreadsheet problems › Google: “spreadsheet errors”
  • 4. Spreadsheet Errors 3 › Only recently has this been researched (~10 years!!) › Various techniques were developed › One of them is ClassSheets
  • 5. ClassSheets 4 Spreadsheets Models ClassSheets Instance Instance Instance Instance Instance
  • 7. 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?
  • 8. 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!
  • 9. MDSheet 8 ClassSheet Spreadsheet ClassSheet’ Spreadsheet’
  • 10. 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)
  • 11. 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
  • 12. Refactorings 11 1. Move Formula 2. Move Attribute 3. Extract Class 4. Inline Class 5. Remove Middle-Man
  • 14. Refactorings: Move Formula 13 › When/Why › Feature Envy › Semantically makes more sense elsewhere … › Refactoring …
  • 15. Refactorings: Move Attribute 14 › When/Why › Visually enhance readability › Information evolution › Incorrect normalization in a relational class … … › Refactoring
  • 16. Refactorings: Extract Class 15 › When/Why › Complicated and hard to understand models › Neglected subset of information › Refactoring
  • 17. Refactorings: Inline Class 16 › When/Why › Insufficient justification of the existence of a class › Not pulling its own weight › Often consulted information › Refactoring
  • 18. Refactorings: Remove Middle-Man 17 › When/Why › Delegator class with little responsibility or purpose › Useless class which only complicated structure › Refactoring
  • 19. Refactorings: Final Model 18 refactorings
  • 20. Refactorings: Final Instance 19 refactyorings
  • 21. Quality of Refactored Models: Quick Analysis Model 20 › 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
  • 22. 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!
  • 23. Refactoring meets Model-Driven Spreadsheet Evolution Rui Pereira, Jácome Cunha, João Paulo Fernandes, Pedro Martins and João Saraiva QUATIC 2014 Guimarães, Portugal

Editor's Notes

  1. As most of us know, SS are very error prone. A statement also supported by much research. A simple google search of spreadsheet errors will show you many examples, and there is even a site dedicated to spreadsheet error problems. Spreadsheethorrorstories. As you can see, this is a big problem, something that brings about huge implications in industry
  2. Cs are the joining of models and spreadsheets. They are a high level formalism based on object oriented modeling languages, such as UML. After creating our CS model, we can have various instances, all conforming to the layout and structure of our classsheet model
  3. On top of ClassSheets, we have created MDSheet, a model-driven spreadsheet framework that provides a bidirectional CS ecosystem. The techniques and language we developed allow transformations from models to be automatically applied to the instance and vice-versa So any change on the model would update the instance, and any change on the instance would update the model
  4. For the transformations, we defined the following grammar to represent the functions operating on each one. These operations on the models will reflect themselves as updates on the instance.
  5. To express and help with our refactorings, we defined a set of auxiliary functions, ModelRefactoring. These functions return an ordered list of the operations (model evolution steps) from our previous operations. All of our refactoring functions return the joining of the ordered lists from the output of our auxilirary functions and is used by MDSheet to evolve the ClassSheet models and instances to their refactored version.
  6. Either refactorings straightforwardly derived from Fowler’s set or inspired by Fowlers work
  7. One reason would be if it suffers from the feature envy phenomenon, where a formula is more interested in and used by attributes of another class than the class on which they are defined Or something simple such as if it makes more semantical sense elsewhere. For example
  8. Due to evolution, where we once had a class with a clear purpose, it is now doing the work of two Since readability is important in a SS is important, the moment we have a subset of information often times neglected, it is a good idea to place it aside. Lets imagine the the users of our spreadsheet do not tend to use or look up the address, city, and country of a client. As these are a subset of the client class, and make reading the spreadsheet too cluttered, we shall extract it into a new class placed off to the side
  9. Not enough reason to keep a class around, simply not doing much. Or even often consulted information. For example lets say our users look up the client’s contact information quite frequently. Instead of having to hop around a spreadsheet looking at references, it might be a better idea to join this with the main client class.
  10. A middle man is a delegator class with little responsibility or purpose. Often times useless and only complicates Here we see an occurrence with the seller class and decide to remove it. Any attributes which were in the sller class not ids or references are also moved, and we now reference sellInf from the order class
  11. 15% reduction to do elimination of redudant cells This reduction increases proportionally in relation to the data in the instance
  12. Providing better models which are easier to understand and reason about Ensuring automated application of model refactorings While already having shown that the refactorings improve the quality of the models, we want to further validate this