An open API service indexing awesome lists of open source software.

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.

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]
}
```