QA Interview Hub · Knowledge base · Quizzes · Українська

QA Fundamentals › Situational questions

How would you test exporting a statement to PDF or CSV?

An export is checked from the source of truth, not from the file. A control query with half-open period bounds gives the row count and total that must match the file. Time zones, statuses, rounding and format are checked separately: delimiters in different locales, UTF-8 and BOM, escaping. For security, check CSV injection in text fields and that only the account owner can access the file.

QA Fundamentals · Situational questions

The statement file downloaded and opens. How do you prove it is correct?

A user clicks "Download the October statement" and gets a CSV. The file opens, the columns are in place, and it is easy to write "export works". But the total in the statement is off, because an operation on October 31 at 23:50 landed in November because of the time zone. Or Cyrillic turned into garbage. Or a payment description field started to run as a formula in Excel. This lesson is about checking an export as a separate view of the same data, not as "a button that downloads".

How it works and why. An export is a chain: the source of truth (the database, the ledger of operations) → a selection by parameters → formatting of values → a file → delivery to the user. A defect may appear at any step, and it will not visibly break the file. So the check is built not from the file but from the source: what must be in the file for these parameters, and is it so.

Four export stages and typical breakages

1 · Selectionperiod bounds, time zone, operation statuses2 · Formattingrounding, separators, date format3 · Fileencoding, quotes, line breaks, formulas4 · Deliveryaccess, size, generation time, link expiry
Figure 1. An export as a pipeline. Each stage is checked separately, because a defect at an early stage passes on unnoticed.

Example: reconciling the file with the source. First compute the expectation from the source (a control query to a database QA is allowed to read), then compare it with the file:

SELECT COUNT(*) AS n, SUM(amount) AS total
FROM transactions
WHERE account_id = 4711
  AND booked_at >= '2026-10-01'
  AND booked_at <  '2026-11-01';

The number of rows without the header and the sum of the amount column in the file must match the query result. The bounds in the query are half-open (from the first day inclusive, to the first day of the next month exclusive), and this is where errors are caught: operations at 00:00:00 and 23:59:59, and the difference between the user's time zone and UTC. Now a file worth looking at with a pencil:

date;description;amount;currency
2026-10-31;Coffee, "Mriya";-125,50;UAH
2026-11-01;=HYPERLINK("http://x.test","Bonus");300,00;UAH
2026-11-01;Transfer from Olena;1 000,00;UAH

What to check here. The delimiter and the decimal mark: Excel in different locales reads a semicolon and a comma differently, and a file that looks fine in one locale glues columns together in another. The field "Coffee, "Mriya"" contains a comma and quotes, so it must be in quotes with the inner quotes doubled, otherwise the columns shift. Cyrillic: when opened by double-click, Excel often recognises UTF-8 only with a byte order mark (BOM), so its presence or absence is fixed in the requirements and checked. The second row with "=HYPERLINK(…)" is CSV injection: the payment description is controlled by the sender, and if Excel runs it as a formula, the user gets a link or a data leak. Text fields that start with =, +, -, @, a tab or a line break are escaped (for example with an apostrophe prefix), while amounts that naturally start with a minus are not.

A PDF has other risks: layout and page breaks (a row is not split, the table header repeats, the total is on the last page), the font supports Cyrillic, the card number is masked, the generation date and time zone are shown, and the total matches the sum of the rows.

Limits and alternatives. Large periods cannot be generated within the user's request: it takes minutes, so the export is made asynchronously and the user gets a notification with a link. Then you check the statuses (queued, ready, failed), the link expiry, access only for the account owner (the link must not open for another user) and the behaviour on interruption. A control query to the database is an auxiliary tool: it checks the data, but not what the UI shows. So the file is also compared with the history screen. If the statement has legal status, its format (fields, signatures) is set by a requirement or regulation, and QA checks against that, not against its own idea.

Common mistakes.

  • Checking only that the file downloads and opens: all data defects remain.
  • Comparing a few rows "by eye" without a total: a missing or extra row goes unnoticed.
  • Testing only on five operations: limits on size and time show up at thousands.
  • Ignoring the time zone and the period bounds.
  • Opening the file in only one Excel locale: in another the columns glue together or Cyrillic breaks.
  • Not checking CSV injection and access to the file by link.

Check yourself

The app shows 118 operations for October, and the exported CSV has 117 rows without the header. Name three places to look for the cause.

Answer

The period bounds and the time zone: an operation near midnight could land in the neighbouring month. The statuses: the app may show operations in processing or cancelled ones that are not exported (or the other way round). The escaping: a field with a line break or quotes could break the row parsing in the CSV. First compare the control query result with both versions.

Why should you not escape with an apostrophe a value starting with a minus in the amount column?

Answer

Because the amount -125,50 is a number, and the prefix turns it into text: Excel will not sum such values, and other systems that read the file get a string instead of a number. Text fields controlled by the user or the counterparty are escaped, and numeric columns are formatted as numbers.

In an interview. Junior: I check that the data in the statement matches the history and the totals add up, the period bounds, the file format (Cyrillic, delimiters), the PDF layout, large volumes and access only to one's own accounts. Middle/Senior: I build the check from the source of truth: with a control query with half-open bounds I count the rows and the sum and compare them with the file, and separately check time zones, statuses and rounding. Format: escaping, UTF-8 and BOM, delimiters in different locales. Security: access to the file by link, card masking and CSV injection in text fields, while amounts are not escaped. For large periods I check asynchronous generation, statuses and link expiry.

More articles in this chapter