Your SlideShare is downloading. ×
0
Test-Driving QML     Helsinki Artem Marchenko Helsinki Qt Meetup   May 15, 2012
Artem Marchenkohttp://fi.linkedin.com/in/artemmarchenko
Test-Driven Development. Or just               testing QML•   What TDD is about•   Getting started•   Simple Synchronous t...
Test-Driven Development
Example of a QML-code developed via               TDD
Getting started 1(3)git clone git://gitorious.org/qt-labs/qtest-qml.gitCloning into qtest-qml...remote: Counting objects: ...
Getting started 2(3)• Create the simplest test in your project
Getting started 3(2)• And a script that runs the test: runTests.sh in this case#!/bin/bashclear/Users/artem/QtSDK/Desktop/...
Simple synchronous tests
UI level: simulating mouse click
UI level: simulating touch and drag
Asynchronous testing: tryCompare
Asynchronous testing: SignalSpy
Data-driven tests
Current Limitations• Installation doesn’t install qtest-qml to QtCreator   – Not that you would need it for TDD, but if yo...
Current limitations• Very strange errors when object/property can be  accessed e.g. because of a typo• Segmentation faults...
Current limitations• SignalSpy can only count   – It cannot examine the signal arguments or the state of     other objects...
My company TwineLAB Oy• Startup with proven financing• We need more people excited about high quality  software and bringi...
Q&As time You can find these [and nearly identical older          version of the same] slides athttp://agilesoftwaredevelo...
Upcoming SlideShare
Loading in...5
×

Test driving-qml

26,395

Published on

How to test-drive your Qt QML code. Overview on how you do simple testing, UI level testing, synchronous testing, data-driven testing.

These are the slides used in the Helsinki MeeGo meetup in 2012.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
26,395
On Slideshare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Adding numbers continuously – property bindingChange color when result is over 1000 => .toString() when comparing complex built-in objectsMove to states. Change the default color
  • Increase font on mouseClick – when:windowShown
  • Transcript of "Test driving-qml"

    1. 1. Test-Driving QML Helsinki Artem Marchenko Helsinki Qt Meetup May 15, 2012
    2. 2. Artem Marchenkohttp://fi.linkedin.com/in/artemmarchenko
    3. 3. Test-Driven Development. Or just testing QML• What TDD is about• Getting started• Simple Synchronous test• Simulating mouse and keyboard actions• Asynchronous tests (verifying callbacks)• Data-driven tests• Current limitations• Q&As
    4. 4. Test-Driven Development
    5. 5. Example of a QML-code developed via TDD
    6. 6. Getting started 1(3)git clone git://gitorious.org/qt-labs/qtest-qml.gitCloning into qtest-qml...remote: Counting objects: 888, done.remote: Compressing objects: 100% (669/669), done.remote: Total 888 (delta 445), reused 393 (delta 187)Receiving objects: 100% (888/888), 411.11 KiB, done.Resolving deltas: 100% (445/445), done.cd qtest-qml/qmake qtest-qml.promakemake installmake docsmake checkProject page: http://qt.gitorious.net/qt-labs/qtest-qml
    7. 7. Getting started 2(3)• Create the simplest test in your project
    8. 8. Getting started 3(2)• And a script that runs the test: runTests.sh in this case#!/bin/bashclear/Users/artem/QtSDK/Desktop/Qt/471/gcc/bin/QMLViewer.app/Contents/MacOS/QMLViewer tst_tddCalculator2.qml
    9. 9. Simple synchronous tests
    10. 10. UI level: simulating mouse click
    11. 11. UI level: simulating touch and drag
    12. 12. Asynchronous testing: tryCompare
    13. 13. Asynchronous testing: SignalSpy
    14. 14. Data-driven tests
    15. 15. Current Limitations• Installation doesn’t install qtest-qml to QtCreator – Not that you would need it for TDD, but if you are into “just testing” already written code, debugger may be helpful• Bug: only one TestCase is allowed: http://bugreports.qt.nokia.com/browse/QTBUG-17200 (possibly fixed for 4.8) – It makes init() and cleanup nearly useless – Organize your test structure by your own tools• Small difficulties comparing built-in classes (e.g. color) – toString() helps most of the time
    16. 16. Current limitations• Very strange errors when object/property can be accessed e.g. because of a typo• Segmentation faults, sometimes even “file not found”• In 95% of cases that is a typo or an attempt to access a non-public property
    17. 17. Current limitations• SignalSpy can only count – It cannot examine the signal arguments or the state of other objects. Is supposed to be fixed for Qt 5.0• Benchmarking is a part of a qtest-qml, but doesn’t work properly – That is I failed to make it run for a given amount of times (most of the time it does just a single run)• No built-in device test runners – Though you can certainly, embed a “run tests” button right into your application
    18. 18. My company TwineLAB Oy• Startup with proven financing• We need more people excited about high quality software and bringing end-to-end products to people• Buzzwords: – Qt/QML – Linux platform – high quality SW – video/audio codecs – server-side Java / GWT – large-scale metrics artem.marchenko@twinelab.com
    19. 19. Q&As time You can find these [and nearly identical older version of the same] slides athttp://agilesoftwaredevelopment.com/tags/tdd Further contacts: http://fi.linkedin.com/in/artemmarchenko artem.marchenko@twinelab.com
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×