How to find production methods only used by tests in Intellij - intellij-idea

Does anyone know if it's possible to identify production methods that are only referenced by unit test class methods?
I can see if a method has production or test uses by using the Find Usages option but I want to scan my whole codebase.
Thanks.

Unfortunately this feature is not yet implemented, but there is an issue for it, please follow:
https://youtrack.jetbrains.com/issue/IDEA-212420

Related

Best practices writing Espresso tests for a multi modular Android projects (MVI/MVVM)

I am looking into Espresso Framework to adopt the best practices for writing tests for a multi modular Android projects (MVI/MVVM).
Is it a good idea to cover/write all the Espresso tests inside the app module (or) it needs to be isolated specific to each modules?
Is there any other best practices for MVI/MVVM based Android projects? if so, please comment and provide references if any
Language used: Kotlin
I have recently been implementing espresso tests in the multi-modular project where I work. Through some research and help from senior developers, I think I will be able to guide you a bit in the proper direction.
For the first question, Yes, it's essential that all the tests related to a particular activity remain in their corresponding 'test' class. That keeps it modular and easy to debug. So, one should make a test class for a particular activity and that should be in the corresponding module that the 'activity' belongs.
All these test classes can then help you to build a 'TestSuite' which could be used to make a flow for testing the app's specific features. In a test suite, one needs to mention those classes that make that flow.
After all this research and as per knowledge, I guess, this approach is good enough for large projects as well since the app I am working on is really big.
Blocker :
In a multi-modular project, I am still not able to create the test suite since I am not able to import those test classes in the main app module. But this issue will be fixed very soon. I'll definitely update it here when I'll get the method to do so.
Please do comment, if I am doing something wrong. Suggestions are a warm welcome.

Testcafe get skipped tests in embedding-utils.js

I am trying to add some personal static analysis to my testcafe tests according to different features I am testing. I found there is getTypeScriptTestList in the following API, https://github.com/DevExpress/testcafe/blob/fcd93e8dbee76ea70786ee3aee4fb35990260e2a/src/embedding-utils.js#L66 (I am using Typescript), and I can get list of the tests with very basic info without running all the tests, however, there seems no information getting the skipped tests, wondering if I miss anything or if there is another better way?
I also had a look into https://github.com/hdorgeval/testcafe-static-analyser which is cool, but I hope to do something simpler and hopefully from testcafe's API.
Any help is really appreciated!
Unfortunately, this functionality is not supported at present.
Just in case someone searches this issue, it's fixed now, it can get skipped tests in embedding-utils.js

IntelliJ Plugin Development - Parameter / Method Hints

I am looking into writing plugin for the IntelliJ IDE for testing. I would like methods and classes to have something to indicate the number of tests and coverage they have. i.e. I have a method in my class and I can see that it has 3 tests written for it and 50% coverage.
I want this to be done without editing the code at all, almost exactly like how parameter hints work.
My problem is that I am fairly new to this and after reading the documentation I am struggling to see if an interface like this is even possible? Is there a way of doing this? Is there a better way of doing this?
Many Thanks,
James
I'd use codeInsight.lineMarkerProvider extension for this.
Implementing LineMarkerProvider interface allows to show an interactive icon on left gutter. It's the extension used to "Has implementations" icon etc.

What is the purpose of sun.jvm.hotspot.HelloWorld?

I just stumbled upon the class sun.jvm.hotspot.HelloWorld. The source of this class is present since Java 6.
The latest version can be found here.
Does someone know the purpose of this class? Is this some kind of developer playground class while developing the JDK?
Thanks in advance!
This file belongs to HotSpot Serviceability Agent.
Serviceability Agent is a kind of internal tool for JVM developers. It is not a part of any public standard, so it does not necessarily need to be covered by TCKs or the separate test suites, though it still has to be consistent with the actual version of HotSpot. I believe HelloWorld was used by JVM developers as a smoke test to make sure Serviceability Agent works in basic cases. So the term "playground class" as you called it fits perfectly.
Frankly speaking, Serviceability Agent source base is not maintained very clean - you may notice other leftover things there. But there is also some interesting stuff, e.g. HSDB or CLHSDB which is a tool for analysing internal structures inside a foreign JVM process.

Use quickCheck tests with Cabal?

What's the current state of test suites in cabal, and, more importantly, where can I keep atop them?
I've done some poking around, and the latest information that I can find implies that I can't trust the documentation, and I haven't been able to find anyone talking about it for the better part of a year. I've heard rumor of a cabal-test-quickcheck library but can't seem to find one on hackage and can find no examples of how to set it up.
What's the standard way to hook up quickCheck tests into a cabal test suite these days?
Cabal-1.14.0.0 has come out since then and the detailed test suite seems to be available.
The cabal-test-quickcheck package doesn't seem to have been released yet though, maybe you can get similar functionality from test-framework-quickcheck2?
Alternatively, you can ignore the inbuilt test support in Cabal and just use a flag to determine whether or not to build a test executable.