23

Are there any tools for performing code coverage analysis on QML code? Is such a question even applicable to a declarative language like QML?

Paul Carlisle
  • 415
  • 1
  • 5
  • 11
  • 2
    Its really interesting question. First what came to my head is "Tools -> QML/JS -> Run Checks" in QtCreator. – NG_ Feb 15 '15 at 12:29
  • It's really interesting, indeed. The coverage should involve any js function as well as bindings, property assignments, and so on. I guess it's not so easy to do on QML, for some features are directly accessible by instrumenting the QML files, while some others require to instrument the C++ code (as an example - unless you don't care about if and when a dynamic binding happens, but you are interested on the code executed by that function). The same happens if you have classes written in C++ and exported to the QML environment, of course. – skypjack Jul 21 '15 at 16:52
  • [This](https://github.com/mutaphysis/qml-tools) or perhaps in future [this](http://blog.froglogic.com/2014/10/measuring-qml-coverage/)? – Steve Chambers Oct 09 '15 at 22:07
  • The first one doesn't cover the C++ code, anyway. Am I wrong? – skypjack Oct 14 '15 at 17:49
  • Hm. Since QML is declarative with som js on top, and since declarative probably won't need any coverage test, maybe a tool that separates out js and does coverage on that would do? – Mr. Developerdude Nov 21 '15 at 01:50

2 Answers2

4

There was a talk recently on QtCon about C++ and QML code coverage. https://conf.qtcon.org/en/qtcon/public/events/407 (Open the page and click on video link to watch)

The talk was by Harri Porten who is co-founder and co-CEO of froglogic GmbH, a company which sells automated GUI testing tools. They also have a blog post about QML code coverage http://blog.froglogic.com/2014/10/measuring-qml-coverage/

psyched
  • 1,859
  • 1
  • 21
  • 28
0

Classic coverage treatment of JavaScript and C++ does not have to be the end of QML coverage analysis.

For example, coverage of States is thinkable as well. Are all of them entered during test execution? That's what users of Coco filed as feature requests at least.

Harri
  • 364
  • 1
  • 5