If I have a Java Parser and information about the systems use cases, is it possible to generate testdata and cases for a new developed software component. For example If I recognize 4 if-statements and the name, parameters and return value of method can I make a test case generator and achieve good test coverage with it?
Re: Generatin testdata/testcases
It's hard to tell. If you are a very good programmer, perhaps you could build such a test case generator for whatever test execution framework you intend to use.
As for achieving good test coverage, that's even harder to tell.
Now, you should ask yourself what this will actually test - the code as written, or the feature as required?
Seems like your generated test cases cannot be any better than your model used as the basis for generation.
It's not clear here if your model is the actual code, some sort of pseudo-code, or some intermediate form.