0

I want to automatically change some methods in the program. These methods contain some compiler error and my program aims to fix these compiler errors. After fixing compiler errors I need to run test cases related to the changed method (or class) to know it is correct and if not which test cases failed. As the programs under investigation are very big, I only need to run test cases related to changes. As an example, if I change one method, then I need to only run test cases related to this method.

Therefore, what I need is to programmatically be able to find test cases related to each method, and class. It is also useful if there is a tool that can do that for me. As an example, a tool which creates a matrix shows each test case is related to which method(s)

One easy way to do that is to run all test cases and save functions they accessed. However, the problem is at the beginning the input program contains compiler error and it is not possible to run test cases because of these compiler error.

Please let me know what is the best way to do that. An API or a tool that I can be used programmatically is the best for me.

user3623718
  • 83
  • 1
  • 11
  • possible duplicate of [Only run unit tests which's respective source code has changed?](http://stackoverflow.com/questions/13393838/only-run-unit-tests-whichs-respective-source-code-has-changed) – Joe Jun 08 '14 at 13:10
  • If your unit tests take that long to fun they are probably bad unit tests. You should consider simplifying your unit tests, and perhaps the design of your code, so the unit tests are quick to run. – Raedwald Jun 08 '14 at 17:07
  • I finally solved the problem using a Java Dependency Resolver [https://code.google.com/p/java-dependency-resolver/]. As first step I found all dependencies and then as soon as a class is changed I knew which test cases are related and need to be run.More information also can be found in [http://stackoverflow.com/questions/3734825/find-out-which-classes-of-a-given-api-are-used]. – user3623718 Jun 16 '14 at 13:23

0 Answers0