Akiira / Comp-524-program

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

Negative totalUsefulness #18

Closed Akiira closed 9 years ago

Akiira commented 9 years ago

I'm jumping around several different homework assignments right now but I noticed the simulation paused so I looked at the debug info and it had a negative value for totalusefullness.

The test it was on: Testing population: 150, cutPoints: 9, mutation: 0.350000, on: HiLo

Variable Info at stop and location of stop: test

I'm going to do some more testing on it, just posting this for documentation.

Also note the numOfUses is extremly large.

edit:

Two questions:

  1. What is the usesArray for in Range?
  2. Whats this equation: (end - start) / 25 + 1 ?
ambarket commented 9 years ago

Thanks for posting this it helped me find it a lot faster.

usesArray is the array of buckets, each of size 25 that store counts of the number of times parameters in those buckets were used in test cases that provided unique coverage,

That equation then gives the number of buckets needed for the Range from start to end. The plus one was a failed attempt to mitigate issues when range sizes are not divisible by 25. I fixed this with better logic.

The bug was a problem in the logic I wrote to copy the usesArray buckets to new Ranges when splitting. The large numbers came from accessing memory outside the bounds of the source Range's usesArray.