Esempio n. 1
0
        /// <summary>
        /// Creates an article with informations about the implemented model elements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateReqRelatedArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Model coverage");

            HashSet <ReqRelated> implementedReqRelated = aReportConfig.Dictionary.ImplementedReqRelated;
            HashSet <ReqRelated> implementedRules      = new HashSet <ReqRelated>();
            HashSet <ReqRelated> implementedTypes      = new HashSet <ReqRelated>();
            HashSet <ReqRelated> implementedVariables  = new HashSet <ReqRelated>();

            ICollection <DataDictionary.Specification.Paragraph> applicableParagraphs = aReportConfig.Dictionary.Specifications.ApplicableParagraphs;
            HashSet <DataDictionary.Specification.Paragraph>     modeledParagraphs    = new HashSet <DataDictionary.Specification.Paragraph>();

            foreach (ReqRelated reqRelated in implementedReqRelated)
            {
                if (reqRelated is Rule)
                {
                    implementedRules.Add(reqRelated);
                }
                else if (reqRelated is DataDictionary.Types.Type)
                {
                    implementedTypes.Add(reqRelated);
                }
                else if (reqRelated is Variable)
                {
                    implementedVariables.Add(reqRelated);
                }
                modeledParagraphs.UnionWith(reqRelated.ModeledParagraphs);
            }
            double modeledPercentage = ((double)modeledParagraphs.Count / (double)applicableParagraphs.Count) * 100;

            AddTable(new string[] { "Statistics" }, new int[] { 70, 70 });
            AddRow("Number of implemented model elements", implementedReqRelated.Count.ToString());
            AddRow("Number of modeled paragraphs", String.Format("{0} of {1} ({2:0.##}%)", modeledParagraphs.Count, applicableParagraphs.Count, modeledPercentage));

            if (implementedRules.Count > 0)
            {
                /* This section will contain the list of implemented rules and possibly
                 * the list of paragraphs modeled by each rule */
                AddSubParagraph("Implemented rules");
                CreateReqRelatedTable("Implemented rules", implementedRules, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            if (implementedTypes.Count > 0)
            {
                /* This section will contain the list of implemented types and possibly
                 * the list of paragraphs modeled by each type */
                AddSubParagraph("Implemented types");
                CreateReqRelatedTable("Implemented types", implementedTypes, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            if (implementedVariables.Count > 0)
            {
                /* This section will contain the list of implemented variables and possibly
                 * the list of paragraphs modeled by each variable */
                AddSubParagraph("Implemented variables");
                CreateReqRelatedTable("Implemented variables", implementedVariables, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
Esempio n. 2
0
        /// <summary>
        ///     Creates an article with informations about all the paragraphs of the specification
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateSpecificationArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Specification coverage");
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, true);

            if (aReportConfig.ShowFullSpecification)
            {
                AddSubParagraph("Coverage detail");
                CreateSpecificationTable(aReportConfig.Dictionary);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates an article with informations about the covered requirements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateCoveredRequirementsArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Covered requirements");
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, false);

            HashSet <DataDictionary.Specification.Paragraph> coveredParagraphs = CoveredRequirements(aReportConfig.Dictionary, true);

            if (coveredParagraphs.Count > 0) /* If we have some covered paragraphs, we create a section with informations about it */
            {
                AddSubParagraph("Coverage detail");
                CreateImplementedParagraphsTable(coveredParagraphs, aReportConfig.Dictionary);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
Esempio n. 4
0
        /// <summary>
        /// Creates an article with informations about the non covered requirements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateNonCoveredRequirementsArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Non covered requirements");
            GenerateStatistics(aReportConfig.Dictionary, false, true, true, false);

            HashSet <DataDictionary.Specification.Paragraph> nonCoveredParagraphs = CoveredRequirements(aReportConfig.Dictionary, false);

            if (nonCoveredParagraphs.Count > 0) /* If we have some non covered paragraphs, we create a section containing the list of these paragraphs */
            {
                foreach (DataDictionary.Specification.Paragraph paragraph in nonCoveredParagraphs)
                {
                    AddSubParagraph("Requirement " + paragraph.FullId);
                    AddTable(new string[] { "Requirement " + paragraph.FullId }, new int[] { 100 });
                    AddRow(paragraph.Text);
                    CloseSubParagraph();
                }
            }
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates an article with informations about all the paragraphs of the specification
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateSpecificationArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Specification coverage");
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, true);

            if (aReportConfig.ShowFullSpecification)
            {
                AddSubParagraph("Coverage detail");
                CreateSpecificationTable(aReportConfig.Dictionary);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates an article with informations about the implemented model elements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateReqRelatedArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Model coverage");

            HashSet<ReqRelated> implementedReqRelated = aReportConfig.Dictionary.ImplementedReqRelated;
            HashSet<ReqRelated> implementedRules = new HashSet<ReqRelated>();
            HashSet<ReqRelated> implementedTypes = new HashSet<ReqRelated>();
            HashSet<ReqRelated> implementedVariables = new HashSet<ReqRelated>();

            ICollection<DataDictionary.Specification.Paragraph> applicableParagraphs = aReportConfig.Dictionary.Specifications.ApplicableParagraphs;
            HashSet<DataDictionary.Specification.Paragraph> modeledParagraphs = new HashSet<DataDictionary.Specification.Paragraph>();
            foreach (ReqRelated reqRelated in implementedReqRelated)
            {
                if (reqRelated is Rule)
                {
                    implementedRules.Add(reqRelated);
                }
                else if (reqRelated is DataDictionary.Types.Type)
                {
                    implementedTypes.Add(reqRelated);
                }
                else if (reqRelated is Variable)
                {
                    implementedVariables.Add(reqRelated);
                }
                modeledParagraphs.UnionWith(reqRelated.ModeledParagraphs);
            }
            double modeledPercentage = ((double)modeledParagraphs.Count / (double)applicableParagraphs.Count) * 100;

            AddTable(new string[] { "Statistics" }, new int[] { 70, 70 });
            AddRow("Number of implemented model elements", implementedReqRelated.Count.ToString());
            AddRow("Number of modeled paragraphs", String.Format("{0} of {1} ({2:0.##}%)", modeledParagraphs.Count, applicableParagraphs.Count, modeledPercentage));

            if (implementedRules.Count > 0)
            {
                /* This section will contain the list of implemented rules and possibly
                 * the list of paragraphs modeled by each rule */
                AddSubParagraph("Implemented rules");
                CreateReqRelatedTable("Implemented rules", implementedRules, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            if (implementedTypes.Count > 0)
            {
                /* This section will contain the list of implemented types and possibly
                 * the list of paragraphs modeled by each type */
                AddSubParagraph("Implemented types");
                CreateReqRelatedTable("Implemented types", implementedTypes, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            if (implementedVariables.Count > 0)
            {
                /* This section will contain the list of implemented variables and possibly
                 * the list of paragraphs modeled by each variable */
                AddSubParagraph("Implemented variables");
                CreateReqRelatedTable("Implemented variables", implementedVariables, aReportConfig.ShowAssociatedParagraphs);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates an article with informations about the non covered requirements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateNonCoveredRequirementsArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Non covered requirements");
            GenerateStatistics(aReportConfig.Dictionary, false, true, true, false);

            HashSet<DataDictionary.Specification.Paragraph> nonCoveredParagraphs = CoveredRequirements(aReportConfig.Dictionary, false);
            if (nonCoveredParagraphs.Count > 0) /* If we have some non covered paragraphs, we create a section containing the list of these paragraphs */
            {
                foreach (DataDictionary.Specification.Paragraph paragraph in nonCoveredParagraphs)
                {
                    AddSubParagraph("Requirement " + paragraph.FullId);
                    AddTable(new string[] { "Requirement " + paragraph.FullId }, new int[] { 100 });
                    AddRow(paragraph.Text);
                    CloseSubParagraph();
                }
            }
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates an article with informations about the covered requirements
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateCoveredRequirementsArticle(SpecCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Covered requirements");
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, false);

            HashSet<DataDictionary.Specification.Paragraph> coveredParagraphs = CoveredRequirements(aReportConfig.Dictionary, true);
            if (coveredParagraphs.Count > 0) /* If we have some covered paragraphs, we create a section with informations about it */
            {
                AddSubParagraph("Coverage detail");
                CreateImplementedParagraphsTable(coveredParagraphs, aReportConfig.Dictionary);
                CloseSubParagraph();
            }
            CloseSubParagraph();
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dictionary"></param>
 public SpecReport(Dictionary dictionary)
 {
     InitializeComponent();
     reportHandler = new SpecCoverageReportHandler(dictionary);
     TxtB_Path.Text = reportHandler.FileName;
 }