Skip to content
Novus Examples
csv337 B

Coverage — Per-File Table (CSV)

The same coverage as a flat table with a TOTAL row, for spreadsheets, trend charts and diffing two runs without an XML parser. The TOTAL row is the arithmetic sum of the four file rows, so it doubles as a checksum on any tool that regenerates it. Every file in this group describes the same four-file source tree and reports 127/140 lines, 17/24 branch outcomes and 18/20 functions, so a converter can be diffed against a known answer.

Preview — first 7 linescsv
file,lines_found,lines_hit,line_pct,functions_found,functions_hit,branches_found,branches_hit,branch_pct
src/cart/pricing.js,44,40,90.91,6,5,8,6,75.00
src/cart/discounts.js,33,28,84.85,5,4,6,4,66.67
src/checkout/session.js,39,36,92.31,6,6,6,4,66.67
src/checkout/receipt.js,24,23,95.83,3,3,4,3,75.00
TOTAL,140,127,90.71,20,18,24,17,70.83

Specifications

Seed
61200
Source Files
4
Lines Found
140
Lines Hit
127
Line Pct
90.71
Branches Found
24
Branches Hit
17
Branch Pct
70.83
Functions Found
20
Functions Hit
18
Line Endings
LF
Format
CSV
Rows
5
Columns
9
Delimiter
,
Header
true
Has Total Row
true

Testing contract

Expected to pass
Scenario
Recompute overall coverage from a per-file CSV and check the TOTAL row.
Expected result
Summing lines_hit over the four file rows gives 127, equal to the TOTAL row.

What is a .csv file?

CSV (Comma-Separated Values) is a plain-text tabular format where rows are lines and fields are separated by commas, with quoting rules for values that contain delimiters, quotes, or newlines. It has no formal type system and depends on encoding and dialect conventions. It is the most portable format for tabular data exchange.

How to use this file

Use an example CSV to test parsers against quoting and embedded-delimiter edge cases, header handling, encoding detection, and import pipelines into databases or spreadsheets.

How to use this file for testing

“Coverage — Per-File Table (CSV)” is a deterministic Novus Examples fixture for CSV parsing, Conversion testing, Data import. Clean and deliberately messy CSVs — quoted commas, embedded newlines, ragged rows, odd delimiters, and encodings.

Documented properties for this file: seed 61200 · 5 rows · 9 columns · LF. 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.

Feed the file to your parser and assert it handles the documented quirks — quoted delimiters, embedded newlines, ragged rows, or invalid syntax; the valid↔invalid distinction is labelled in the title.

Code examples

import pandas as pd

df = pd.read_csv("coverage-by-file.csv")
print(df.head())
print(df.dtypes)

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