Пример #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="context">AnalysisContext</param>
        private SCTEngine(AnalysisContext context)
        {
            this.AnalysisContext = context;

            this.NumOfFoundBugs = 0;
            this.BugReport = "";
            this.ExploredDepth = 0;
            this.ExploredSchedules = 0;
            this.PrintGuard = 1;

            if (this.AnalysisContext.Configuration.SchedulingStrategy == SchedulingStrategy.Random)
            {
                this.Strategy = new RandomStrategy(this.AnalysisContext);
            }
            else if (this.AnalysisContext.Configuration.SchedulingStrategy == SchedulingStrategy.DFS)
            {
                this.Strategy = new DFSStrategy(this.AnalysisContext);
                this.AnalysisContext.Configuration.FullExploration = false;
            }
            else if (this.AnalysisContext.Configuration.SchedulingStrategy == SchedulingStrategy.IDDFS)
            {
                this.Strategy = new IterativeDeepeningDFSStrategy(this.AnalysisContext);
                this.AnalysisContext.Configuration.FullExploration = false;
            }
            else if (this.AnalysisContext.Configuration.SchedulingStrategy == SchedulingStrategy.MaceMC)
            {
                this.Strategy = new MaceMCStrategy(this.AnalysisContext);
                this.AnalysisContext.Configuration.FullExploration = false;
                this.AnalysisContext.Configuration.CheckLiveness = true;
                this.AnalysisContext.Configuration.CacheProgramState = false;
            }

            this.HasRedirectedConsoleOutput = false;
        }
Пример #2
0
 /// <summary>
 /// Creates a new systematic concurrency testing engine.
 /// </summary>
 /// <param name="context">AnalysisContext</param>
 /// <returns>SCTEngine</returns>
 public static SCTEngine Create(AnalysisContext context)
 {
     return new SCTEngine(context);
 }