Recommendation - Static code analysis

Do you have any recommendation for a static code analysis tool or plugin to use with Katalon Studio ?

I would suggest that Katalon is the wrong tool for the job. If you want static code analysis or code coverage then you might want to look at unit test frameworks instead… Katalon is more like a tool for black-box testing. Happy to be corrected though :grin:

What do you want to analyse with it?

Do you want to make report of unit-test coverage over Server-side Web app in PHP? or a Single Page WebApp in JavaScript? or a Mobile App in Objective C for iPhone? Mobile App in Kotlin for Android? — in these cases, as @Dan_Bown mentioned, you should look at test-coverage tools for each languages and IDE (Eclipse, IDEA, VSCode, Xcode etc). Katalon Studio will not help in this area.

Or do you want to analyse Groovy scripts called “Test Cases” in Katalon Studio? — Well, I wonder why you feel like to do it. May be you should describe your problem first.

Or do you want to make report of unit-test coverage over Groovy classes called “Keywords” in Katalon Studio?

If yes, in case 1 where your custom classes are dependent on the com.kms.katalon.** libraries, then you will certainly find difficulties to perform detailed unit testing, and difficult to report test coverage.

To me, it seems Katalon Studio does not offer any feature to unit-test your custom classes named Keywords. Katalon Studio assumes that your Keywords are short and simple, and that you are able to write 100% quality code without unit-testing. I think this assumption is too naive. So I developed a custom library junit4ks in order to introduce JUnit to perform unit-testing over my keywords. If you are desperate, you would need to introduce some tools like JaCoCo for yourself but I am negative if you can make it.

Case 2: If you can design your classes independent of the com.kms.katalon.** library, I would recommend you to create a separate project for those classes outside Katalon Studio project. You want to create the new project in Eclipse or IDEA, do development with thorough unit testing, build a jar, and import the product jar into your Katalon Studio project as an External library. I have ever done this several times, like this

This is not very true.

Katalon Studio has integrated Cucumber

Perhaps, though I have never tried, you can use Cucumber to test your custom keywords at any fine grained level within Katalon Studio. @mathieu You may somehow find some way to extend this to report test coverage over your custom keywords. I am not sure.

I think that will be the solution. Thanks for your answer !

Right know I do not use custom keywords, I was thinking of a static code analysis for test cases scripts. I’ll go or an external tool. Thanks for your answer!

Which External tool can “statically analyse Katalon’s test case scripts”? Please tell us if you have any idea.

To be honest, I did not go further on this subject but I’ll share more usefull information asap