TensorFlow (tensorflow/tensorflow) — QA Practices Analysis

Date: 2025-09-30
Repository: https://github.com/tensorflow/tensorflow

Summary Table (focus categories)

Category Present Tooling/Mechanisms Key Evidence (paths, snippets) Confidence
Automated regression testing Yes Bazel test suites executed via CI scripts; Nightly test script tensorflow/tools/ci_build/linux/cpu/run_py3_core.sh — runs bazel test with tag/size filters; tensorflow/tools/ci_build/linux/gpu/run_cc_core.sh — GPU tests; tensorflow/tools/ci_build/a100/nightly.sh — nightly runner invoking bazel test across GPU/TPU filters 0.8
Unit test coverage tracking No evidence No coverage configs or usage of bazel coverage, coverage.py, codecov, coveralls found Searches returned none for: "bazel coverage", codecov, coveralls, coverage.py, .coveragerc 0.7
Unit test coverage threshold tracking No No thresholds or gates found in CI/scripts No references in CI/workflows or scripts 0.9
Code style check Yes PyLint, clang-format, buildifier; GH Action presubmit for PyLint .github/workflows/pylint-presubmit.yml; .pylintrc; .clang-format (Google style); ci/official/utilities/code_check_changed_files.bats (mentions buildifier, clang-format, pylint) 0.95
Integration testing Yes TensorFlow Lite testing harness and end-to-end model tests via Bazel tensorflow/lite/testing/BUILD defines tflite_model_test, tflite_portable_test_suite, generated_test_models_all (end-to-end execution and validation) 0.7

Additional Details and Evidence

Automated regression testing

  • CI test scripts (CPU):

    • File: tensorflow/tools/ci_build/linux/cpu/run_py3_core.sh

    • Excerpt:

      # Run bazel test command. Double test timeouts to avoid flakes.
      bazel test --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-gpu,-tpu,-benchmark-test \
        --test_lang_filters=py -k \
        --jobs=${N_JOBS} --test_timeout 300,450,1200,3600 --build_tests_only --config=opt \
        --test_output=errors --test_size_filters=small,medium -- \
        //tensorflow/... -//tensorflow/compiler/... -//tensorflow/contrib/...
      
  • CI test scripts (GPU/C++):

    • File: tensorflow/tools/ci_build/linux/gpu/run_cc_core.sh

    • Excerpt:

      export TF_NEED_ROCM=0
      export TF_NEED_CUDA=1
      bazel test --config=cuda --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-no_gpu,-benchmark-test \
        -k --test_lang_filters=cc --jobs=${N_JOBS} --test_timeout 300,450,1200,3600 \
        --build_tests_only --test_output=errors --local_test_jobs=8 --config=opt --test_size_filters=small,medium \
        --run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute -- \
        //tensorflow/... -//tensorflow/compiler/... 
      
  • Nightly regression run:

    • File: tensorflow/tools/ci_build/a100/nightly.sh

    • Excerpt (invokes GPU-focused bazel tests overnight):

      docker run ... tensorflow/tensorflow:devel-gpu bash -c "git pull; bazel test --config=cuda -c opt -k \
        --test_tag_filters=gpu,-no_gpu,-benchmark-test,-no_oss,-oss_excluded,-oss_serial,-v1only,-no_gpu_presubmit,-no_cuda11 \
        -- //tensorflow/... -//tensorflow/compiler/tf2tensorrt/... -//tensorflow/compiler/mlir/tosa/... -//tensorflow/compiler/mlir/lite/... -//tensorflow/lite/micro/examples/... -//tensorflow/core/tpu/... -//tensorflow/lite/..."
      

Interpretation: The presence of scripted Bazel test runners and a nightly script indicates automated regression testing is practiced (even though GitHub Actions do not run tests directly in this repo; tests are likely executed by external CI using these scripts).

Unit test coverage tracking

  • Searches performed:
    • repo:tensorflow/tensorflow "bazel coverage"
    • repo:tensorflow/tensorflow codecov OR coveralls OR coverage.py OR .coveragerc OR coverage.xml
  • Result: No matches. No explicit coverage tools or config found. Therefore no in-repo evidence of coverage tracking.

Unit test coverage threshold tracking

  • No CI steps or configs that enforce minimum coverage thresholds were found.

Code style check

  • Python linting in PRs:
    • .github/workflows/pylint-presubmit.yml
      • Job: PyLint on changed Python files
      • Steps include:
        • actions/checkout
        • actions/setup-python (3.9)
        • pip install pylint==2.13.9 numpy wheel
        • Run PyLint on changed files
  • Python lint rules:
    • .pylintrc present at repo root (11K lines of config)
  • C/C++ formatting:
    • .clang-format at repo root

      BasedOnStyle: Google
      DerivePointerAlignment: false
      
  • Bazel/Starlark formatting and style checks (via bats utility):
    • ci/official/utilities/code_check_changed_files.bats — mentions checking buildifier, clang-format, and pylint for changed files

Integration testing

  • TensorFlow Lite comprehensive testing harness:

    • File: tensorflow/lite/testing/BUILD
    • Contains rules and targets such as:
      • tflite_portable_test_suite
      • generated_test_models_all
      • tflite_model_test
    • These targets generate test models and run them through TFLite, validating outputs end-to-end (integration-level behavior across multiple components).
  • Additional unit test examples (Python) indicating rich test coverage though not necessarily integration by name:

    • tensorflow/python/autograph/tests/generator_test.py (uses TensorFlow’s test harness)

Other repository-wide indicators

  • Build/test system: Bazel (.bazelrc, WORKSPACE, many BUILD files). Numerous cc_test/py_test/tf_cc_test targets defined throughout.
  • Lint/security workflows present in GitHub Actions:
    • .github/workflows/pylint-presubmit.yml (lint)
    • .github/workflows/osv-scanner-scheduled.yml (SCA vulnerability scans; not code coverage)
    • .github/workflows/scorecards-analysis.yml (OpenSSF Scorecard; uploads SARIF; not a unit test workflow)
  • No GitHub Actions workflow was found that runs the Bazel tests directly; test execution appears to be orchestrated via external CI using the provided scripts under tensorflow/tools/ci_build/ and ci/official.

Conclusion

  • Automated regression testing: Present (via Bazel scripts and nightly runner)
  • Unit test coverage tracking: Not evidenced in-repo
  • Unit test coverage threshold tracking: Not present
  • Code style check: Strongly present (PyLint, clang-format, buildifier)
  • Integration testing: Present (notably in TFLite testing harness)