Ejemplo n.º 1
0
  private void doCoverage(Element element, Wrapper wrapper) {
    int totalCoveredNodesei = wrapper.getCoveredRequirements(RequirementType.NODE).size();
    int totalCoveredEdgesei = wrapper.getCoveredRequirements(RequirementType.EDGE).size();
    int totalCoveredUsesei = wrapper.getCoveredRequirements(RequirementType.DUA).size();

    int totalCheckedNodesei = wrapper.getRequirements(RequirementType.NODE).size();
    int totalCheckedEdgesei = wrapper.getRequirements(RequirementType.EDGE).size();
    int totalCheckedUsesei = wrapper.getRequirements(RequirementType.DUA).size();

    float allNodesei =
        totalCheckedNodesei > 0 ? (float) totalCoveredNodesei / totalCheckedNodesei : 0.0f;
    float allEdgesei =
        totalCheckedEdgesei > 0 ? (float) totalCoveredEdgesei / totalCheckedEdgesei : 0.0f;
    float allUsesei =
        totalCheckedUsesei > 0 ? (float) totalCoveredUsesei / totalCheckedUsesei : 0.0f;

    doTypeCoverage(element, "All-Nodes-ei", totalCoveredNodesei, allNodesei, totalCheckedNodesei);
    doTypeCoverage(element, "All-Nodes-ed", 0, 0.0f, 0);
    doTypeCoverage(element, "All-Edges-ei", totalCoveredEdgesei, allEdgesei, totalCheckedEdgesei);
    doTypeCoverage(element, "All-Edges-ed", 0, 0.0f, 0);
    doTypeCoverage(element, "All-Uses-ei", totalCoveredUsesei, allUsesei, totalCheckedUsesei);
    doTypeCoverage(element, "All-Uses-ed", 0, 0.0f, 0);
    doTypeCoverage(element, "All-Pot-Uses-ei", 0, 0.0f, 0);
    doTypeCoverage(element, "All-Pot-Uses-ed", 0, 0.0f, 0);
  }
Ejemplo n.º 2
0
 private void doRequirements(Element element, Wrapper wrapper) {
   doTypeRequirements(
       element,
       "All-Nodes-ei",
       wrapper.getCoveredRequirements(RequirementType.NODE),
       wrapper.getUncoveredRequirements(RequirementType.NODE));
   doTypeRequirements(
       element,
       "All-Edges-ei",
       wrapper.getCoveredRequirements(RequirementType.EDGE),
       wrapper.getUncoveredRequirements(RequirementType.EDGE));
   doTypeRequirements(
       element,
       "All-Uses-ei",
       wrapper.getCoveredRequirements(RequirementType.DUA),
       wrapper.getUncoveredRequirements(RequirementType.DUA));
 }