{"id":1657,"date":"2015-06-01T18:26:56","date_gmt":"2015-06-01T16:26:56","guid":{"rendered":"https:\/\/www.opengis.ch\/?p=1657"},"modified":"2020-04-29T16:05:41","modified_gmt":"2020-04-29T14:05:41","slug":"qgis-quality-and-testing","status":"publish","type":"post","link":"https:\/\/www.opengis.ch\/de\/2015\/06\/01\/qgis-quality-and-testing\/","title":{"rendered":"QGIS Quality and Testing"},"content":{"rendered":"<p>I promised that I will write a bit about what I&#8217;ve been up to at the last QGIS developer meeting &#8211; apart from the social part we also got some work done there.<br \/>\nSo let me start with something that really matters to me and I think can make a big impact.<\/p>\n<h2>Unit Testing<\/h2>\n<p>At the start of the developer conference Alessandro Pasotti asked me to do a workshop on unit tests. We quickly squatted a room with a couple of other people where we discussed the general system of unit testing in QGIS and a small unit test has been implemented. The idea definitely got some traction as a couple of hours later a pull request with a similar test was ready for merge. Thank you very much Tobias Reber!<br \/>\nIt should turn out, that unit testing should keep me busy at this place for some more time. It was very interesting to see that <strong>the unit tests which we have really do their job<\/strong>. And their job is to fail (You can see what&#8217;s going on here https:\/\/travis-ci.org\/qgis\/QGIS\/builds). More than once tests failed for pull requests and some code could be brought into good shape before being integrated.<br \/>\nAnother interesting thing to see was, that sometimes a pull request got merged even though it failed. I assume this is due to the fact that some of our unit tests sometimes fail (mainly the ones which require external services) and therefore condition developers not to look too close at the result of the tests. Bottomline for me: prefer to disable unstable tests. It&#8217;s easier to interpret the testing result if the noise is removed.<br \/>\nAnd finally another work I did on the unit testing was related to the Postgres Expression Compiler (more about it in a future post). This is a new implementation which allows some requests to be filtered on the database server instead of the client itself. I didn&#8217;t want to leave it alone from unit tests, so I wrote some tests that check if a bunch of sample requests filter the same set of features on the database as they do locally. This requires a postgres\/postgis server which we didn&#8217;t have to test before. Fortunately we can run that directly on the travis-ci infrastructure (that&#8217;s where QGIS gets tested after every change in the code). But then I thought that if we already have a running postgres\/postgis server, why only test some expressions. And I started to add further tests for basic functionality like querying the extent, getting default values, filtering by spatial extent and some others.<br \/>\nWhile doing that I realized, that it&#8217;s not only postgres\/postgis that should pass these basic tests, but basically any provider. So the code was refactored out into a more generic base class to be able to implement this for various providers and keep adding more tests at one single point. Now the same code tests also SpatiaLite and Shapefiles. That&#8217;s really nice because this way we can check if all providers act the same and discover inconsistencies. For instance, when introducing the Shapefile tests it turned out that when selecting features in a given spatial extent not only the features in there but also features without a geometry have been returned. A rather odd behavior that none of the other two providers showed. It&#8217;s fixed now.<br \/>\nI am looking forward to seeing the suite of unit tests grow even more and helping QGIS to become more stable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I promised that I will write a bit about what I&#8217;ve been up to at the last QGIS developer meeting &#8211; apart from the social part we also got some work done there. So let me start with something that really matters to me and I think can make a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[161],"tags":[125],"class_list":["post-1657","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-qgis-org"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":2021,"url":"https:\/\/www.opengis.ch\/de\/2016\/02\/04\/increasing-the-stability-of-processing-algorithms\/","url_meta":{"origin":1657,"position":0},"title":"Increasing the stability of processing algorithms","author":"Matthias Kuhn","date":"4. Februar 2016","format":false,"excerpt":"Processing just got a new testing framework to improve\u00a0the long-term stability of this important plugin. And you can help to improve it, even if you are not a software developer! This is yet another piece in our never-stopping crusade to improve the stability and quality of the best\u00a0desktop GIS on\u2026","rel":"","context":"In &quot;C++&quot;","block_context":{"text":"C++","link":"https:\/\/www.opengis.ch\/de\/category\/programming\/cpp\/"},"img":{"alt_text":"pr","src":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.opengis.ch\/wp-content\/uploads\/2016\/02\/pr.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2059,"url":"https:\/\/www.opengis.ch\/de\/2016\/03\/23\/prepare-your-plugins-for-qgis-3\/","url_meta":{"origin":1657,"position":1},"title":"Prepare your plugins for QGIS 3","author":"Matthias Kuhn","date":"23. M\u00e4rz 2016","format":false,"excerpt":"QGIS 3 is not yet there and there is still plenty of time to prepare and migrate. But I thought I would give some advice about things that you can keep in mind while working on your plugins to make your life easier when you will have to actually do\u2026","rel":"","context":"In &quot;Uncategorised&quot;","block_context":{"text":"Uncategorised","link":"https:\/\/www.opengis.ch\/de\/category\/uncategorised\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3691,"url":"https:\/\/www.opengis.ch\/de\/2018\/04\/13\/porting-qgis-plugins-to-api-v3-strategy-and-tools\/","url_meta":{"origin":1657,"position":2},"title":"Porting QGIS plugins to API v3 &#8211; Strategy and tools","author":"Marco Bernasocchi","date":"13. April 2018","format":false,"excerpt":"The Release of QGIS 3.0 was a great success and with the first LTR (3.4) scheduled for release this fall, it is now the perfect time to port your plugins to the new API. QGIS 3.0 is the first major release since September 2013 when QGIS 2.0 was released. During\u2026","rel":"","context":"In &quot;Featured&quot;","block_context":{"text":"Featured","link":"https:\/\/www.opengis.ch\/de\/category\/featured\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":297,"url":"https:\/\/www.opengis.ch\/de\/2011\/08\/20\/qgis-android-the-first-test-map\/","url_meta":{"origin":1657,"position":3},"title":"QGIS Android the first test map","author":"Marco Bernasocchi","date":"20. August 2011","format":false,"excerpt":"Today I loaded the first data into qgis and although the mapcanvas stays black, in the map composer the data is shown. Here some screenshots.","rel":"","context":"In &quot;Android QGIS&quot;","block_context":{"text":"Android QGIS","link":"https:\/\/www.opengis.ch\/de\/category\/gis\/qfield\/android-qgis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":415,"url":"https:\/\/www.opengis.ch\/de\/2012\/02\/23\/qgis-on-android-alpha-5\/","url_meta":{"origin":1657,"position":4},"title":"QGIS on android ALPHA 5","author":"Marco Bernasocchi","date":"23. Februar 2012","format":false,"excerpt":"Hi all couple of days ago I pushed a new alpha version of qgis for android on android.qgis.org This release includes all the goodies that I got to implement lately including: - right click support through longClick - shape file support - gps - compass - android 4 support -\u2026","rel":"","context":"In &quot;Android&quot;","block_context":{"text":"Android","link":"https:\/\/www.opengis.ch\/de\/category\/programming\/android\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":275,"url":"https:\/\/www.opengis.ch\/de\/2011\/08\/17\/qgis-on-android\/","url_meta":{"origin":1657,"position":5},"title":"QGIS on Android","author":"Marco Bernasocchi","date":"17. August 2011","format":false,"excerpt":"Hi all, it is a pleasure to announce that I finally got Quantum GIS to start on an android (3.2) tablet (Asus transformer). I tested as well on a Samsung Galaxy phone with cyanogen mod 7 RC1 and it works a well (with the obvious screen size limitations). Qgis still\u2026","rel":"","context":"In &quot;Android QGIS&quot;","block_context":{"text":"Android QGIS","link":"https:\/\/www.opengis.ch\/de\/category\/gis\/qfield\/android-qgis\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_shortlink":"https:\/\/wp.me\/pbdBtI-qJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/posts\/1657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/comments?post=1657"}],"version-history":[{"count":1,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/posts\/1657\/revisions"}],"predecessor-version":[{"id":11156,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/posts\/1657\/revisions\/11156"}],"wp:attachment":[{"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/media?parent=1657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/categories?post=1657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.opengis.ch\/de\/wp-json\/wp\/v2\/tags?post=1657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}