0

I am working towards creating a Auto Test Case Selection tool, but before that I need to extract the dependencies of the class/method in a list of projects. I have heard of JDEP, but it seems that only works after Java 8. I want some tool, that can work with versions of Java 6 and above. Plus, a little advice would do goo regarding if a method based dependency search or a class based dependency search would be better.

Thanks in advance!

//Roy

Sumit Roy
  • 49
  • 6
  • What do you mean `that can work with versions of Java 6 and above`? Is there a problem running `jdeps` on code compiled with java 6? – ernest_k Jul 13 '18 at 11:08
  • You might want to have a look at the source code of the [Apache Maven Dependency Plugin](https://maven.apache.org/plugins/maven-dependency-plugin/index.html), which could be excactly what you are looking for. – Glains Jul 13 '18 at 11:09
  • @ernest_k JDEP is available only after java 8. So, the tool(rather a java program) I will be creating will also be a part of the project. It will called whenever it is required. A few projects are java 6 as well. So I am not sure if I go with jdep, it will be compatible with the older version java projects. – Sumit Roy Jul 13 '18 at 11:24
  • @Glains I had a look at the initial overview of the product. It seemed to me that they figure out the dependencies of jars. Does it also work on class/method level dependencies across projects? – Sumit Roy Jul 13 '18 at 11:25
  • @SumitRoy It only analyses the dependencies of the project, not a class or methods. Maybe you can parse the imports of a class with JavaParser and go on from there? I am not aware of any library that can fetch the dependencies of a method tough... – Glains Jul 13 '18 at 11:30
  • @Glains I need a tool which can fetch at least dependencies of classes. I have found jdeps to be the most adapt tool, but that gives me the problems of version compatibility. I want to be sure before I start using it and start with the development. – Sumit Roy Jul 13 '18 at 11:33
  • What kind of analyzing would you like to do? The dependencies of classes are given by the import statements in code ? JDEPS is based on modules...and the maven-dependency-plugin is already mentioned ? – khmarbaise Jul 13 '18 at 13:39
  • @khmarbaise My target is to create a script which will select the test cases based on what code is changed on a particular project. So, for that I need to analyze the changed file, and what other files in that or other projects does that particular file affect. For that I need the dependency list. So, as far as I have seen, there is no method level dependency finder, so I am going with the class dependency. – Sumit Roy Jul 16 '18 at 08:15

0 Answers0