I'm still in the planning stages, so no actual code yet.
This is for research, so I've been mostly focusing on how to do it the "right" way :)
My end goal is to mutation test the Go standard library packages, and chart them over time (each release).
I've looked at your go-mutesting, and also the manbearpig tool as a jumping off point.
At this point my pplan looks like this:
- ParseDir the package directory, skipping over _*.go and *_test.go
- Mutate the AST with:
- operator ( + to -, ++ to --)
- comparison (< to >=)
- logical (|| to &&)
- node removal (emptying case/else bodies, removing default case in switches)
- Flipping exported structs/funcs to private (uppercase to lowercase)
- Write out AST to a tmp directory
- Copy over *_test.go to tmp directory
- `go test` -> record results to JSON {pkg, mutationPosition, mutationType, result, mutation, filename}
- Aggregate the JSON results for a package
I did skim over go-fuzz, but it also looks like it use os.Command... honestly it's a huge program for a beginner like me to take apart.
-Jacob