public Task <string> RunTestAsync(string testName, int machines, int numberOfMethods, string expID, string rootKind = "Default")
        {
            var result = string.Empty;

            try
            {
                var analyzer       = SolutionAnalyzer.CreateFromTest(GrainClient.Instance, testName);
                var analysisClient = new AnalysisClient(analyzer, machines);

                //var results = await analysisClient.RunExperiment(GrainClient.GrainFactory, expID);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                analysisClient.StartRunningExperiment(GrainClient.GrainFactory, expID, Utils.ToAnalysisRootKind(rootKind));
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                //result = string.Format("Ready for queries. Time: {0} ms", results.ElapsedTime);
                result = string.Format("Running test {0}.", testName);
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }
                result = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }

            return(Task.FromResult(result));
        }
Пример #2
0
        public async Task StorageService_SetSolutionList()
        {
            var fileUtils        = new FileUtilities();
            var solutionAnalyzer = new SolutionAnalyzer(new ProjectAnalyzer(fileUtils), fileUtils);
            var solution         = await solutionAnalyzer.AnalyzeSolution(@"C:\VS2015\pp-git\LocationService\LocationService.sln", projectNamesToIgnore : new List <string> {
                "Test"
            });

            var solutionList = new SolutionList {
                solution
            };
            var storage = new StorageService();

            storage.Initialize("1000.01", "UseDevelopmentStorage=true", "solutioncontainer");

            for (var i = 0; i < 20; i++)
            {
                await storage.SetSolutionList(new SolutionConfiguration
                {
                    StorageIdentifier = "LocationService",
                    AreaTags          = SolutionAreaTag.Location | SolutionAreaTag.TimeCapture | SolutionAreaTag.DigitalAssistant
                },
                                              solutionList);
            }
        }
        public Task <string> AnalyzeSolutionAsync(string drive, string solutionPath, string solutionName, int machines, string expID, string rootKind = "Default")
        {
            var result = string.Empty;

            try
            {
                if (string.IsNullOrEmpty(expID))
                {
                    expID = solutionName;
                }
                solutionPath = Path.Combine(drive + ":\\" + solutionPath, solutionName + ".sln");
                var analyzer       = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionPath);
                var analysisClient = new AnalysisClient(analyzer, machines);

                //var results = await analysisClient.RunExperiment(GrainClient.GrainFactory, expID);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                analysisClient.StartRunningExperiment(GrainClient.GrainFactory, expID, Utils.ToAnalysisRootKind(rootKind));
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                //result = string.Format("Ready for queries. Time: {0} ms", results.ElapsedTime);
                result = string.Format("Analyzing solution {0}.", solutionName);
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }
                result = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }

            return(Task.FromResult(result));
        }
Пример #4
0
        private SolutionAnalyzer RunAnalysis(string solutionPath)
        {
            System.Console.WriteLine("Analyzing solution...");

            var analyzer = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionPath);

            analyzer.RootKind = AnalysisRootKind.RootMethods;

            var timer = Stopwatch.StartNew();

            analyzer.AnalyzeAsync(strategyKind).Wait();

            timer.Stop();

            System.Console.WriteLine("Solution analysis finish ({0} ms)", timer.ElapsedMilliseconds);

            System.Console.WriteLine();
            var color = System.Console.ForegroundColor;

            System.Console.ForegroundColor = ConsoleColor.White;
            var rootMethods = analyzer.SolutionManager.GetRootsAsync().Result;

            System.Console.WriteLine("Root methods={0} ({1})", rootMethods.Count(), analyzer.RootKind);

            var reachableMethodsCount = analyzer.SolutionManager.GetReachableMethodsCountAsync().Result;

            System.Console.WriteLine("Reachable methods={0}", reachableMethodsCount);
            System.Console.ForegroundColor = color;
            System.Console.WriteLine();

            return(analyzer);
        }
Пример #5
0
 public async Task SolutionAnalyzer_test()
 {
     var fileUtils        = new FileUtilities();
     var solutionAnalyzer = new SolutionAnalyzer(new ProjectAnalyzer(fileUtils), fileUtils);
     var projectList      = await solutionAnalyzer.AnalyzeSolution(@"C:\VS2015\pp-git\LocationService\LocationService.sln", projectNamesToIgnore : new List <string> {
         "Test"
     });
 }
Пример #6
0
        public void ParseProjectLineTest()
        {
            ProjectData result = SolutionAnalyzer.ParseProjectLine("some not interesting string");

            Assert.IsNull(result);
            result = SolutionAnalyzer.ParseProjectLine("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC\") = \"ClassLibraryProject\", \"ClassLibraryProject\\ClassLibraryProject.csproj\", \"{953E1F18-3833-4CEB-8F51-9338ECB1E0F6}\"");
            Assert.AreEqual("ClassLibraryProject", result.ProjectName);
            Assert.AreEqual(@"ClassLibraryProject\ClassLibraryProject.csproj", result.ProjectFileName);
            Assert.AreEqual("ClassLibraryProject", result.ProjectFolder);
        }
        protected override async Task <Dictionary <string, SlnFile> > ProcessImpl(Task <Solution> previousTask)
        {
            var slnObject = await previousTask;

            Contract.Assert(slnObject is Solution s && s != null,
                            $"Expected previous task to return a Solution object, but found {slnObject} instead.");
            var solution = (Solution)slnObject;

            return(SolutionAnalyzer.AllSolutionFiles(solution, _workingDirectory));
        }
        private static async Task <ISet <MethodDescriptor> > RunAnalysisFromSourceAsync(int machines, string source)
        {
            var analyzer       = SolutionAnalyzer.CreateFromSource(GrainClient.Instance, source);
            var analysisClient = new AnalysisClient(analyzer, machines);
            var callgraph      = await analysisClient.Analyze();

            var reachableMethods = callgraph.GetReachableMethods();

            return(await Task.FromResult(reachableMethods));
        }
Пример #9
0
        /// <summary>
        /// This auxiliary constructor is used only then a SolutionManager (e.g. SolutionGrain, already exists)
        /// This is the case when we want to query an existing system
        /// </summary>
        /// <param name="solutionManager"></param>
        /// <param name="machines"></param>
        /// <param name="subject"></param>
        public AnalysisClient(ISolutionGrain solutionManager, int machines, string subject = "")
        {
            this.analyzer        = null;
            this.solutionManager = solutionManager;
            this.machines        = machines;
            this.subject         = subject;

            Environment.SetEnvironmentVariable("MyInstanceCount", machines.ToString());
            AnalysisConstants.SetInstanceCount(machines);
        }
        protected void ButtonTestSolution_Click(object sender, EventArgs e)
        {
            try
            {
                this.TextBox1.Text = "Accessing Grains...";
                var solutionPath = TextBoxPath.Text;
                var pathPrefix   = TextBoxPathPrefix.Text;

                try
                {
                    var tokens          = TextRandomQueryInput.Text.Split(';');
                    var className       = tokens[0];
                    var methodPrejix    = tokens[1];
                    var numberOfMethods = int.Parse(tokens[2]);
                    var repetitions     = int.Parse(tokens[3]);
                    var machines        = int.Parse(tokens[4]);
                    var rootKind        = Utils.ToAnalysisRootKind(tokens[5]);

                    var solutionFileName = Path.Combine(pathPrefix, solutionPath);
                    var analyzer         = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionFileName);

                    var analysisClient = new AnalysisClient(analyzer, machines);
                    //await analysisClient.Analyze();

                    //await analysisClient.RunExperiment(GrainClient.GrainFactory, solutionPath.Replace('\\','-').Replace('.','-'));
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                    analysisClient.StartRunningExperiment(GrainClient.GrainFactory, solutionPath.Replace('\\', '-').Replace('.', '-'), rootKind);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                    //var reachableMethods = await RunAnalysisAsync(machines, pathPrefix, solutionPath);
                    //string methods = String.Join("\n", reachableMethods);
                    //this.TextBox1.Text = string.Format("Reachable methods={0} \n{1}", reachableMethods.Count, methods);
                    this.TextBox1.Text = "Done";
                }
                catch (Exception exc)
                {
                    while (exc is AggregateException)
                    {
                        exc = exc.InnerException;
                    }
                    System.Diagnostics.Trace.TraceError("Error dutring initialization of WorkerRole {0}", exc.ToString());
                    this.TextBox1.Text = exc.ToString();
                }
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }

                this.TextBox1.Text = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }
        }
Пример #11
0
        public AnalysisClient(SolutionAnalyzer analyzer, int machines, string subject = "")
        {
            this.analyzer = analyzer;
            // We want to force the manager to be obtained when is ready
            // this.solutionManager = analyzer.SolutionManager;
            this.machines = machines;
            this.subject  = subject;

            Environment.SetEnvironmentVariable("MyInstanceCount", machines.ToString());
            AnalysisConstants.SetInstanceCount(machines);
        }
Пример #12
0
        private void InitializeAnalysis(string solutionPath)
        {
            Console.WriteLine("Analyzing solution...");

            this.Initialize();
            this.solutionPath = solutionPath;
            this.analyzer     = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionPath);
            analyzer.AnalyzeAsync(strategyKind).Wait();

            OrleansController.SolutionManager = analyzer.SolutionManager;

            Console.WriteLine("Done");
        }
        private static async Task <ISet <MethodDescriptor> > RunAnalysisAsync(int machines, string pathPrefix, string solutionRelativePath)
        {
            var currentSolutionPath = pathPrefix;
            var solutionFileName    = Path.Combine(currentSolutionPath, solutionRelativePath);

            var analyzer = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionFileName);

            var analysisClient = new AnalysisClient(analyzer, machines);
            var callgraph      = await analysisClient.Analyze();

            var reachableMethods = callgraph.GetReachableMethods();

            return(await Task.FromResult(reachableMethods));
        }
        protected void ButtonTestTest_Click(object sender, EventArgs e)
        {
            try
            {
                var testName = TextBoxPath.Text;
                var tokens   = TextRandomQueryInput.Text.Split(';');

                var className       = tokens[0];
                var methodPrejix    = tokens[1];
                var numberOfMethods = int.Parse(tokens[2]);
                var repetitions     = int.Parse(tokens[3]);
                var machines        = int.Parse(tokens[4]);

                var analyzer       = SolutionAnalyzer.CreateFromTest(GrainClient.Instance, testName);
                var analysisClient = new AnalysisClient(analyzer, machines);
                //var stopWatch = Stopwatch.StartNew();

                //var results = await analysisClient.RunExperiment(GrainClient.GrainFactory);
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                analysisClient.StartRunningExperiment(GrainClient.GrainFactory);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                //stopWatch.Stop();
                Application["AnalysisClient"] = analysisClient;

                //this.TextBox1.Text = string.Format("Ready for queries. Time: {0} ms", results.ElapsedTime);
                this.TextBox1.Text = string.Format("Running test {0}.", testName);

                //Logger.LogInfo(GrainClient.Logger, "Stats", "Query", "Analyzing {0} took:{1} ms", testName, results.ElapsedTime);
                Logger.LogInfo(GrainClient.Logger, "Stats", "Query", "Analyzing {0}.", testName);

                //var result = await analysisClient.ComputeRandomQueries(className, methodPrejix, numberOfMethods, repetitions);

                //var result = await analysisClient.ComputeRandomQueries(repetitions);


                //program.RetriveInfoFromAnalysis();

                //System.Diagnostics.Trace.TraceInformation("Analyzing {0} took:{1} ms", testName, stopWatch.ElapsedMilliseconds);
            }
            catch (Exception exc)
            {
                while (exc is AggregateException)
                {
                    exc = exc.InnerException;
                }
                this.TextBox1.Text = "Error connecting to Orleans: " + exc + " at " + DateTime.Now;
            }
        }
Пример #15
0
        public static void AnalyzeSolution(string solutionPath, RunChecks checker, AnalysisStrategyKind strategy = AnalysisStrategyKind.NONE)
        {
            Environment.SetEnvironmentVariable("MyIPAddr", "127.0.0.1");

            var solAnalyzer = SolutionAnalyzer.CreateFromSolution(GrainClient, solutionPath, AnalysisRootKind.MainMethods);
            var callgraph   = solAnalyzer.Analyze(strategy);

            if (strategy == AnalysisStrategyKind.ONDEMAND_ORLEANS)
            {
                var myStatsGrain = StatsHelper.GetStatGrain(GrainClient);
                myStatsGrain.ResetStats().Wait();
            }

            checker(solAnalyzer, callgraph);
        }
Пример #16
0
        public async Task AnalyzeSolutionAsync(string solutionPath, AnalysisStrategyKind strategyKind = StrategyKind)
        {
            {
                // Hack! Remove these lines
                //var solutionToTest = @"ConsoleApplication1\ConsoleApplication1.sln";
                var solutionToTest = @"coby\Coby.sln";
                solutionPath = Path.Combine(OrleansController.ROOT_DIR, solutionToTest);
            }

            OrleansController.solutionPath = solutionPath;
            OrleansController.analyzer     = SolutionAnalyzer.CreateFromSolution(GrainClient.Instance, solutionPath);
            await analyzer.AnalyzeAsync(strategyKind);

            // This call is to fill the documentsAssemblyName mapping
            await GetAllFilesAsync();
        }
Пример #17
0
        protected void RunTest(string testName, Action <IEnumerable <RegistrationInfo> > action)
        {
            string fileName = testName + Extension;
            var    dataPath = new DirectoryInfo(Path.Combine(SolutionItemsBasePath, RelativeTypesPath));
            var    fileSet  = dataPath.GetFiles("*.cs").SelectNotNull(fileInfo => Path.Combine(RelativeTypesPath, fileInfo.Name)).Concat(new[] { fileName });

            WithSingleProject(fileSet, (lifetime, project) => RunGuarded(() =>
            {
                var searchDomainFactory = ShellInstance.GetComponent <SearchDomainFactory>();
                var patternSearcher     = new PatternSearcher(searchDomainFactory);
                var solutionnAnalyzer   = new SolutionAnalyzer(patternSearcher);
                solutionnAnalyzer.AddContainer(ContainerInfo);

                var componentRegistrations = solutionnAnalyzer.Analyze();

                action(componentRegistrations);
            }));
        }
Пример #18
0
        public static async Task Main(string[] args)
        {
            var cfgCtx = new ConfigContext(InterfaceResolverType.ProjectLevel);

            try
            {
                var options = new ProgramOptions(args);

                if (!string.IsNullOrEmpty(options.DemoCase))
                {
                    options.CreateDemoCase();
                }

                IDoLog logger      = new ConsoleLogger(verbose: options.VerboseLogging, debug: options.DebugLogging);
                var    msBuildPath = options.PathToMSBuild;
                if (string.IsNullOrEmpty(msBuildPath))
                {
                    msBuildPath = @"C:\Program Files\dotnet\sdk\2.2.103";
                    logger.Warning("No Path to MSBuild given falling back to " + msBuildPath);
                }
                using (var solutionAnalyzer = new SolutionAnalyzer(options.PathToSolution, msBuildPath, logger))
                {
                    await solutionAnalyzer.LoadSolution(options.ExcludingAssemblies);

                    var projectAnalyzer = new ProjectAnalyzer(solutionAnalyzer.ParsedSolution, solutionAnalyzer.OutputFiles, logger);
                    await projectAnalyzer.LoadProject(options.ProjectName);

                    var interfaceResolver = InterfaceResolverFactory.GetInterfaceResolver(solutionAnalyzer, projectAnalyzer, logger, cfgCtx);

                    var    sequenceDiagram = new SequenceDiagramGenerator(projectAnalyzer.AnalyzedClasses, interfaceResolver, logger);
                    string diagramText     = await sequenceDiagram.GetSequenceDiagramForMethod(options.ClassName, options.MethodName);

                    await WriteDiagramToFile(diagramText, options.OutputFile);

                    Console.WriteLine("Wrote to " + options.OutputFile);
                }
            }
            catch (InvalidOperationException ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine("Finished...");
        }
Пример #19
0
        public static void AnalyzeExample(string source, RunChecks initialChecker, Action <SolutionAnalyzer> updates, RunChecks updatesChecker, AnalysisStrategyKind strategy = AnalysisStrategyKind.NONE)
        {
            Environment.SetEnvironmentVariable("MyIPAddr", "127.0.0.1");
            //var solution = ReachingTypeAnalysis.Utils.CreateSolution(source);
            //var solAnalyzer = new SolutionAnalyzer(solution);
            var solAnalyzer = SolutionAnalyzer.CreateFromSource(GrainClient, source, AnalysisRootKind.MainMethods);
            var callgraph   = solAnalyzer.Analyze(strategy);

            if (strategy == AnalysisStrategyKind.ONDEMAND_ORLEANS)
            {
                var myStatsGrain = StatsHelper.GetStatGrain(GrainClient);
                myStatsGrain.ResetStats().Wait();
            }

            initialChecker(solAnalyzer, callgraph);
            updates(solAnalyzer);
            callgraph = solAnalyzer.GenerateCallGraphAsync().Result;
            updatesChecker(solAnalyzer, callgraph);
        }
Пример #20
0
        public async Task <string> CreateDiagram(string msBuildPath, string className, string methodName, string excludingAssemblies)
        {
            var solutionDir = Path.Combine(GetTestDataPath(), _testDir, _solutionName);

            var    cfgCtx = new ConfigContext(InterfaceResolverType.ProjectLevel);
            IDoLog logger = new NullLogger();

            using (var solutionAnalyzer = new SolutionAnalyzer(solutionDir, msBuildPath, logger))
            {
                await solutionAnalyzer.LoadSolution(excludingAssemblies);

                var projectAnalyzer = new ProjectAnalyzer(solutionAnalyzer.ParsedSolution, solutionAnalyzer.OutputFiles, logger);
                await projectAnalyzer.LoadProject(_projectName);

                var interfaceResolver = InterfaceResolverFactory.GetInterfaceResolver(solutionAnalyzer, projectAnalyzer, logger, cfgCtx);

                var sequenceDiagram = new SequenceDiagramGenerator(projectAnalyzer.AnalyzedClasses, interfaceResolver, logger);
                return(await sequenceDiagram.GetSequenceDiagramForMethod(className, methodName));
            }
        }
Пример #21
0
        public void DiscoverAllSolutionTypes(string solutionPath)
        {
            // discover all solution projects
            var solutionAnalyzer = new SolutionAnalyzer(solutionPath);
            var analyedSolution  = solutionAnalyzer.AnalyzeSolution();

            foreach (AnalyzedProject proj in analyedSolution.Projects)
            {
                var assembly = Assembly.LoadFile(proj.OutputFilePath);
                _assemblyExportedTypes = assembly.GetExportedTypes();

                foreach (Class cls in proj.Classes)
                {
                    Type classType = null;
                    foreach (Type type in _assemblyExportedTypes)
                    {
                        if (type.Name == cls.Name)
                        {
                            classType = type;
                            break;
                        }
                    }

                    if (classType != null)
                    {
                        if (cls.Constructor != null)
                        {
                            // having the constructor signature, create a new instance of that object
                            var classInstance = CreateNewInstance(cls.Constructor, classType, proj.Classes);
                            Instances.Add(cls.Name, classInstance);
                        }
                        else
                        {
                            // no constructor
                            var classInstance = CreateDefaultInstance(classType);
                            Instances.Add(cls.Name, classInstance);
                        }
                    }
                }
            }
        }
Пример #22
0
        public object DynamicallyInvokeFunction(string solutionPath, string typeName, string methodName)
        {
            // discover all solution projects
            var solutionAnalyzer = new SolutionAnalyzer(solutionPath);
            var analyedSolution  = solutionAnalyzer.AnalyzeSolution();

            foreach (AnalyzedProject proj in analyedSolution.Projects)
            {
                var assembly = Assembly.LoadFile(proj.OutputFilePath);
                var assemblyExportedTypes = assembly.GetExportedTypes();

                foreach (Type type in assemblyExportedTypes)
                {
                    if (type.Name == typeName)
                    {
                        var methods = type.GetMethods();
                        foreach (MethodInfo m in methods)
                        {
                            if (m.Name == methodName)
                            {
                                // generate method parameters
                                var methodParameters = m.GetParameters();
                                var parameters       = new List <object>();
                                foreach (ParameterInfo p in methodParameters)
                                {
                                    var instance = ResolveParameter(p.ParameterType.Name);
                                    parameters.Add(instance);
                                }

                                // invoke the function
                                _objectFactory.Instances.TryGetValue(typeName, out object objectInstance);
                                var result = m.Invoke(objectInstance, parameters.ToArray());
                                return(result);
                            }
                        }
                    }
                }
            }

            return("Method not found");
        }
Пример #23
0
        public void AnalyzeComplexTest()
        {
            var solutionAnalyzer = new SolutionAnalyzer();
            var solutionData     = solutionAnalyzer.Analyze(@"..\..\CodeAnalyzer\TestData\ApplicationForAnalysis\ApplicationForAnalysis.sln");

            Assert.AreEqual("ApplicationForAnalysis.sln", solutionData.SolutionFileName);
            Assert.AreEqual("ApplicationForAnalysis", solutionData.SolutionName);
            Assert.AreEqual(@"..\..\CodeAnalyzer\TestData\ApplicationForAnalysis", solutionData.SolutionFolderName);

            Assert.AreEqual(3, solutionData.Projects.Count);
            Assert.AreEqual("WinFormProject", solutionData.Projects[0].ProjectName);
            Assert.AreEqual(@"WinFormProject\WinFormProject.csproj", solutionData.Projects[0].ProjectFileName);
            Assert.AreEqual("WinFormProject", solutionData.Projects[0].ProjectFolder);

            Assert.AreEqual("ClassLibraryProject", solutionData.Projects[1].ProjectName);
            Assert.AreEqual(@"ClassLibraryProject\ClassLibraryProject.csproj", solutionData.Projects[1].ProjectFileName);
            Assert.AreEqual("ClassLibraryProject", solutionData.Projects[1].ProjectFolder);

            Assert.AreEqual("WebProject", solutionData.Projects[2].ProjectName);
            Assert.AreEqual(@"WebProject\WebProject.csproj", solutionData.Projects[2].ProjectFileName);
            Assert.AreEqual("WebProject", solutionData.Projects[2].ProjectFolder);
        }
Пример #24
0
        //private const string SolutionPath = @"D:\Work\Upwork\1_QueryTree\QueryTree.sln";


        private static async Task Main(string[] args)
        {
            // Attempt to set the version of MSBuild.
            var visualStudioInstances = MSBuildLocator.QueryVisualStudioInstances().ToArray();
            var instance = visualStudioInstances.Length == 1
                           // If there is only one instance of MSBuild on this machine, set that as the one to use.
                                ? visualStudioInstances[0]
                           // Handle selecting the version of MSBuild you want to use.
                                : SelectVisualStudioInstance(visualStudioInstances);

            Console.WriteLine($"Using MSBuild at '{instance.MSBuildPath}' to load projects.");

            // NOTE: Be sure to register an instance with the MSBuildLocator
            //       before calling MSBuildWorkspace.Create()
            //       otherwise, MSBuildWorkspace won't MEF compose.
            MSBuildLocator.RegisterInstance(instance);

            using (var workspace = MSBuildWorkspace.Create()) {
                // Print message for WorkspaceFailed event to help diagnosing project load failures.
                workspace.WorkspaceFailed += (o, e) => Console.WriteLine(e.Diagnostic.Message);

                Console.WriteLine($"Loading solution '{SolutionPath}'");

                // Attach progress reporter so we print projects as they are loaded.
                var solution = await workspace.OpenSolutionAsync(SolutionPath, new ConsoleProgressReporter());

                Console.WriteLine($"Finished loading solution '{SolutionPath}'");

                //TODO:
                var engine = new SolutionAnalyzer();
                var result = engine.Analyze(solution).Result;
            }

            Console.WriteLine("done");
            Console.ReadLine();
        }
Пример #25
0
 public ContainerRegistrationAnalysisStage(SolutionAnalyzer solutionAnalyzer)
 {
     this.solutionAnalyzer = solutionAnalyzer;
 }
Пример #26
0
 public StructureResolver(SolutionAnalyzer solutionAnalyzer, AssemblyAnalyzer assemblyAnalyzer)
 {
     this.assemblyAnalyzer = assemblyAnalyzer;
     this.solutionAnalyzer = solutionAnalyzer;
 }
Пример #27
0
        public List <string> GenerateUnitTestsForClass(string solutionPath,
                                                       string generatedUnitTestProject, List <string> projClasses)
        {
            List <string> generatedTestClasses = new List <string>();

            // analyze solution, discover basic information about each project
            var            solutionAnalyzer = new SolutionAnalyzer(solutionPath);
            var            analyedSolution  = solutionAnalyzer.AnalyzeSolution();
            CompilerHelper compileHelper    = new CompilerHelper(_generatedTestClassesDirectory);

            foreach (AnalyzedProject proj in analyedSolution.Projects)
            {
                if (proj.Name != generatedUnitTestProject)
                {
                    var assembly = Assembly.LoadFile(proj.OutputFilePath); //TODO: what if the assembly does not exist because the project is not compiled??
                    _assemblyExportedTypes = assembly.GetExportedTypes();
                    inputParamGenerator    = new InputParamGenerator(_assemblyExportedTypes);

                    foreach (Type type in _assemblyExportedTypes)
                    {
                        if (projClasses.Any(pc => pc == type.Name))
                        {
                            if (!type.IsInterface) // don't want to write unit tests for interfaces
                            {
                                // create a class
                                CodeTypeDeclaration targetClass = new CodeTypeDeclaration
                                                                      (string.Format("{0}UnitTestsClass", type.Name))
                                {
                                    IsClass        = true,
                                    TypeAttributes = TypeAttributes.Public
                                };

                                // create a code unit (the in-memory representation of a class)
                                CodeCompileUnit codeUnit        = CreateCodeCompileUnit(proj.Name, type.Name, targetClass);
                                string          classSourceName = string.Format("{0}UnitTestsClass.cs", type.Name);

                                // generate the constructor for the unit test class in which all the
                                // external dependencies/calls will be mocked
                                var cut_ConstructorGenerator = new CUT_AddConstructor(inputParamGenerator, selectedProjectName);
                                cut_ConstructorGenerator.AddTestClassConstructor(classSourceName, targetClass, type, analyedSolution);

                                // generate a unit test for each method
                                // the method will be called and a Assert.NotNull assertion will be added
                                var methods = type.GetMethods(BindingFlags.Public
                                                              | BindingFlags.Instance | BindingFlags.DeclaredOnly);

                                foreach (MethodInfo m in methods)
                                {
                                    // randomly generate method parameters
                                    var methodParameters        = m.GetParameters();
                                    CodeExpression[] parameters = new CodeExpression[methodParameters.Length];
                                    int j = 0;
                                    foreach (ParameterInfo p in methodParameters)
                                    {
                                        // TODO: Rethink this !!!
                                        if (p.ParameterType.Name == "String" || p.ParameterType.Name == "Int32")
                                        {
                                            parameters[j] = new CodePrimitiveExpression(
                                                inputParamGenerator.ResolveParameter(p.ParameterType.Name));
                                        }
                                        else
                                        {
                                            CodeObjectCreateExpression createObjectExpression =
                                                inputParamGenerator.CreateCustomType(p.ParameterType.Name);
                                            parameters[j] = createObjectExpression;
                                        }
                                        j++;
                                    }

                                    var cut_addTestMethod = new CUT_AddTestMethod(inputParamGenerator);

                                    // Assert.NotNull(result);
                                    // Assert.NotThrow(() => targetObj.SomePublicMethod())
                                    cut_addTestMethod.AddTestMethod_ShouldNotThrowExceptionResultShouldNotBeNull(targetClass, m.Name,
                                                                                                                 parameters, type, "CallShouldNotThrowExceptionAndResultShouldNotBeNull");

                                    // Assert.AreEqual(result, "Insert expected value here.");
                                    cut_addTestMethod.AddTestMethod_ExpectedResultPlaceholder(targetClass, m.Name,
                                                                                              parameters, type, "ResultShouldBeAsExpected");
                                }

                                // generate the c# code based on the created code unit
                                string generatedTestClassPath = compileHelper.GenerateCSharpCode(codeUnit, classSourceName);

                                // compile the above generated code into a DLL/EXE
                                bool isGeneratedClassCompiled = compileHelper.CompileAsDLL(classSourceName, new List <string>()
                                {
                                    string.Format("{0}\\{1}", _packagesFolder, "NUnit.3.10.1\\lib\\net45\\nunit.framework.dll"),
                                    string.Format("{0}\\{1}", _packagesFolder, "Moq.4.10.0\\lib\\net45\\Moq.dll"),
                                    proj.OutputFilePath,
                                    typeof(System.Linq.Enumerable).Assembly.Location
                                });

                                if (!string.IsNullOrEmpty(generatedTestClassPath) && isGeneratedClassCompiled)
                                {
                                    generatedTestClasses.Add(generatedTestClassPath);
                                }
                            }
                        }
                    }
                }
            }

            return(generatedTestClasses);
        }
Пример #28
0
 public void Initalize(SolutionAnalyzer solAnalyzer, AssemblyAnalyzer assemAnalyzer)
 {
     this.structureResolver = new StructureResolver(solAnalyzer, assemAnalyzer);
 }
Пример #29
0
        public ContainerRegistrationAnalysisStageProcess(IDaemonProcess process, IContextBoundSettingsStore settingsStore, ITypeUsageManager typeUsageManager, SolutionAnalyzer solutionAnalyzer)
        {
            this.process          = process;
            this.settingsStore    = settingsStore;
            this.typeUsageManager = typeUsageManager;

            cachedComponentRegistrations = solutionAnalyzer.Analyze().ToList();
        }
Пример #30
0
 public RegisteredComponentsContextSearch(SolutionAnalyzer solutionAnalyzer, IShellLocks locks)
 {
     this.locks          = locks;
     cachedRegistrations = solutionAnalyzer.Analyze();
 }
Пример #31
0
        static void Main(string[] args)
        {
            //// This is to generate big synthetic tests in x64 to avoid getting OutOfMemory exceptions
            //var a = new OrleansClient.Tests.CallGraphGenerator();
            //a.GenerateSyntheticSolution();
            //Console.WriteLine("Done!");
            //Console.ReadKey();
            //return;

            args = new string[]
            {
                //@"..\..\..\ConsoleApplication1\ConsoleApplication1.sln", "OnDemandAsync"
                //@"..\..\..\ConsoleApplication1\ConsoleApplication1.sln", "OnDemandOrleans"
                //@"..\..\..\TestsSolutions\LongTest2\LongTest2.sln", "OnDemandAsync"
                //@"C:\Users\diegog\Temp\newSynthetic\synthetic-1000\test.sln", "OnDemandOrleans"
                //@"C:\Users\Edgar\Projects\Call-Graph-Builder\TestsSolutions\synthetic-1000\test.sln", "OnDemandOrleans"
                //@"C:\Users\diegog\Temp\newSynthetic\synthetic-1000000\test.sln", "OnDemandOrleans"
                //@"C:\Users\t-edzopp\Desktop\Roslyn\Roslyn.sln", "OnDemandAsync"
                //@"C:\Users\t-edzopp\Desktop\Roslyn\Roslyn.sln", "OnDemandOrleans"
                //@"C:\Users\t-edzopp\Desktop\ArcusClientPrototype\src\ArcusClient\data\Coby\Coby.sln", "OnDemandAsync"
                //@"C:\Users\t-digarb\Source\Coby\Coby.sln", "OnDemandAsync"
                //@"C:\Users\t-edzopp\Desktop\ArcusClientPrototype\src\ArcusClient\data\Coby\Coby.sln", "OnDemandOrleans"

                //@"C:\Users\Edgar\Projects\Test projects\de4dot\de4dot.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Test projects\RestSharp\RestSharp.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Test projects\buildtools\src\BuildTools.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Test projects\codeformatter\src\CodeFormatter.sln", "OnDemandAsync" // works!
                //@"C:\Users\Edgar\Projects\Test projects\Json\Src\Newtonsoft.Json.sln", "OnDemandAsync" // with errors
                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Call-Graph-Builder\RealSolutions\codeformatter\src\CodeFormatter.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Call-Graph-Builder\RealSolutions\ShareX\ShareX.sln", "OnDemandOrleans"
                //@"C:\Users\Edgar\Projects\Test projects\ShareX\ShareX.sln", "OnDemandAsync"
                //@"C:\Users\Edgar\Projects\Test projects\ILSpy\ILSpy.sln", "OnDemandAsync"
                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync"

                //@"C:\Users\Edgar\Source\Repos\ShareX\ShareX.sln", "OnDemandAsync", "0697738e ee540696 f6559ae2 c8dcc271 73136fbe f98307c6 6ecd7045 b3df7e49 95ff7c91 26513fa0 5c6da480 6a7e2b79 8adfe534 8b163231 265eeaad 58e9db8c"
                //@"C:\Users\Edgar\Source\Repos\ShareX\ShareX.sln", "OnDemandAsync", "0697738e 0bf1f3f8 673324e6 4e721fc8 341784cc aaace76f 538acf30 cd76008e 1a2ea5bd 1c54b0de 5c8f91f5 6d637402 40eda16a c2546a28 0fd54925 6ad97797 b1a5ac3e 22fd8840 2b864b30 408f1d2d 1e0398cc a19e6afe"


                // 100 commits OK
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 441dc0bf cb6cc4a2 a9cb5a23 136ef977 4f6e969c 18450108 1219ef78 688ea9d6 26a32d2d 691d1e36 1a9205f9 0d6af0b3 204d6c2f 635ea7a2 b4362c09 38773f06 50495242 7fc5c515 89820bad 295749d7 c2736389 10d7476a 2fc7163e b01e7aa0 80ee2742 718dd711 de66d1e9 15e06f1f 4dccf81b 6bc7e0c4 5a03cad9 e19c60f8 3c8f5a1f 2d583800 0d524dca 7b306667 4b432f17 d653c02b 23fe2271 26fbf92f 0e76707a d98060f1 bbf00ed7 f8c57a4d 522b52a8 fa85ab2f aeec1ad4 815cc3ee a600de8e 096ab1c7 1c84e730 fddd843f 6d324d3f eee34635 27398925 9a3f8725 77de435a cc6df456 0b94f69b b3640f6f 1191f1b2 6f4854b4 ec034076 da2c9844 f7eda15a 08d91a25 cb91274d 240a8ceb 46e86d91 8dbbcad2 757e4b0e 468bccbc f5175e89 8131eeb7 009ee9d2 b4abf36b b2cbc035 6dd07cb8 2f15401d 2a5370c1 48681af9 0c36f823 6ee3e305 1a9888e0 1f593181 3741435f a51cdefb 226ccd9a 3e9d67dc cadd9c7f 4ea6ce88 308e20be 2967ef26 fefca5ee e802b050 6ef221a6 ce32d0bb 1bbd68c0 a19e6afe"

                // commit 191d2946: Changing top 5 methods with max callees.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 191d2946"
                // commit 82cf2b98: Changing top 5 methods with min callees.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 82cf2b98"

                // commit 6fc2d238: Changing top 5 methods with max callers.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 6fc2d238"
                // commit 794a06ce: Changing top 5 methods with min callers.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 794a06ce"

                // commit b6015579: Changing top 5 most influential methods.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd b6015579"
                // commit 217f7eee: Changing top 5 less influential methods.
                //@"C:\Users\Edgar\Repositories\ShareX\ShareX.sln", "OnDemandAsync", "3841eacd 217f7eee"


                //@"C:\Users\Edgar\Source\Repos\ILSpy\ILSpy.sln", "OnDemandAsync", "2726336b c10251d4 6a58560b 8cd31e30 68164194 411e6fac c59ed826 50d55b9b f267a787 1d029b36 30aa3bd4 596fca2b 5b4db073 22eb1a10"
                //@"C:\Users\Edgar\Source\Repos\ILSpy\ILSpy.sln", "OnDemandAsync", "c10251d4 6a58560b 8cd31e30 68164194 411e6fac c59ed826 50d55b9b f267a787 1d029b36 30aa3bd4 596fca2b 5b4db073 22eb1a10"


                // 100 commits OK
                //@"C:\Users\Edgar\Source\Repos\ILSpy\ILSpy.sln", "OnDemandAsync", "3d1d452e 2663416f 2a6d359e ec8fc657 30528cee 907aa62c 1d92df77 22520841 6a8908aa d92ba271 1f79b77c 43a2c9d0 b6cd1f3c 23817924 421ad617 14815abd 00b01777 5b1a540d adb8a987 e6b889ac 6774b3c3 385048f3 7689e99e e9740022 4eaafc7e 12e3ac81 ab4b9492 054f6a11 0e118f09 9dec6c80 f55a9301 ce023313 d5366140 d1026c46 36d61db3 a6fc52a6 11bb3060 4a13491f c0e07679 267c69cc 0fade5cb 15b776fa 5150cdce bedff74b 20c450c0 dd485b97 dfe70d53 4eb5e826 7273fe58 b2ef367c 63666813 19c819cd 51a97862 fe1b9dce 5bbec7df d50695c2 94d1d76e 760e02a5 0366ba18 507f8455 4ac1c2d0 db24116b 85bab79e 7e52b622 4c5f3839 4fa22d6c 5e79cf22 8d2116de 0d318eef b558f0c0 5bedb80a 284ddfad 19800c3b 53b2a70a 7eb557bf f51a8b98 557c5a50 1ce8349d 840ec04f 88887b7c d8a2d41e a8cdfc3d fa2f8ec2 c590d282 f6c60a62 0524b4a3 b3590ec2 5530f7ec b254ff66 c0582cf3 fc8825d8 6702488a ed3d4aba e871f7c0 66dee6c6 6343ab7c d3904598 64bd447d d0f9b567 68164194"
                //@"C:\Users\Edgar\Source\Repos\ILSpy\ILSpy.sln", "OnDemandAsync", "dde96674 92e8deaf a813dddc 3a89500e 2d26c776 ae75c57e 40819d2b fc45d476 c0effc81 40aaabe4 e921239b ddb6f969 d87a9bf1 ae7dd7c4 a674b4cd ae6c42c9 de6c39c0 2a5546c4 f116d508 51e4577c 2786ce7a bc7032a8 24dfd88b 3d1d452e 2663416f 2a6d359e ec8fc657 30528cee 907aa62c 1d92df77 22520841 6a8908aa d92ba271 1f79b77c 43a2c9d0 b6cd1f3c 23817924 421ad617 14815abd 00b01777 5b1a540d adb8a987 e6b889ac 6774b3c3 385048f3 7689e99e e9740022 4eaafc7e 12e3ac81 ab4b9492 054f6a11 0e118f09 9dec6c80 f55a9301 ce023313 d5366140 d1026c46 36d61db3 a6fc52a6 11bb3060 4a13491f c0e07679 267c69cc 0fade5cb 15b776fa 5150cdce bedff74b 20c450c0 dd485b97 dfe70d53 4eb5e826 7273fe58 b2ef367c 63666813 19c819cd 51a97862 fe1b9dce 5bbec7df d50695c2 94d1d76e 760e02a5 0366ba18 507f8455 4ac1c2d0 db24116b 85bab79e 7e52b622 4c5f3839 4fa22d6c 5e79cf22 8d2116de 0d318eef b558f0c0 5bedb80a 284ddfad 19800c3b 53b2a70a 7eb557bf f51a8b98 557c5a50"
                //@"C:\Users\Edgar\Repositories\ILSpy\ILSpy.sln", "OnDemandAsync", "ea98d8bd 48529053 c4092ac9 cd8c4e03 755fdee3 dde96674 92e8deaf a813dddc 3a89500e 2d26c776 ae75c57e 40819d2b fc45d476 c0effc81 40aaabe4 e921239b ddb6f969 d87a9bf1 ae7dd7c4 a674b4cd ae6c42c9 de6c39c0 2a5546c4 f116d508 51e4577c 2786ce7a bc7032a8 24dfd88b 3d1d452e 2663416f 2a6d359e ec8fc657 30528cee 907aa62c 1d92df77 22520841 6a8908aa d92ba271 1f79b77c 43a2c9d0 b6cd1f3c 23817924 421ad617 14815abd 00b01777 5b1a540d adb8a987 e6b889ac 6774b3c3 385048f3 7689e99e e9740022 4eaafc7e 12e3ac81 ab4b9492 054f6a11 0e118f09 9dec6c80 f55a9301 ce023313 d5366140 d1026c46 36d61db3 a6fc52a6 11bb3060 4a13491f c0e07679 267c69cc 0fade5cb 15b776fa 5150cdce bedff74b 20c450c0 dd485b97 dfe70d53 4eb5e826 7273fe58 b2ef367c 63666813 19c819cd 51a97862 fe1b9dce 5bbec7df d50695c2 94d1d76e 760e02a5 0366ba18 507f8455 4ac1c2d0 db24116b 85bab79e 7e52b622 4c5f3839 4fa22d6c 5e79cf22 8d2116de 0d318eef b558f0c0 5bedb80a 284ddfad"

                // commit 6af87cb5: Changing top 5 most influential methods.
                //@"C:\Users\Edgar\Repositories\ILSpy\ILSpy.sln", "OnDemandAsync", "ea98d8bd 6af87cb5"
                // commit 121406e1: Changing top 5 less influential methods.
                //@"C:\Users\Edgar\Repositories\ILSpy\ILSpy.sln", "OnDemandAsync", "ea98d8bd 121406e1"


                //@"C:\Users\Edgar\Repositories\Newtonsoft.Json\Src\Newtonsoft.Json.sln", "OnDemandAsync", "1a67b34d"

                //@"C:\Users\Edgar\Repositories\BenchmarkDotNet\BenchmarkDotNet.sln", "OnDemandAsync", "b4d68e93"

                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync", "4485b9b4"

                // 100 commits OK
                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync", "3f2656b6b 4255c69ab 3f92c7ebd bd1cfc24d 572f0bab7 765616a5b bc64d6be2 7e29780d2 708fb9202 9a0ebce33 3a1ce9111 1d57a6571 15fff78a7 d379b3701 b6f9c7ff5 03923b48d 5c1f6698a 55b0fde69 2ae86b83d 1e8e4b27f fdb8e8800 97a1cc774 95293243a 2fab2385f c3c665440 028010407 83140bd9e e523a2c0e a7d4aa05c 5d59da9ca 842678b1f 3c585e74a 361af2b6c 4da3ac532 98534cd7c 04199a4a4 4c05d4df3 709f18a27 25f5fe314 dd85df91b f54b25574 ada39c069 d7f2d2703 2c25a0ee4 f5a1824b0 9f7ddaa1f ff61ac81b c5fe01b06 269c919a4 fecca97d6 ebef27c14 c249497bc 6426d3956 784aeff82 e97364244 9c2229111 b3d641d7e 8a3589d13 f31049de1 893a2262a b83dda628 b2c97d4f4 ce2878326 cba5a0ff8 0db082fc8 f3bbb7dba 4b9699161 dc0ba3987 f3c185b8f ddf6bb097 8f841a098 b6f5de335 507dd0238 3349423f5 b5eeca6c4 563d13524 b98745aa8 15c88e6c3 feb5369a2 a543a174b 1535bf5a4 0e70b9726 0556b08cf 3730a9a17 eadcdf26e cc9860c9b 9e7bce83e 4edfa6a20 01f2ffec8 13f9592e3 ee3e6406e 6586a2bcf 50abf1336 7fec93d44 39fa88e92 7fca2c3ec 85e850219 f87828c89 3c97568a8 4485b9b42"
                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync", "4a788ac83 85728e1dd 778996829 157095e62 a59a8b3d2 5f2924a27 cbd9c6de0 898f8899d 19db6a3e1 bfe98f08d 0595e8f01 0605f860d 1641ac1e6 3eb1938b9 acb6c53cc 77ee67436 885844e50 98c119a60 57e1fdc88 4270571bc 657c1b8fd 211ba0d82 b30b85736 673459434 284c48881 5599724e1 678d1c74a 21093caa9 5e74fb077 81040fd7b 5dc79acb1 5476ccffe bc1b9baa2 4f5f9a5b6 9f124a3bf b6dbc516f 11ea787d6 8d5cedc8c 4b8dd405a f91e06c45 a5ce1387f 56d97ab51 f2674a664 8d4d9a369 61ea79912 c200843f0 057008923 0e1387b36 108b4494e 701607f83 f9a288629 62647dc72 4e22d6ee9 5c9d426ff 1e6749497 4909ad037 cef53951d 1c7b9410e 80e9e9173 5ce4649d2 1f870bf0d 5c624bca2 11c238239 38f0e664d 74dafb406 ac71d7fe0 69044eaab 4d2f8d7de 93edfa5be 8d44f810c c3eff3585 8da5fe309 5c74dc57c 4b17c277f 50c3fc75a d7ee923f8 8d0528c9f e1653a22e 0873534a4 0716fc9cf bd1cfc24d 7e29780d2 fdb8e8800 97a1cc774 83140bd9e e523a2c0e 842678b1f 25f5fe314 dd85df91b 4b9699161 feb5369a2 a543a174b 3730a9a17 9e7bce83e 01f2ffec8 ee3e6406e 6586a2bcf 85e850219 f87828c89 4485b9b42"

                // commit 17b0fc71: Changing top 5 most influential methods.
                //@"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync", "4a788ac83 17b0fc71"
                // commit 16b66f72: Changing top 5 less influential methods.
                @"C:\azure-powershell\src\ResourceManager.ForRefactoringOnly.sln", "OnDemandAsync", "4a788ac83 16b66f72"
            };

            //// This is to compute solution statistics
            //OrleansClient.Statistics.SolutionStats.ComputeSolutionStats(args[0]);
            //Console.WriteLine("Done!");
            //Console.ReadKey();
            //return;

            if (args.Length >= 2)
            {
                try
                {
                    var solutionPath = args[0];
                    var strategyName = args[1];
                    var commitList   = args[2];
                    var outputPath   = Path.ChangeExtension(solutionPath, ".dgml");
                    var strategyKind = SolutionAnalyzer.StringToAnalysisStrategy(strategyName);
                    var commits      = commitList.Split(' ');
                    var program      = new Program(strategyKind);

                    program.Initialize();
                    //var callGraph = program.BuildCallGraph(solutionPath);
                    //program.RunAnalysis(solutionPath);
                    //program.RunAnalysis(solutionPath, commits);
                    program.RunIncrementalAnalysis(solutionPath, commits);
                    program.Cleanup();

                    //callGraph.Save(outputPath);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine(ex);
                }
            }

            System.Console.WriteLine("Done!");
            System.Console.ReadKey();
        }