~/qa-guides

~/qa-guides/csv-import-testing-checklist

>_ CSV Import Testing Checklist: Examples and Test Cases

A detailed CSV import checklist with a ten-row dataset, reconciled create and update counts, and 15 test cases covering parsing, duplicates, failures, and retries.

CSV importData validationData integrityTest cases

Published

Short answer

A CSV import testing checklist verifies how a file becomes application data: decoding, parsing, column mapping, row validation, duplicate handling, writes, and result reporting. It checks both the reported outcome and the records actually created, updated, or preserved.

Start with a known target dataset and CSV fixtures whose expected effects can be calculated independently. After import, reconcile every logical data record with its outcome and inspect the affected values, identifiers, and ownership. A successful file transfer or a completed job status does not establish that the imported data is correct.

This guide provides an explicit example contract, a ten-row dataset, a full checklist, and 15 worked CSV import test cases. Its rules illustrate one product design; replace them with the real import contract before assigning pass or fail.

Define the import contract before choosing fixtures

File format, mapping, and field rules

The worked examples import product records into one account. They accept UTF-8, an optional UTF-8 byte-order mark at the beginning, comma separators, double-quoted fields, and LF or CRLF record endings. Doubled double quotes represent a quote inside a quoted field. Other encodings and delimiters are rejected rather than guessed.

There is one header record. Source headers are trimmed of surrounding ASCII spaces and must be unique afterwards. A confirmed mapping must assign each required target field exactly once. Additional source columns require an explicit Ignore choice; optional target fields may be omitted.

The six target fields are:

  • external_id: Required text. Trim surrounding ASCII spaces, preserve leading zeros, and match keys case-sensitively within the current account.
  • name: Required text that remains nonempty after trimming surrounding ASCII spaces; preserve internal punctuation and spaces.
  • quantity: Required nonnegative integer written with ASCII decimal digits; negative values, fractions, and scientific notation are rejected.
  • unit_price: Required nonnegative decimal using a period, no grouping separators, and at most two fractional digits; store it with two decimal places.
  • start_date: Optional calendar date in YYYY-MM-DD form; a present empty cell means null. It is a date, not an instant to convert between time zones.
  • notes: Optional text preserved as supplied, including quoted commas, quotes, and line feeds; a present empty cell means an empty string.

For an omitted optional column, creation uses null for start_date and an empty string for notes; updating preserves the existing field. A literal NULL has no special meaning: it is ordinary text in notes and invalid date input in start_date.

Blank physical lines outside quoted records are ignored. A record such as ,,,,, is still a data record and fails required-field validation. Every data record must have the same number of cells as its source header; a wrong cell count or malformed quoting is a file-wide structural error. The limit is 1,000 logical data records, excluding the header and ignored blank lines.

Duplicate, mode, and commit rules

For this example, the first occurrence of each nonempty normalized external_id claims that key for the job. Later occurrences are rejected as in-file duplicates even if the first occurrence fails another validation. Empty identifiers fail required-field validation rather than claiming a shared empty key.

Validate rows before applying the selected matching mode:

  • Create only: Create valid keys absent from the target; skip valid existing keys with an Already exists reason.
  • Update only: Update valid existing keys; skip valid absent keys with a Not found reason.
  • Upsert: Update valid existing keys and create valid absent keys.

An applied existing row counts as updated even when its mapped values equal the current values. This metric counts successful applications to existing records, not only value differences.

Partial mode applies eligible rows independently. All-or-nothing mode applies none if any row is rejected. File-wide parsing, mapping, or limit failures block all target writes before either mode starts applying rows.

Preview changes no target data. Confirmation binds the source version, mapping, selected modes, and expected target matches and revisions. A target conflict must be reported; an expected creation must not silently turn into an update because another user created the key after preview.

Retrying confirmation of the same job with the same operation identity replays its result without applying rows again. Starting a new job is a new import. These are example policies, not guarantees provided by CSV itself.

Keep transport and record processing separate

The File Upload Testing Checklist covers transfer, processing, attachment, access, and cleanup of uploaded files. Here the object under test is the import's interpretation and effect on application records.

The W3C tabular data model, particularly its CSV and parsing sections, describes format variations and configurable parsing behavior. It does not define your application's matching key, update policy, or transaction boundary. Test those as explicit business rules.

Worked example: Ten CSV rows and three existing records

Establish the initial target data

Use an isolated account containing exactly these three products, each at revision 1. The fields below follow the order external_id, name, quantity, unit_price, start_date, notes:

  • Existing 0007: 0007,Old Atlas,5,10.00,2026-10-01,original.
  • Existing A200: A200,Keep Pine,2,4.50,2026-10-15,remove me.
  • Existing Z900: Z900,Unaffected,9,1.00,2026-09-01,untouched.

Capture these values before each independent execution. Count records in this account without a UI filter or pagination hiding part of the result.

Prepare the source file

Use this header: external_id, name, quantity, unit_price, start_date, notes. The declared header-trimming rule removes the surrounding spaces.

Each inline record below is one complete CSV data record, excluding the R label and the final punctuation outside the code. Place the header first and join the records with the configured record ending. Preserve the quotes on R8 and R9.

  • R1: 0007,Atlas,6,12.50,2026-12-01,Updated.
  • R2: B300,Blue Dock,3,4.25,2026-12-02,new.
  • R3: B300,Blue Duplicate,4,4.25,2026-12-02,duplicate.
  • R4: C400,,1,9.00,,missing name.
  • R5: D500,Delta,-1,2.00,,negative quantity.
  • R6: A200,Pine Revised,2,4.75,,.
  • R7: E600,Elm,0,0.00,,.
  • R8: 0008,Leading Zero,1,1.20,2026-12-03,"note, retained".
  • R9: F700,Foxtrot,2,"1,25",2026-12-04,bad price.
  • R10: G800,Grove,7,3.10,2026-02-30,bad date.

R9 is structurally valid CSV: the comma is inside a quoted cell. Its price fails the example's decimal rule. R10 has a correctly shaped date string that is not an actual calendar date. These fixtures separate parsing, format validation, and business validation.

Derive the expected partial-upsert result

With Upsert and partial mode, classify the rows independently:

  • Updated: R1 changes 0007; R6 changes A200 and clears its present empty optional fields.
  • Created: R2 creates B300, R7 creates E600, and R8 creates the text key 0008.
  • Rejected: R3 duplicates B300, R4 lacks a name, R5 has a negative quantity, R9 has an invalid price, and R10 has an impossible date.
  • Skipped: None; all five otherwise valid rows are eligible under Upsert.

The result is ten data records, three created, two updated, zero skipped, five rejected, and zero not applied. The target grows from three to six records. Z900 remains unchanged, and no records with keys C400, D500, F700, or G800 are created.

Inspect values as well as counts. 0007 must have quantity 6 and price 12.50. A200 must have name Pine Revised, price 4.75, null start_date, and empty notes. B300 must contain R2's data, not R3's later duplicate. The key 0008 must retain both leading zeros.

Reconcile source rows and target changes separately

For jobs with a reliable data-record count and completed row classification, use this ledger:

data records = created + updated + skipped + rejected + not_applied

Not_applied means a row that did not receive another final outcome because the selected commit policy, cancellation, or an operation failure prevented its application. In an atomic validation failure, eligible rows belong here; they did not become successful creations or updates.

For the example's all-or-nothing Upsert, preview may predict three creations and two updates, but the final result is zero created, zero updated, zero skipped, five rejected, and five not applied. The target still contains its original three records with their original values.

Target count is a different equation: initial records plus creations minus deletions. This importer does not delete records, so updates do not increase that count. File-level failures that prevent reliable parsing must report a file error rather than invent a complete row ledger.

Quick CSV import testing checklist

  • Import a known valid fixture and inspect the saved records through an independent read.
  • Verify encoding, delimiter, quoting, and logical-record boundaries against the supported dialect.
  • Confirm required mappings and reject ambiguous duplicate headers.
  • Preserve text identifiers, including leading zeros, through matching and error reporting.
  • Check required values, empty cells, omitted optional columns, and declared defaults separately.
  • Exercise in-file duplicates and existing-target matches as different conditions.
  • Run Create only, Update only, and Upsert with calculated expected outcomes.
  • Verify that preview creates or updates no target records.
  • Check partial success and all-or-nothing behavior with the same mixed-validity fixture.
  • Retry an uncertain job result and verify that committed rows are not applied twice.
  • Reconcile final counts and inspect values that should remain unchanged.
  • Check access to source files, job details, and error reports with a second account.

Full CSV import testing checklist

1. Capture the contract and a repeatable baseline

Record the format, schema, key, import modes, failure policy, and account scope. Prepare fixtures with one clear purpose and reset the target before independent executions.

  • Initial records and their revisions match the documented baseline.
  • A valid fixture has independently calculated expected values and counts.
  • Each invalid fixture isolates the intended parsing or validation rule.
  • Unrelated records are included so unintended broad updates can be detected.
  • Job inputs and expected outcomes are recorded with the test result.

For cross-system mapping and reconciliation around an import, use the API Integration Testing Checklist. A completed exchange still needs verification of the resulting application data.

2. Verify decoding, separators, and record endings

Test the declared dialect and explicitly unsupported variants. Do not infer support from how a spreadsheet happens to display the file on one workstation.

  • Supported non-ASCII characters survive decoding unchanged.
  • An accepted leading BOM does not become part of the first header name.
  • Invalid byte sequences produce the documented file error without target writes.
  • An unsupported delimiter is rejected or requires an explicit supported configuration.
  • Accepted LF and CRLF record endings produce equivalent logical rows.

In the example, semicolon-separated input is unsupported. That is a product rule, not a claim that every file described as CSV must use the same dialect.

3. Parse quotes, embedded separators, and multiline cells

Use a quoted comma, a doubled quote, and a quoted field containing a line feed. Compare the resulting cell values and the number of logical records.

  • A comma inside a quoted cell remains part of that field.
  • A doubled quote becomes one quote in the parsed value.
  • A quoted line feed does not start another data record.
  • Unbalanced quoting blocks application with an appropriate file-level error.
  • A row with the wrong cell count follows the declared structural-error policy.

A physical line number and a logical data-row number can differ. Keep both when the product uses them to locate errors; otherwise a correct rejection may direct the user to the wrong source record.

4. Check headers and confirm column mapping

Exercise automatic matching and manual mappings where supported. An import must not quietly map a familiar-looking source label to the wrong target field.

  • Every required target has exactly one confirmed source mapping.
  • Duplicate normalized headers are rejected before confirmation.
  • Reordered columns preserve the intended field relationships.
  • Extra source columns require the example's explicit Ignore choice.
  • Changing a mapping invalidates or recomputes the prior preview.

Keep the source, mapping, and selected modes attached to the job. Confirmation must not apply a different mapping from the one whose preview the user reviewed.

5. Separate missing values from intentional clearing

Test an omitted column, an empty unquoted cell, an empty quoted cell, and a literal text marker independently. Their meanings belong to the application contract.

  • Missing required values are rejected with the correct field reference.
  • Present blank optional date cells clear the date under the example rule.
  • Present blank notes cells become empty text without substituting a default message.
  • Omitted optional columns preserve existing values on update.
  • Literal text such as NULL is not silently converted without a declared rule.

The example treats quoted and unquoted empty cells alike after parsing. Another importer may distinguish them; make that difference explicit instead of assuming all empty-looking inputs are interchangeable.

6. Preserve identifiers and apply normalization predictably

Follow the matching key from source bytes through parsed value, normalized key, target lookup, and report. Verify the account boundary used by that lookup.

  • Leading-zero identifiers remain text and do not collapse into numeric equivalents.
  • Declared surrounding-space trimming is consistent in matching and duplicate detection.
  • Case variants match or remain distinct according to the stated key policy.
  • A different account's matching key is not treated as this account's record.
  • Reports identify the source row without changing its meaningful key representation.

A correct total can conceal an update to the wrong record. Inspect record identities and unchanged neighbors, especially where numeric-looking keys or normalization collisions are possible.

7. Validate numeric, date, and text fields

Use explicit formats and ranges. Keep parser success separate from acceptance of a parsed value by its target field.

  • Integer fields reject forbidden fractions, signs, and scientific notation.
  • Decimal values retain required precision without undocumented rounding.
  • Unsupported decimal or grouping separators produce field errors.
  • Date validation rejects impossible dates as well as malformed strings.
  • Text trimming and length checks occur in the documented order.

For this example, the quoted price 1,25 parses as one cell but fails the period-decimal rule. A valid date-only value must not shift to another day because the import machine uses a different local time zone.

8. Test in-file duplicates independently of target matches

Prepare repeated keys in one file and keys already present before the job. Record which occurrence wins or whether the product rejects the whole group.

  • A later repeated key receives the example's in-file duplicate rejection.
  • A normalized collision follows the same rule as an exact repeated key.
  • An invalid first occurrence does not silently promote a later duplicate under the example policy.
  • Two empty identifiers receive required-field errors instead of an unintended shared-key match.
  • Duplicate decisions are stable across preview, execution, and error reporting.

Do not describe every duplicate as an error. Existing-target matches can be valid updates or intentional skips depending on the selected mode.

9. Verify matching modes and their counters

Run the same fixture against the same reset baseline in each mode. Apply row validation first, as specified by the example contract.

  • Create only adds absent valid keys and preserves matching existing records.
  • Update only changes matching valid records without creating absent ones.
  • Upsert chooses the expected action for each valid key.
  • Skipped rows carry a reason distinct from validation rejection.
  • Updated counters follow the defined matched-application semantics.

For the ten-row fixture, Create only yields three created, zero updated, two skipped, and five rejected. Update only yields zero created, two updated, three skipped, and five rejected. Both have zero not applied; their target counts are six and three respectively.

10. Separate partial application from all-or-nothing commits

Use the same mixed-validity fixture for both policies. Distinguish the proposed actions in preview from successful final writes.

  • Partial mode applies eligible rows without silently discarding their successful results.
  • All-or-nothing validation failure leaves every original target value unchanged.
  • Eligible blocked rows are counted as not applied rather than successful updates.
  • A failed atomic commit produces no net target changes under the example policy.
  • Downstream actions follow the declared commit outcome rather than an uncommitted preview.

With a separate valid five-row fixture, a job-level atomic commit failure can leave all five not applied and none rejected. That is different from the mixed fixture's five validation rejections. Keep operation errors separate from invented per-field errors.

11. Verify preview and changes before confirmation

Check a preview against independently calculated outcomes. Then change the target through another authorized operation before confirming the job.

  • Preview changes no target business record or revision.
  • The confirmed source version and mapping match the reviewed preview.
  • An existing-record revision conflict is reported without overwriting the intervening change.
  • A newly occupied key is not silently reclassified from creation to update.
  • A corrected mapping requires the documented new preview or confirmation process.

Preview is not a reservation of every future target state. The example binds expected matches and revisions so concurrent changes become explicit conflicts. Other products need their own documented rule for this interval.

12. Observe background work and completion accurately

Follow file acceptance, preparation, confirmation, row application, and final reporting as separate observations when the product exposes them.

  • Accepting a file does not falsely report completed data changes.
  • A queued or running job has an identifiable job ID and observable progress.
  • Temporary processing errors follow the stated retry or failure policy.
  • Completion reflects persisted outcomes rather than rows merely read or queued.
  • Refreshing the page retrieves the same job and current results.

For deriving event sequences and forbidden job actions, see State Transition Testing: Examples and Test Cases. Here, also inspect the actual imported values; correct state transitions alone do not establish correct data mapping.

13. Distinguish retrying a job from starting another import

Simulate losing a confirmation response after the job has applied its rows. Recover through the supported operation identity and job lookup.

  • Repeating the same operation returns its established job outcome under the example contract.
  • Recovery does not create a second job or reapply committed rows.
  • A changed source or mapping cannot silently reuse an incompatible confirmation identity.
  • A deliberately new job follows matching rules against the current target state.
  • Replayed counters describe the original execution rather than a fresh recalculation.

After the main partial-upsert import, a new job with the same file finds all five valid keys already present. It therefore reports zero created, five updated, zero skipped, and five rejected under the stated counter semantics. The original job's replay still reports three created and two updated.

14. Check cancellation and operation failures at known boundaries

The example permits partial-mode cancellation between row applications. Acknowledged cancellation stops further rows but does not undo already committed work; it is terminal for that job.

  • A controlled cancellation stops at the documented row boundary.
  • Already committed partial-mode rows remain visible with their recorded outcomes.
  • Remaining rows are not applied and do not acquire fabricated validation errors.
  • Confirmation or retry cannot silently restart a cancelled job.
  • Failure recovery reports actual saved outcomes without claiming an automatic rollback that did not occur.

For the main fixture, cancellation after R4 and before R5 gives one created, one updated, zero skipped, two rejected, and six not applied. The account has four products: two changed rows do not imply two new records.

15. Test volume, empty input, and limits

Keep format and business data valid while testing the limit itself. Record whether a limit applies to bytes, logical records, cells, or execution time.

  • Exactly 1,000 otherwise valid data records are accepted under the example limit.
  • A 1,001-record fixture is blocked before target writes.
  • A quoted multiline value does not consume extra logical-record slots.
  • A header-only file completes as a no-op under this example's empty-input rule.
  • A file without a valid header receives a file error instead of a misleading successful import.

The header-only result has zero in every row-outcome counter. A malformed or over-limit file is a preflight failure; its response must not pretend that ordinary row application completed. Test large jobs through the service too, using the surrounding API Testing Checklist.

16. Enforce account scope and protect import artifacts

Use accounts with deliberately overlapping external IDs. Check job, source, preview, record-write, and report access through the supported interfaces.

  • Matching and writes remain inside the authorized account.
  • Source columns cannot redirect a job into another account's records.
  • Another account cannot read the private source or error report by substituting its job ID.
  • A caller without import permission cannot confirm otherwise valid data.
  • Job errors and diagnostic details expose only the intended information.

An import can reveal sensitive source data even when its target writes are correctly scoped. Include stored originals and rejected-row reports in retention and access checks, using the product's actual deletion deadlines.

17. Inspect error reports and spreadsheet-facing output

Check how a user finds the failing source row, corrects it, and submits a new job. Error fields should distinguish file failures, mapping problems, row validation, conflicts, and intentional skips.

  • Reports identify the correct logical row and source location when provided.
  • The affected field, original value, and reason are represented accurately.
  • Quoted commas and newlines do not break the generated report's structure.
  • A corrected-row import does not accidentally reapply unrelated successful rows.
  • Spreadsheet-facing output follows its declared text-safety policy without corrupting canonical stored data.

The OWASP CSV Injection guidance explains the risk of spreadsheet programs interpreting untrusted cell content as formulas. It also notes that no sanitization strategy works universally for every spreadsheet and downstream consumer.

Treat parsing and formula interpretation as separate boundaries. Preserve the agreed application data, then verify any spreadsheet-oriented export or report in its supported consumer. Merely quoting a CSV field is not evidence that a spreadsheet will display it as literal text.

18. Reconcile job totals with independent target reads

Compare source rows, their final classifications, and actual target effects. Use a query or read path that includes the whole test account rather than the current visible page.

  • Every classified source row has one mutually exclusive final outcome.
  • Created and updated counts match the corresponding record identities.
  • Final target count follows creations and deletions, not the total of successful row applications.
  • Rejected, skipped, and not-applied rows leave their target values unchanged unless another reported row legitimately changes the same record.
  • Unrelated records retain their baseline values and ownership.

Record mapping, modes, fixture version, job ID, and the before-and-after evidence. A matching headline total can hide a wrong field assignment, loss of a leading zero, or an update to a neighboring record.

Fifteen worked CSV import test cases

Use the three-record baseline and six-field schema unless a case specifies another fixture. Reset the account before independent cases and variants. All normal operations use a caller authorized for that account.

Test case 1: Reconcile the ten-row partial-upsert import

  • Preconditions: The target contains exactly 0007, A200, and Z900 at their documented baseline values.
  • Input: R1-R10 with Upsert and partial mode.
  • Steps: Confirm the correct mapping, preview, execute, read the completed job, and independently retrieve all affected products.
  • Expected result: Ten records equal three created, two updated, zero skipped, five rejected, and zero not applied; the final account contains six products.
  • Value checks: R1 and R6 supply the updated values, R2 wins over R3, 0008 preserves its zeros, and Z900 remains untouched.

Test case 2: Map reordered columns without exchanging values

  • Preconditions: A fresh baseline; start_date and notes may be omitted from the source.
  • Input: Header Price,ID,Units,Product,Comment and record 7.25,N100,4,North Kit,ignore this.
  • Steps: Map Price to unit_price, ID to external_id, Units to quantity, and Product to name; explicitly ignore Comment, then preview and import.
  • Expected result: One product is created with key N100, name North Kit, quantity 4, price 7.25, null start_date, and empty notes. The ignored comment is not saved.
  • Evidence: Read the target fields individually so a correct creation count cannot conceal swapped mappings.

Test case 3: Block structural and mapping errors before writes

  • Preconditions: Independent reset baselines and otherwise valid data.
  • Inputs: A duplicate pair of headers that become identical after trimming; a source missing a required target mapping; an unclosed quoted cell; and a record with the wrong cell count, each in its own variant.
  • Steps: Attempt preparation and confirmation through the supported interface for each fixture.
  • Expected result: A corresponding file or mapping error blocks target writes. No target value or revision changes, and no fabricated complete row-outcome ledger is reported for an unparseable file.
  • Evidence: Preserve the submitted bytes and mapping; four different defects should not be reported as one unexplained generic failure.

Test case 4: Preserve quotes, commas, and a multiline value

  • Preconditions: A reset baseline and a correctly generated two-record CSV.
  • Input: Q100 has name Green, "Field", quantity 2, price 5.25, date 2026-12-05, and notes containing first line, a literal LF, then second line. Q101 has name Plain, quantity 1, price 1.00, and empty optional fields.
  • Steps: Encode the embedded comma, quote, and newline using quoted CSV cells; import and read both products and the job's logical-record total.
  • Expected result: Two records are created. Q100's name retains its comma and quotes, its notes retain the actual line feed, and Q101 remains a separate second data record.
  • Evidence: Compare actual field values rather than the CSV's quote syntax or its count of physical lines.

Test case 5: Handle UTF-8 and a leading BOM explicitly

  • Preconditions: Fresh baselines for two supported variants and one invalid-byte variant.
  • Input: Product U100 named Café, quantity 1, price 1.00, and empty optional fields, encoded as UTF-8 without a BOM and then with one at byte zero; separately, a fixture containing an invalid UTF-8 byte sequence.
  • Steps: Prepare and import the valid variants independently; attempt preparation of the invalid one.
  • Expected result: Each valid variant creates one correctly named product, with no BOM in the parsed header. The invalid sequence causes a file-level decoding error and no target writes.
  • Evidence: Record actual bytes; a filename or an editor's encoding label alone does not establish the submitted encoding.

Test case 6: Distinguish empty cells, omitted columns, and text keys

  • Preconditions: Fresh baselines for each variant.
  • Inputs: A new row with key 0008 , name Elm , quantity 1, price 1.20, and empty optional cells; an update 0007,Atlas,6,12.50,,; and the same update with optional columns omitted.
  • Steps: Import each independently, then read its key, name, start_date, and notes.
  • Expected result: The new key is text 0008 and the name is Elm. Present blank cells clear 0007's date to null and notes to empty text; omitted optional columns preserve its original date and notes.
  • Evidence: Keep required fields valid in every variant and inspect values directly rather than relying on an empty-looking UI cell.

Test case 7: Apply the first-occurrence duplicate rule

  • Preconditions: The target has neither X100 nor X101.
  • Input: Two otherwise valid X100 rows with names First and Second. In a fresh variant, use X101 twice, with the first row missing its name and the second otherwise valid.
  • Steps: Run partial Upsert and inspect row outcomes plus the resulting keys.
  • Expected result: The first fixture creates X100 as First and rejects the second row: one created and one rejected. The second fixture rejects both rows and creates no X101 because its first occurrence already claimed the key.
  • Evidence: Verify reasons separately: missing name on the first X101 occurrence and in-file duplicate on the second.

Test case 8: Preserve existing records in Create only mode

  • Preconditions: The untouched three-record baseline.
  • Input: R1-R10 with Create only and partial mode.
  • Steps: Preview, confirm, inspect the job, and read the existing and newly created keys.
  • Expected result: Three created, zero updated, two skipped, five rejected, and zero not applied. The account contains six products.
  • Value checks: 0007 and A200 retain all original values; the valid matching rows are skips with Already exists reasons, not validation errors.

Test case 9: Create nothing in Update only mode

  • Preconditions: The untouched three-record baseline.
  • Input: R1-R10 with Update only and partial mode.
  • Steps: Preview, confirm, and inspect record identities and values independently of the job counters.
  • Expected result: Zero created, two updated, three skipped, five rejected, and zero not applied. The account still contains three products.
  • Value checks: 0007 and A200 receive their mapped updates; B300, E600, and 0008 are absent with Not found skip reasons. Z900 remains unchanged.

Test case 10: Apply nothing when atomic validation fails

  • Preconditions: The original baseline, with no concurrent modifications.
  • Input: R1-R10 with Upsert and all-or-nothing mode.
  • Steps: Inspect preview predictions, attempt confirmation, and compare every target value and revision with the baseline.
  • Expected result: Zero created, zero updated, zero skipped, five rejected, and five not applied. The original three products remain completely unchanged.
  • Evidence: Preview's three proposed creations and two proposed updates must not appear as successful final writes.

Test case 11: Detect a change between preview and confirmation

  • Preconditions: Preview a valid update to 0007 at revision 1. Through another authorized operation, change its quantity to 8 and advance its revision before confirmation.
  • Input: The original preview-bound confirmation, which proposes quantity 6.
  • Steps: Confirm in partial mode, inspect the row's conflict outcome, and independently retrieve 0007.
  • Expected result: The single row is rejected for a target revision conflict; nothing is created or updated by this import. Quantity remains 8 and the intervening revision is preserved.
  • Evidence: Capture the preview revision and the later target revision to distinguish a conflict from ordinary field validation.

Test case 12: Replay a completed job without applying it twice

  • Preconditions: The main partial-upsert job has finished, but its confirmation response was lost to the caller.
  • Input: The same job and confirmation identity; separately, a deliberately new Upsert job using the same CSV.
  • Steps: Recover and repeat the original confirmation, inspect counts and records, then run the new-job variant against that resulting target.
  • Expected replay: The original result remains three created, two updated, and five rejected, with six target records and no new applications from replay.
  • Expected new job: Zero created, five updated, five rejected, and six target records. Skipped and not-applied counts are zero for both completed executions.

Test case 13: Locate an error after a multiline record

  • Preconditions: A reset baseline and LF record endings; use the two-record structure from case 4 without extra blank lines.
  • Input: Q100 occupies physical lines 2 and 3 because its quoted notes contain one LF. Q101 starts on physical line 4 and has quantity -1.
  • Steps: Import in partial mode, open the authorized error report, and locate the rejected record using its logical number and reported source position.
  • Expected result: Two logical records yield one created and one rejected. The error identifies Q101 as data record 2, starting on physical line 4, with a quantity error.
  • Evidence: The report must not identify the second physical line of Q100's quoted notes as another product row.

Test case 14: Enforce the logical-record limit

  • Preconditions: Fresh baselines and valid unique keys absent from the target.
  • Input: Independent files containing exactly 1,000 and 1,001 logical records; include one quoted multiline notes value in each.
  • Steps: Run preparation and import where permitted, then inspect the resulting account and job outcome.
  • Expected result: The 1,000-record fixture creates 1,000 products, giving 1,003 in the account. The 1,001-record fixture is blocked by the preflight limit and leaves the original three products unchanged.
  • Evidence: The extra physical line inside notes must not make the accepted fixture appear to exceed 1,000 records.

Test case 15: Keep formula-like text as data across output boundaries

  • Preconditions: A valid new product can store notes as text. Its human-facing review export is required to display literal notes in the product's supported spreadsheet consumer.
  • Input: Product T100 named Literal Note, quantity 1, price 1.00, an empty date, and notes containing the harmless formula-like text =1+1.
  • Steps: Import, read canonical notes, inspect the application display, then open the review export through the supported consumer and opening method.
  • Expected result: One product is created with canonical notes exactly =1+1; the application displays that text without evaluating it. The review export also displays the literal text rather than calculating 2.
  • Evidence: Verify the consumer-specific output representation separately; do not insert spreadsheet escape characters into canonical stored notes merely to make one export view pass.

Common mistakes

  • Stopping when the file uploads. Transfer success does not establish parsing, matching, or committed record correctness.
  • Counting physical lines as data records. A quoted newline can shift both record totals and error locations.
  • Trusting automatic type inference. A text identifier can lose zeros, while a date can be interpreted using an unintended locale.
  • Treating every duplicate alike. An in-file collision and an existing-target match can require different outcomes.
  • Counting proposed writes as committed writes. Atomic validation failure can leave eligible preview rows entirely unapplied.
  • Verifying only the final record count. Wrong updates may preserve the count while corrupting values or identities.
  • Retrying an uncertain outcome as a new job. Existing writes can be applied again if the recovery contract is ignored.
  • Using one spreadsheet escape rule everywhere. Presentation-oriented changes can alter data that another consumer later imports programmatically.

FAQ

File upload testing follows transfer, processing, storage, access, and attachment behavior. CSV import testing verifies how parsed rows map to application records and what changes are committed. A perfectly stored file can still produce incorrect field values, duplicate records, or misleading import totals.

Include a new valid key, an existing key, a repeated in-file key, a missing required value, an invalid number or date, and a quoted separator. Add multiline and non-ASCII fixtures separately when isolating parsing behavior. Keep a known target baseline so every expected outcome can be calculated before execution.

Skipped rows are otherwise valid but intentionally excluded by a matching mode, such as an existing key in Create only. Rejected rows fail a required rule or encounter an applicable conflict. Report separate reasons so a user knows whether to change the input, mode, or target conditions.

Reconcile every source record with a final outcome, then retrieve affected and unaffected target records through an independent read. Compare identities, values, revisions, and account ownership. Use the full test dataset rather than a paginated UI view, and account for not-applied rows after cancellation or failure.

Ready to turn this guide into a working QA project with statuses, comments, and CSV export?