1. LandOffer
  2. Blog
  3. All articles
  4. QA Automation Portfolio: Show Repeatable Tests and an Explainable Failure Report

Job search

QA Automation Portfolio: Show Repeatable Tests and an Explainable Failure Report

An actually executed original stdlib Python formatter test project preserves a deliberate boundary failure, unchanged baseline tests, two regressions, repeat logs, and a bounded investigation report.

9 min readLandOffer team

A QA automation portfolio should let a reviewer run the tests, understand one meaningful failure, and trace the correction without relying on a screenshot of green checks. Start with a small, explicit contract and preserve the failed run. Connect the expected behavior to the observed output, investigation, correction, and bounded rerun result.

This guide includes an original local Python project that was actually executed on October 21, 2026. It deliberately introduces a defect in a progress-display formatter, then corrects and retests it. LandOffer publishes this guide and offers job-search tools. No real application, browser, upload service, employer assessment, or production system was tested.

A small repeatable test project beside a preserved failure record and a revised implementation notebook.

Use LandOffer’s recently posted jobs to identify the testing responsibilities you want to demonstrate. Choose a project whose behavior and limits you can explain, rather than listing tools without runnable evidence.

Define what the test project promises

The example is a pure function called progress_state(received, total). It accepts synthetic counts and returns a phase and percentage. It performs no file access, network request, or actual upload. Its purpose is to make a small boundary rule testable.

The declared contract, P1, is complete:

  • received must be a nonnegative integer; booleans are rejected rather than treated as counts.
  • total is either unknown, represented by None, or a positive integer. For known totals, received cannot exceed total.
  • Wrong types raise TypeError; invalid bounds raise ValueError.
  • An unknown total produces uploading with no percentage.
  • Equal received and total counts produce complete and 100 percent.
  • Otherwise, the phase remains uploading and the percentage is rounded down. It must not show 100 before equality.

Rejecting a zero total is this toy project’s declared rule, not a universal requirement for upload software. Likewise, count equality is the model’s completion condition; it does not establish that a server committed a real file.

The official Python unittest documentation describes test cases, assertions, discovery, and runner output. Here, the standard-library framework provides repeatable execution without installing a browser driver or third-party dependency. The observed local interpreter was CPython 3.12.14. The currently accessible 3.12 documentation displays 3.12.15; that documentation label is not the executed runtime version.

Worked asset one: a runnable project with a preserved failure

The sample project has two implementation directories, v1 and v2, each with the original test file. The second directory also contains two added regression tests. A README records the contract, environment, commands, expected failure, and scope. Complete logs and a source-change diff accompany the code.

From the supplied demo directory, use an available CPython 3.12 executable to run:

python3.12 -m unittest discover -s v1 -p 'test_*.py' -v
python3.12 -m unittest discover -s v2 -p 'test_*.py' -v

The original local run used the project’s existing .venv interpreter, with the exact executable and working directories saved in run-receipt.json. No software was installed. A reader using another interpreter or platform should record that environment rather than claiming it was covered by this run.

Version 1 deliberately calculates the incomplete percentage with:

round(received / total * 100)

The original suite has nine test methods. It checks the starting state, halfway state, equality, unknown total, negative input, wrong types, zero total, over-total input, and a near-completion boundary. The wrong-type method includes several subtests; those are not reported as additional top-level test methods.

The actual first result was nine tests run, one failure, exit code 1. The failing input was received=199, total=200. The contract expected:

{'phase': 'uploading', 'percent': 99}

The function returned:

{'phase': 'uploading', 'percent': 100}

The mismatched fields tell the reviewer what to investigate beyond the fact that a test failed. It shows an inconsistency between the ongoing phase and the premature percentage. The failed test and full output remain in before.log; they were not overwritten by the successful rerun.

Choose inputs that distinguish the contract’s branches

The starting fixture is small enough to explain without a coverage dashboard. Its completed input/output map is: (0, 10) gives uploading at 0; (5, 10) gives uploading at 50; (10, 10) gives complete at 100; and (7, None) gives uploading with no percentage. These examples separate the ordinary, equality, and unknown-total branches instead of asserting only that a result exists.

The invalid-input methods check negative received counts, a zero total, and received counts above the known total. The type method uses four subtests: boolean received, boolean total, string received, and string total. Each expects a type error. These choices document the contract rather than silently accepting Python’s broader numeric behavior. They are not an exhaustive list of malformed inputs.

The ninth method supplies the near-completion pair. Its assertion is concrete:

self.assertEqual(
    progress_state(199, 200),
    {'phase': 'uploading', 'percent': 99},
)

The expected dictionary comes from the declared requirement: incomplete counts use a rounded-down percentage. It is not copied from the defective implementation. That separation gives the failure an interpretable meaning. If the product rule instead intentionally permitted a rounded percentage of 100 while processing continued, the contract and display language would need different treatment; this exercise makes no judgment about an unspecified real product.

After the correction, the added fractional case checks the floor rule away from the completion boundary, and the large-integer case checks a just-below-total input without relying on floating-point precision. The original failing test remains in the suite. Adding regressions should not remove the example that first exposed the mismatch.

Investigate the mismatch before changing the assertion

The first hypothesis was that rounding crossed the display threshold before the counts were equal. A competing explanation was that the completion branch incorrectly changed the phase to complete. The direct probe returned uploading with 100, matching the failing assertion and showing that the equality branch had not supplied the result.

Python’s round documentation explains nearest-integer rounding when no precision argument is supplied, including ties to the even choice. For this input, the expression reaches 99.5 and rounds to 100. Python is behaving as documented. The defect is the deliberate mismatch between the sample’s chosen display rule and its implementation, not a Python or vendor bug.

Changing the expected value to 100 would make the test green while violating P1. The correction instead changes the calculation for the incomplete state:

received * 100 // total

Python’s arithmetic reference describes integer floor division. With validated positive totals and nonnegative integer counts, this expression supplies the declared rounded-down percentage without converting the ratio to a float. The existing equality branch still returns 100 only when the counts match.

The original nine-test file is byte-identical between versions. Two new regression methods cover 2/3, which should display 66 under P1, and a very large integer count just below its total, which should still display 99. These additions examine the chosen calculation beyond the first failing pair; they are not evidence of every possible input.

The actual corrected run was eleven tests passed, exit code 0. A second fresh-process run also produced eleven tests passed, exit code 0. The project preserves after.log, repeat.log, the implementation diff, and source and log hashes. Since the suite grew from nine methods to eleven, these counts should not be presented as a before-and-after pass-rate improvement.

Worked asset two: a complete readable failure report

A reviewer should not have to infer the investigation from terminal output. The completed report for this original exercise reads as follows.

Report QA-P01 — Premature 100 percent for an incomplete synthetic progress input.

Status and ownership: Corrected locally in v2 for the tested P1 contract. The sample implementation author owns the function change; the sample QA author owns the contract, tests, and report. No real product team or customer incident is represented.

Environment and reproduction: CPython 3.12.14 on the recorded local macOS environment, using standard-library unittest. Run the v1 suite; test_near_complete calls progress_state(199, 200). There is no browser, service, or network dependency.

Expected and observed: Expected phase uploading, percentage 99. Observed phase uploading, percentage 100. before.log records nine test methods and one assertion failure; the direct function probe is also saved in the run receipt.

Impact: The function supplies a misleading percentage for this incomplete input. Actual UI behavior, user impact, incident frequency, and production severity were not measured. An integration could consume the output differently, so the report does not invent customer consequences.

Investigation: Nearest-integer rounding was the initial hypothesis. The alternative completion-branch explanation was inconsistent with the observed uploading phase. Source inspection and the direct probe support the rounding explanation. The declared floor-until-equality rule remains the expected behavior.

Correction and validation: Replace the incomplete percentage expression with integer floor division. Keep input validation and the equality branch unchanged. Preserve the original nine tests, add two regression methods, and rerun in fresh processes. Both corrected executions passed eleven methods. The diff and hashed logs identify the tested versions.

Remaining limits and release decision: The evidence covers a finite local formatter suite. It does not establish browser rendering, screen-reader output, network progress accuracy, cancellation, concurrent updates, server acknowledgment, or production readiness. Retain the failed example, correction, tests, report, and instructions as local portfolio evidence. No real product release, CI run, deployment, or application submission occurred.

That report is a completed artifact, not a blank bug template. It gives a reviewer the input, mismatch, ownership, reasoning, correction, and remaining uncertainty in one place.

A failure investigation record connecting expected output, observed mismatch, correction, and bounded rerun evidence.

Make the evidence easy to reproduce and audit

Put the contract, source, tests, observed environment, and exact command before the successful log in the project handoff. Name which version is intentionally defective. An expected failing command should not look like an unexplained installation error.

Record return codes as well as visible text. Preserve the original failing log and give each later execution a distinct filename. Link the report to the relevant test and implementation change. Hashes help identify the exact files used; they do not independently prove the contract is correct or the project covers the employer’s needs.

Keep the project independent of private credentials and paid services when those are unnecessary to its purpose. This example requires no package installation, account, database, or remote system. Its small scope makes the failure easy to inspect. It does not pretend to demonstrate browser automation merely because some QA vacancies mention it.

If a role specifically requires API integration or UI tests, describe this as unit-test and failure-analysis evidence, then identify the additional work needed. Do not rename local tests as end-to-end tests or add a CI badge without an actual CI execution. Describe the unit-test scope directly, including the integration work it does not demonstrate.

Explain what the green result leaves unknown

Passing tests establish the observed result for the implemented assertions and inputs in the recorded environment. They do not prove the requirements were complete, the test oracle was appropriate for every product, or that an actual progress component behaves correctly.

For this exercise, the next meaningful scope expansion would first define an integration contract: where counts originate, what completion means beyond byte equality, and how the display should behave under interruptions. Only then could an additional test layer evaluate those behaviors. This article does not claim to have built or run that layer.

When presenting the project, explain why the boundary test mattered and how the output distinguished the likely cause. Acknowledge that the defect was intentionally authored for the demonstration. Do not present it as a discovered customer incident or claim the local project was professional production experience.

Use LandOffer’s current job listings to choose the next relevant testing responsibility. Include the run instructions and failure report, then explain the recorded result and the behaviors that remain untested.

Sources and Further Reading