Closed Andres981231 closed 5 months ago
Hi @Andres981231 ,
Thank you for your interest in Pynguin. It largely depends on the configuration what Pynguin is able to generate. Builtin types are the default, if nothing else is known. Besides, there is a general issue: while a test generator (this is not limited to Pynguin, but also holds for other tools, e.g., EvoSuite) might know about available types from analysing dependencies, it might not be able to construct a sequence of statements that would set up an object of such a type.
The default for Pynguin is that it takes type annotations into account if available (highly recommended, though, because our research [1, 2] has shown that they are beneficial for the test-generation process). It also analyses all imported modules from the subject to have those types available. However, if you could provide me a minimal working example, I could probably tell you the exact reasons for what happens (or does not happen).
Thanks for the replying. After providing type annotations and applying type tracing method, I found that input with most types can be generated correctly.
Is that pynguin can only generate variables with builtin types for testcases? Can other types from imported modules or user defined types be generated? If providing type annotations?