Top Banner
Testing import and export filters Markus Mohrhard 2014-02-01 FOSDEM 2014
14

Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Apr 28, 2019

Download

Documents

vanhuong
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: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Testing import and export filters

Markus Mohrhard

2014­02­01

FOSDEM 2014

Page 2: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Exitisting test concepts

Page 3: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

CVE tests (Caolan)

● Make sure we don’t regress

● Put file in directory and import● pass● fail● indeterminate

● If fails it is most likely your virus scanner

Page 4: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

4 / 14 Event Name | Your Name

Import tests

● Simple file stored in our source tree

● loadComponentFromURL or direct call

● old, stable, base of our filter testing framework

Page 5: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

5 / 14 Event Name | Your Name

Export tests

● Newer

● Different concepts● Import   Export   Import→ →● Import   Export   XPath→ →

Page 6: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Code analyzers

Page 7: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

7 / 14 Event Name | Your Name

Tools (not limited to filters code)

● Cppcheck

● Coverity

● Memcheck

Page 8: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Crash testing script

Page 9: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Concept

● Take as many documents as possible

● Import, export and validate● Log crashes● Log validation errors

Page 10: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

First implementation

● Calc only● Part of our unit testing framework

● Similar to CVE tests● A lot of manual work● About 1 week for 5k documents● Import only

Page 11: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

New implementation

● Python script● uses pyuno

● Initial work by Joren as Easy Hack● Now on an TDF server● About 55k documents● About 120k export documents● Validate with ODF validator and 

officeotron

Page 12: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework
Page 13: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

Todo

● Run memcheck on random sample

● Norbert working on partitioning for tinderboxes● Win, Mac, …

● Better reports● git

Page 14: Testing import and export filters - FOSDEM fileTesting import and export filters Markus Mohrhard ... old, stable, base of our filter testing ... Part of our unit testing framework

How to help?

● Write tests!! No bug fix without test

● Take a import/export crash and fix

● Take a validation error and fix

● Volunteer to implement one of my crazy python script ideas