Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Unit Test Coverage] How can the industry improve QT code coverage

[Unit Test Coverage] How can the industry improve QT code coverage

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 106 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xurongqin
    wrote on 8 Apr 2025, 10:35 last edited by
    #1

    Hello everyone, I am a C++ QT application engineer in the industry.

    After nearly 10 years of iteration, our products are facing the problem of lower and lower code unit test coverage. Low code unit test coverage is very detrimental to code quality and product quality.

    So we have been looking for ways to improve QT code unit test coverage or some guiding principles.

    I would like to ask the experts in the industry whether you can provide some experience to guide us to improve QT code unit test coverage?

    Thank u if u can share us some ideas!
    alt text

    J 1 Reply Last reply 8 Apr 2025, 10:53
    0
    • X xurongqin
      8 Apr 2025, 10:35

      Hello everyone, I am a C++ QT application engineer in the industry.

      After nearly 10 years of iteration, our products are facing the problem of lower and lower code unit test coverage. Low code unit test coverage is very detrimental to code quality and product quality.

      So we have been looking for ways to improve QT code unit test coverage or some guiding principles.

      I would like to ask the experts in the industry whether you can provide some experience to guide us to improve QT code unit test coverage?

      Thank u if u can share us some ideas!
      alt text

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 8 Apr 2025, 10:53 last edited by
      #2

      @xurongqin Not clear to me: do you want to test Qt code or the code of your application?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xurongqin
        wrote 22 days ago last edited by
        #3

        @jsulm , Thanks for your kind reply, I want to test the code of my application. My purpose is want to know how QT developers improve the unit test coverage on their application. Are there any rules or unit test frameworks that can help to guide us to improve the unit test coverage?

        Thank you so much

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote 21 days ago last edited by
          #4

          Hi and welcome to devnet,

          For testing frameworks, Qt already provides the QTest module which works pretty nicely.

          As for the rules, there's mainly one: test both happy and unhappy code paths. That way you ensure that your code is working when everything goes well as well as when issue arise.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved