Skip to content
Novus Examples
xml12.8 KB

Coverage — Cobertura at Zero Coverage

A structurally complete Cobertura report in which line-rate and branch-rate are 0.0 everywhere. The counterpart to the zero-coverage LCOV file, for checking that a converter keeps the class and method structure when there is nothing covered to describe.

Preview — first 50 linesxml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="0.0000" branch-rate="0.0000" lines-covered="0" lines-valid="140" branches-covered="0" branches-valid="24" complexity="32" version="2.1.1" timestamp="1786000462">
  <sources>
    <source>src</source>
  </sources>
  <packages>
    <package name="cart" line-rate="0.0000" branch-rate="0.0000" complexity="11">
      <classes>
        <class name="pricing" filename="src/cart/pricing.js" line-rate="0.0000" branch-rate="0.0000" complexity="6">
          <methods>
            <method name="unitPrice" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="2" hits="0"/></lines>
            </method>
            <method name="quantityMultiplier" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="8" hits="0"/></lines>
            </method>
            <method name="roundHalfUp" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="13" hits="0"/></lines>
            </method>
            <method name="applyTax" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="19" hits="0"/></lines>
            </method>
            <method name="bulkRate" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="25" hits="0"/></lines>
            </method>
            <method name="convertCurrency" signature="()V" line-rate="0.0" branch-rate="1.0">
              <lines><line number="31" hits="0"/></lines>
            </method>
          </methods>
          <lines>
            <line number="2" hits="0" branch="false"/>
            <line number="3" hits="0" branch="false"/>
            <line number="4" hits="0" branch="false"/>
            <line number="5" hits="0" branch="true" condition-coverage="0% (0/2)"/>
            <line number="6" hits="0" branch="false"/>
            <line number="8" hits="0" branch="false"/>
            <line number="9" hits="0" branch="false"/>
            <line number="10" hits="0" branch="false"/>
            <line number="11" hits="0" branch="false"/>
            <line number="12" hits="0" branch="false"/>
            <line number="13" hits="0" branch="false"/>
            <line number="15" hits="0" branch="true" condition-coverage="0% (0/2)"/>
            <line number="16" hits="0" branch="false"/>
            <line number="17" hits="0" branch="false"/>
            <line number="18" hits="0" branch="false"/>
            <line number="19" hits="0" branch="false"/>
            <line number="20" hits="0" branch="false"/>
            <line number="22" hits="0" branch="false"/>
            <line number="23" hits="0" branch="false"/>
242 lines total — download for the full file.

Specifications

Seed
61200
Format
Cobertura XML
Lines Found
140
Lines Hit
0
Line Rate
0
Branch Rate
0
Packages
2
Line Endings
LF

Testing contract

Expected to pass
Scenario
Convert a zero-coverage Cobertura report without losing its structure.
Expected result
All four classes and their methods survive the conversion, with line-rate 0.0 rather than an omitted or absent value.

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

How to use this file for testing

“Coverage — Cobertura at Zero Coverage” is a deterministic Novus Examples fixture for Conversion testing, Code parsing, Schema validation. The same content exported across many formats and linked as a group, so you can convert one and diff against the expected twin.

Documented properties for this file: seed 61200 · LF · Cobertura XML. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("cobertura-zero-coverage.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

Generated by generation/testing.py. Free for any use, no attribution required — license.