SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Automated Testing of
Excel Workbooks
Felix Zumstein, Oct 3rd, 2019
xlwings Meetup NYC
From unit tests to continuous integration
Agenda
2
1. Meetup organisation
2. xlwings intro
3. Automated testing by Felix Zumstein
4. Teaching machine learning via xlwings
by Daniel Guetta, Senior Lecturer at Columbia
Business School
About us
Innovative Solutions
for Microsoft Excel
A small team with a big mission
4
xlwings
5
• Python for Excel
• Scripts, UDFs,
Macros, REST API
• Windows & Mac
• Free & open-source
• New: Professional support plans
xltrail
6
• Version
control for
Excel
• Tracks
formulas
and VBA
code
• Local Git extension that makes git diff and
git merge work with VBA code (only)
• Free & open-source
Git XL
7
xlwings CI
8
Continuous integration for Excel files
• Write unit tests for Excel files with xlwings
• Run them automatically on the server after
pushing changes to your Git repo
Example: Gitlab Pipeline
xlwings-reports (coming soon)
9
Template Report
create_report(
”template.xlsx”,
performance=df
)
1. Meetup organisation
Meetup organisation
11
• Community event
• About any innovative solution for Excel,
not just those based on xlwings
• Contact me if you want to give a talk
(short or long) in one of the next
meetups
3. xlwings intro
xlwings
13
1) Automation
2)Macros
3)UDFs (Windows only)
4)REST API
4. Automated testing
What is a unit test (Python sample)?
15
Python function that
we want to test
Unit test:
OK or FAIL
Map VBA functions to Python
16
VBA function
my_sum (Python)
MySum (VBA)
args result
VBA unit test boilerplate
17
run at the
beginning and
end of the test
suite, respectively
actual test
What can be tested in Excel?
18
1) Unit test: E.g. a cell formula, a VBA function
2) Integration test: E.g. running a macro or
testing the effect of a cell change on the
whole workbook
3) Cell logic test: Test dynamic tables
4)Alternative implementation test: Comparison
with a function from (a tested) 3rd party lib
1a) VBA unit test
19
1a) Cell formula unit test
20
2) VBA integration test
21
3) Cell logic test
22
4) Alternative implementation test
23
Run the tests
24
To run a single test:
python -m unittest test_mybook.TestMyBook.test_vba_unittest
Unittest runners/frameworks
25
1) unittest: built-in
2) pytest
3) nose/nose2
Continuous integration (1/2)
26
• Write unit tests for Excel files with xlwings
• Run them automatically on the server after
pushing changes to your Git repo
Example: Gitlab Pipeline
Continuous integration (2/2)
27
Thank You
Let’s connect:
https://www.linkedin.com/in/felix-zumstein

Más contenido relacionado

La actualidad más candente

Continuous integration
Continuous integrationContinuous integration
Continuous integration
Lior Tal
 

La actualidad más candente (14)

Online Compilers
Online CompilersOnline Compilers
Online Compilers
 
Refactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMergeRefactoring merged code - ReSharper meets SemanticMerge
Refactoring merged code - ReSharper meets SemanticMerge
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Life after Calc core change
Life after Calc core changeLife after Calc core change
Life after Calc core change
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
A Journey from Hexagonal Architecture to Event Sourcing
A Journey from Hexagonal Architecture to Event SourcingA Journey from Hexagonal Architecture to Event Sourcing
A Journey from Hexagonal Architecture to Event Sourcing
 
Pharo Status ESUG 2014
Pharo Status ESUG 2014Pharo Status ESUG 2014
Pharo Status ESUG 2014
 
How To Build Auto-Adaptive Machine Learning Models with Kubernetes
How To Build Auto-Adaptive Machine Learning Models with KubernetesHow To Build Auto-Adaptive Machine Learning Models with Kubernetes
How To Build Auto-Adaptive Machine Learning Models with Kubernetes
 
Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away Bag it Tag It Put it : Project Tracking One Click away
Bag it Tag It Put it : Project Tracking One Click away
 
Unearthing The Power Of IBM – Rational Functional Tester 7.0 - RFT
Unearthing The Power Of IBM – Rational Functional Tester 7.0 - RFTUnearthing The Power Of IBM – Rational Functional Tester 7.0 - RFT
Unearthing The Power Of IBM – Rational Functional Tester 7.0 - RFT
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Whats new in .NET for 2019
Whats new in .NET for 2019Whats new in .NET for 2019
Whats new in .NET for 2019
 
Racefix
RacefixRacefix
Racefix
 
GraphQL Europe 2018 重點整理
GraphQL Europe 2018 重點整理GraphQL Europe 2018 重點整理
GraphQL Europe 2018 重點整理
 

Similar a Automated testing of Excel Workbooks

ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012
DomusDotNet
 
A Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring ActivityA Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring Activity
Nikolaos Tsantalis
 

Similar a Automated testing of Excel Workbooks (20)

20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...20060712 automated model based testing of community-driven open-source gui ap...
20060712 automated model based testing of community-driven open-source gui ap...
 
Mozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10nMozilla: Mozmill meets L10n
Mozilla: Mozmill meets L10n
 
Unit Testing in VS2012
Unit Testing in VS2012Unit Testing in VS2012
Unit Testing in VS2012
 
ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012ALM@Work - Unit testing in Visual studio 2012
ALM@Work - Unit testing in Visual studio 2012
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
 
Apache Flink London Meetup - Let's Talk ML on Flink
Apache Flink London Meetup - Let's Talk ML on FlinkApache Flink London Meetup - Let's Talk ML on Flink
Apache Flink London Meetup - Let's Talk ML on Flink
 
Module 3: Introduction to LINQ (Material)
Module 3: Introduction to LINQ (Material)Module 3: Introduction to LINQ (Material)
Module 3: Introduction to LINQ (Material)
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Test automation design patterns
Test automation design patternsTest automation design patterns
Test automation design patterns
 
Framework
FrameworkFramework
Framework
 
System verilog important
System verilog importantSystem verilog important
System verilog important
 
Automating the Quality
Automating the QualityAutomating the Quality
Automating the Quality
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
WiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOpsWiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOps
 
XRAY for Jira
XRAY for JiraXRAY for Jira
XRAY for Jira
 
Python. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The ThalesiansPython. Finance. Excel. - The Thalesians
Python. Finance. Excel. - The Thalesians
 
A Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring ActivityA Multidimensional Empirical Study on Refactoring Activity
A Multidimensional Empirical Study on Refactoring Activity
 
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
 
Testing Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user groupTesting Flex RIAs for NJ Flex user group
Testing Flex RIAs for NJ Flex user group
 
Mykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with JmeterMykola Kovsh - Functional API automation with Jmeter
Mykola Kovsh - Functional API automation with Jmeter
 

Más de xlwings

Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
xlwings
 

Más de xlwings (15)

xlwings for Google Sheets
xlwings for Google Sheetsxlwings for Google Sheets
xlwings for Google Sheets
 
Cross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with PythonCross-platform Spreadsheet Automation with Python
Cross-platform Spreadsheet Automation with Python
 
Automate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings ReportsAutomate your PDF factsheets with xlwings Reports
Automate your PDF factsheets with xlwings Reports
 
Git for Excel (Webinar)
Git for Excel (Webinar)Git for Excel (Webinar)
Git for Excel (Webinar)
 
Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)Deployment of xlwings-powered spreadsheets (webinar)
Deployment of xlwings-powered spreadsheets (webinar)
 
xlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Pythonxlwings reports: Reporting with Excel & Python
xlwings reports: Reporting with Excel & Python
 
Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)Python and Excel in Finance (PyData meetup Zurich)
Python and Excel in Finance (PyData meetup Zurich)
 
Git for Excel files webinar
Git for Excel files webinarGit for Excel files webinar
Git for Excel files webinar
 
xlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH eventxlwings Presentation (Excel & Python) Swiss FinteCH event
xlwings Presentation (Excel & Python) Swiss FinteCH event
 
For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016For Python Quants Conference NYC 6th May 2016
For Python Quants Conference NYC 6th May 2016
 
Open Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwingsOpen Source in Quant Finance - xlwings
Open Source in Quant Finance - xlwings
 
Odsc presentation
Odsc presentationOdsc presentation
Odsc presentation
 
xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)xlwings - For Python Quants Conference (London 2014)
xlwings - For Python Quants Conference (London 2014)
 
xlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetupxlwings Zurich Python User Group Meetup
xlwings Zurich Python User Group Meetup
 
xlwings - Connecting Python with Excel
xlwings - Connecting Python with Excelxlwings - Connecting Python with Excel
xlwings - Connecting Python with Excel
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Automated testing of Excel Workbooks