OBJECTSEMANTICS / SmallSuiteGenerator

Powered by SEMANTICS SRL
http://semantics.bo
MIT License
3 stars 2 forks source link

Weird result #37

Open bergel opened 5 years ago

bergel commented 5 years ago

I tried the following:

smallSuiteGenerator := SSmallSuiteGenerator newInstance.
smallSuiteGenerator seed: [RTRoassalExample new exampleAligningGroups].
smallSuiteGenerator fitness: (SMultiFitnessFunction 
        with: SMethodCoverage; 
        with: SStatementCoverage).

smallSuiteGenerator profilingOnClass: RTView. 
smallSuiteGenerator classNameOfTest: 'GeneratedRTViewTest'.
smallSuiteGenerator run.

It indeed produces the class GeneratedRTViewTest with some test methods. All the test methods are green, which is very good.

I wanted to know about the fitness evolution, so I tried:

smallSuiteGenerator engine logs collect: #fitness

But this gives me:

image

Which means that the fitness is not increasing.

I wanted to see what's going on, so I run Hapao on it. I put the generated class in a new package called TTTTT and run hapao on Roassal-Core and the new package TTTTT.

I obtain the following:

image

The method addAll: is not covered by Hapao. This means that the generated test does not call it (I did not verify this). But the code in exampleAligningGroups actually do call addAll:. Something is very weird here. I would guess that addAll: should be called by the generated tests

andreina-covi commented 5 years ago

The reason method addAll: is not called is because the elements that compose the list are RTElement's instances. At the moment when the testCase should be builded it gives error because we use the method storeString to build the RTElement's instances as they are scalars of typeInfo.

image

Calling the method storeString on classes such as RTElement or other is very complex because internally this method makes many recursive calls and makes stack overflow. We control this verifying the number of recursive calls and in the case this number is overcome it prints the basic call initialization. I'm reviewing this to improve it