https://github.com/aprimadi/go-delta-debugging
Delta debugging algorithm implemented in Go.
https://github.com/aprimadi/go-delta-debugging
delta-debugging
Last synced: about 1 year ago
JSON representation
Delta debugging algorithm implemented in Go.
- Host: GitHub
- URL: https://github.com/aprimadi/go-delta-debugging
- Owner: aprimadi
- License: mit
- Created: 2020-07-24T19:19:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-24T19:24:10.000Z (almost 6 years ago)
- Last Synced: 2025-04-24T23:15:22.477Z (about 1 year ago)
- Topics: delta-debugging
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-delta-debugging
==================
This library provides an implementation of the delta debugging algorithm described here: http://web2.cs.columbia.edu/~junfeng/09fa-e6998/papers/delta-debug.pdf. Code that uses this library should implement the FSM (Finite State Machine) defined in `fsm.go`.
Usage
-----
```
package main
import (
"fmt"
dd "github.com/aprimadi/go-delta-debugging"
)
// A simple FSM that becomes faulty when it contains an event "3"
type SimpleFSM struct {
events []dd.Event
}
// Reset the FSM state
func (f *SimpleFSM) Reset() {}
// Apply events to the FSM
func (f *SimpleFSM) Apply(events []dd.Event) {
f.events = events
}
// Is the FSM in valid state?
func (f *SimpleFSM) Valid() bool {
for _, n := range f.events {
if n == 3 {
return false
}
}
return true
}
func main() {
fsm := &SimpleFSM{}
result := dd.DeltaDebug(fsm, []dd.Event{1, 2, 3, 4, 5, 6, 7, 8})
fmt.Println(result) // Print: [3]
}
```