Documentation
¶
Overview ¶
Package pct defines the PCTCP testing strategy
Index ¶
- type DefaultMessageOrder
- type MessageOrder
- type PCTStrategy
- func (p *PCTStrategy) ActionsCh() *types.Channel[*strategies.Action]
- func (p *PCTStrategy) AddMessage(m *pctMessage, ctx *strategies.Context)
- func (p *PCTStrategy) EndCurIteration(_ *strategies.Context)
- func (p *PCTStrategy) Finalize(_ *strategies.Context)
- func (p *PCTStrategy) NextIteration(ctx *strategies.Context)
- func (p *PCTStrategy) Schedule() (*pctMessage, bool)
- func (p *PCTStrategy) Start() error
- func (p *PCTStrategy) Step(e *types.Event, ctx *strategies.Context)
- func (p *PCTStrategy) Stop() error
- type PCTStrategyConfig
- type PCTStrategyWithTestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultMessageOrder ¶
type DefaultMessageOrder struct {
// contains filtered or unexported fields
}
DefaultMessageOrder implements MessageOrder and tracks the causal ordering of messages. Two messages m_1 and m_2 are related by m_1 < m_2 iff recv(m_1) < send(m_2)
func NewDefaultMessageOrder ¶
func NewDefaultMessageOrder() *DefaultMessageOrder
func (*DefaultMessageOrder) AddRecvEvent ¶
func (eo *DefaultMessageOrder) AddRecvEvent(e *types.Message)
func (*DefaultMessageOrder) AddSendEvent ¶
func (eo *DefaultMessageOrder) AddSendEvent(e *types.Message)
func (*DefaultMessageOrder) Reset ¶
func (eo *DefaultMessageOrder) Reset()
type MessageOrder ¶
type MessageOrder interface {
// AddSendEvent is triggered when a send event of the corresponding message is processed
AddSendEvent(*types.Message)
// AddRecvEvent is triggered when a receive event of the corresponding message is processed
AddRecvEvent(*types.Message)
// Lt should return true if m_1 < m_2
Lt(types.MessageID, types.MessageID) bool
// Reset forgets all stored information and is invoked at the end of each iteration
Reset()
}
MessageOrder interface defines the message order for PCTCP to partition messages into chains
type PCTStrategy ¶
type PCTStrategy struct {
*types.BaseService
Actions *types.Channel[*strategies.Action]
// contains filtered or unexported fields
}
PCTStrategy type implements strategies.Strategy and encodes the logic of PCTCP exploration strategy - https://dl.acm.org/doi/10.1145/3276530
func NewPCTStrategy ¶
func NewPCTStrategy(config *PCTStrategyConfig) *PCTStrategy
Creates a new PCTStrategy with the specified config
func (*PCTStrategy) ActionsCh ¶ added in v0.2.7
func (p *PCTStrategy) ActionsCh() *types.Channel[*strategies.Action]
func (*PCTStrategy) AddMessage ¶
func (p *PCTStrategy) AddMessage(m *pctMessage, ctx *strategies.Context)
func (*PCTStrategy) EndCurIteration ¶
func (p *PCTStrategy) EndCurIteration(_ *strategies.Context)
func (*PCTStrategy) Finalize ¶
func (p *PCTStrategy) Finalize(_ *strategies.Context)
func (*PCTStrategy) NextIteration ¶
func (p *PCTStrategy) NextIteration(ctx *strategies.Context)
func (*PCTStrategy) Schedule ¶
func (p *PCTStrategy) Schedule() (*pctMessage, bool)
func (*PCTStrategy) Start ¶
func (p *PCTStrategy) Start() error
func (*PCTStrategy) Step ¶
func (p *PCTStrategy) Step(e *types.Event, ctx *strategies.Context)
func (*PCTStrategy) Stop ¶
func (p *PCTStrategy) Stop() error
type PCTStrategyConfig ¶
type PCTStrategyConfig struct {
RandSrc rand.Source
MaxEvents int
Depth int
MessageOrder MessageOrder
RecordFilePath string
}
PCTStrategyConfig contains the configuration for PCTCP strategy
type PCTStrategyWithTestCase ¶ added in v0.2.1
type PCTStrategyWithTestCase struct {
*PCTStrategy
// contains filtered or unexported fields
}
PCTStrategyWithTestCase encapsulates PCTStrategy with a testcase For each event, we invoke the filters of the testcase and when none of the filter conditions are satisfied, the event is passed to PCTStrategy.
func NewPCTStrategyWithTestCase ¶ added in v0.2.1
func NewPCTStrategyWithTestCase(config *PCTStrategyConfig, testCase *testlib.TestCase) *PCTStrategyWithTestCase
NewPCTStrategyWithTestCase creates a new PCTStrategyWithTestCase
func (*PCTStrategyWithTestCase) EndCurIteration ¶ added in v0.2.1
func (p *PCTStrategyWithTestCase) EndCurIteration(ctx *strategies.Context)
func (*PCTStrategyWithTestCase) NextIteration ¶ added in v0.2.1
func (p *PCTStrategyWithTestCase) NextIteration(ctx *strategies.Context)
func (*PCTStrategyWithTestCase) Step ¶ added in v0.2.1
func (p *PCTStrategyWithTestCase) Step(e *types.Event, ctx *strategies.Context)