SlideShare a Scribd company logo
1 of 19
Test-Driving QML
     Helsinki
 Artem Marchenko
 Helsinki Qt Meetup
   May 15, 2012
Artem Marchenko




http://fi.linkedin.com/in/artemmarchenko
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
Test-Driven Development
Example of a QML-code developed via
               TDD
Getting started 1(3)
git clone git://gitorious.org/qt-labs/qtest-qml.git
Cloning 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.pro
make
make install
make docs
make check

Project page: http://qt.gitorious.net/qt-labs/qtest-qml
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/bash

clear
/Users/artem/QtSDK/Desktop/Qt/471/gcc/bin/QMLViewer.app/Contents/MacOS/QML
Viewer tst_tddCalculator2.qml
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 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
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
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
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
Q&As time

 You can find these [and nearly identical older
          version of the same] slides at
http://agilesoftwaredevelopment.com/tags/tdd


                Further contacts:
  http://fi.linkedin.com/in/artemmarchenko
      artem.marchenko@twinelab.com

More Related Content

What's hot

Presentation_C++UnitTest
Presentation_C++UnitTestPresentation_C++UnitTest
Presentation_C++UnitTest
Raihan Masud
 

What's hot (20)

cf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Woodcf.Objective() 2017 - Design patterns - Brad Wood
cf.Objective() 2017 - Design patterns - Brad Wood
 
Presentation_C++UnitTest
Presentation_C++UnitTestPresentation_C++UnitTest
Presentation_C++UnitTest
 
Automate Thyself
Automate ThyselfAutomate Thyself
Automate Thyself
 
Automated php unit testing in drupal 8
Automated php unit testing in drupal 8Automated php unit testing in drupal 8
Automated php unit testing in drupal 8
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDI
 
Applying TDD to Legacy Code
Applying TDD to Legacy CodeApplying TDD to Legacy Code
Applying TDD to Legacy Code
 
Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8Test all the things! Automated testing with Drupal 8
Test all the things! Automated testing with Drupal 8
 
Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloud
 
JavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 ProxyJavaScript Metaprogramming with ES 2015 Proxy
JavaScript Metaprogramming with ES 2015 Proxy
 
Integration Group - Robot Framework
Integration Group - Robot Framework Integration Group - Robot Framework
Integration Group - Robot Framework
 
Scripting robot
Scripting robotScripting robot
Scripting robot
 
Robot framework and selenium2 library
Robot framework and selenium2 libraryRobot framework and selenium2 library
Robot framework and selenium2 library
 
POUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love youPOUG2019 - Test your PL/SQL - your database will love you
POUG2019 - Test your PL/SQL - your database will love you
 
Automation testing with Drupal 8
Automation testing with Drupal 8Automation testing with Drupal 8
Automation testing with Drupal 8
 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot framework
 
Testing in a microcontroller world
Testing in a microcontroller worldTesting in a microcontroller world
Testing in a microcontroller world
 
Robot Framework Dos And Don'ts
Robot Framework Dos And Don'tsRobot Framework Dos And Don'ts
Robot Framework Dos And Don'ts
 
Containerize your Blackbox tests
Containerize your Blackbox testsContainerize your Blackbox tests
Containerize your Blackbox tests
 

Similar to Test driving-qml

CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and Process
Marcus Hanwell
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
Daker Fernandes
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
elliando dias
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer
 

Similar to Test driving-qml (20)

Test driving-qml
Test driving-qmlTest driving-qml
Test driving-qml
 
CMake: Improving Software Quality and Process
CMake: Improving Software Quality and ProcessCMake: Improving Software Quality and Process
CMake: Improving Software Quality and Process
 
Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 
Ship code like a keptn
Ship code like a keptnShip code like a keptn
Ship code like a keptn
 
Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one way
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
 
Mock cli with Python unittest
Mock cli with Python unittestMock cli with Python unittest
Mock cli with Python unittest
 
Continuous Integration using Cruise Control
Continuous Integration using Cruise ControlContinuous Integration using Cruise Control
Continuous Integration using Cruise Control
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
ContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven InfrastructureContainerCon - Test Driven Infrastructure
ContainerCon - Test Driven Infrastructure
 
A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)A la découverte des google/test (aka gtest)
A la découverte des google/test (aka gtest)
 
Gatling
Gatling Gatling
Gatling
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
Automating the Quality
Automating the QualityAutomating the Quality
Automating the Quality
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmerVærktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmer
 
VMTH Project
VMTH ProjectVMTH Project
VMTH Project
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Test driving-qml

  • 1. Test-Driving QML Helsinki Artem Marchenko Helsinki Qt Meetup May 15, 2012
  • 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
  • 5. Example of a QML-code developed via TDD
  • 6. Getting started 1(3) git clone git://gitorious.org/qt-labs/qtest-qml.git Cloning 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.pro make make install make docs make check Project page: http://qt.gitorious.net/qt-labs/qtest-qml
  • 7. Getting started 2(3) • Create the simplest test in your project
  • 8. Getting started 3(2) • And a script that runs the test: runTests.sh in this case #!/bin/bash clear /Users/artem/QtSDK/Desktop/Qt/471/gcc/bin/QMLViewer.app/Contents/MacOS/QML Viewer tst_tddCalculator2.qml
  • 10. UI level: simulating mouse click
  • 11. UI level: simulating touch and drag
  • 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. 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. 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. 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. Q&As time You can find these [and nearly identical older version of the same] slides at http://agilesoftwaredevelopment.com/tags/tdd Further contacts: http://fi.linkedin.com/in/artemmarchenko artem.marchenko@twinelab.com

Editor's Notes

  1. Adding numbers continuously – property bindingChange color when result is over 1000 => .toString() when comparing complex built-in objectsMove to states. Change the default color
  2. Increase font on mouseClick – when:windowShown