[Unit Test Coverage] How can the industry improve QT code coverage
-
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!
-
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!
@xurongqin Not clear to me: do you want to test Qt code or the code of your application?
-
@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
-
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.