Akiira / Comp-524-program

A genetic algorithm to create test suites that cover every branch of a program
2 stars 0 forks source link

Final Construction Phase (Ending GA once we have 100% coverage population wide) #14

Closed ambarket closed 9 years ago

ambarket commented 9 years ago

Below is a proposal for how we might design the final construction of a near optimal organism once the GA terminates.

After the population's coverage ratio reaches 100% or the max number of generations has been reached, the GA terminates and the program shifts into the fi nal construction phase. During this phase an optimal Organism will be hand crafted from the pool of genetic material in the population. This is done in two steps

Akiira commented 9 years ago

We could do this in one phase by starting with an empty test suite and using a greedy algorithm to always add the test case that covers the most uncovered edges. This could require O(n^2) time but should provide well sized test suites. Or it could be something as simple as taking the best organism and simply removing duplicates.

But, I don't think we should be too concerned with minimizing the test suite size. Our problem statement in the proposal stated the problem to solve was to "automatically create a test suite that covers all, or most, paths in a programs control flow graph." So we never really stated we were trying to minimize the test suite size.

That's not to say we shouldn't do it, just it should be a lower priority.

ambarket commented 9 years ago

This is now implemented and seems to work quite nicely. Will update the progress report to indicate it is completed. I also just deleted all the branches since they were all behind master. I hope that doesn't cause any problems for you, I probably should have asked first..

ambarket commented 9 years ago

I updated the progress report to include this. Please read over it at some point, I'm tired and my writing is probably very poor and maybe it should be included or worded differently. Its in both the update goals section and completed goals section.

Akiira commented 9 years ago

I don't think it really makes sense to add it to our updated goals because its not a goal our project was ever trying to achieve and isn't even part of the genetic algorithm, it is just run afterwards.

ambarket commented 9 years ago

That's fine go ahead and remove it On Mar 24, 2015 1:47 PM, "Akiira" notifications@github.com wrote:

I don't think it really makes sense to add it to our updated goals because its not a goal our project was ever trying to achieve and isn't even part of the genetic algorithm, it is just run afterwards.

— Reply to this email directly or view it on GitHub https://github.com/Akiira/Comp-524-program/issues/14#issuecomment-85617357 .

Akiira commented 9 years ago

I believe there is a bug in the constructFinalOrganism function. In at least some cases where the population does not have all the coverage it seems to loop forever. I would look into it myself but I'm getting very sleepy.