2

Maybe it's obvious considering how maven works, but I'm kinda new to this.
I am currently using evosuite via maven to generate tests, my question is :

Is it possible to generate tests only for new/modified code instead of generating the whole suit ?

Sanea
  • 129
  • 3
  • There is no way for `evosuite` to distinguish new/modified code because it doesn't have previous state. And why you use this test generator at all? It is pointless toy. – talex Feb 26 '18 at 09:19
  • I was hoping that maven could get this information somewhere. And i use this "toy" because it's open source, and after testing some automatic generator of unit tests, evosuite is the best for my personnal use – Sanea Feb 26 '18 at 10:02
  • Automatically generated test asserts behavior that is already described in your code. After generation they always pass. If you change something in your code and some tests are failed how it is very hard to understand what is wrong because the tests are not readable. My question is not about `evosuite`, but more general. What you achieve by using test generator? – talex Feb 26 '18 at 10:08
  • Mainly used to generate tests and get a decent code coverage, even though you need to do them again if you change some lines of code, that's the purpose of my question here ^^ – Sanea Feb 26 '18 at 10:16
  • Why do you need tests that always pass? – talex Feb 26 '18 at 10:17
  • True, they always pass, but i can verify that all my exception are caught – Sanea Feb 26 '18 at 10:59
  • No. It will generate test that make sure that exceptions are thrown. – talex Feb 26 '18 at 11:22

1 Answers1

0

Take a look at https://symflower.com it can also generate unit tests per function/method in your editor. That is a better granularity than generating the whole test suite. More incremental generation (only for the code you select, and for changes) is planned.

(Disclaimer I am CTO of Symflower and before founding i mainly researched and implemented test generation solutions for projects, e.g. with EvoSuite)