Back to all reviewers

minimize test complexity

llvm/llvm-project
Based on 3 comments
Other

Tests should be minimal and focused on the specific functionality being verified. Remove unnecessary passes, tools, or operations that aren't directly related to what's being tested to reduce noise and improve clarity.

Testing Other

Reviewer Prompt

Tests should be minimal and focused on the specific functionality being verified. Remove unnecessary passes, tools, or operations that aren’t directly related to what’s being tested to reduce noise and improve clarity.

Key principles:

  • Only include components necessary for the test’s purpose
  • Choose the most appropriate testing tools (e.g., use llvm-as -disable-output for verification tests instead of more complex alternatives)
  • Simplify test cases to highlight exactly what’s being tested
  • Reduce the number of test cases when fewer cases can adequately cover the functionality

Example of improvement:

// Before: Includes unnecessary canonicalizer pass
// RUN: mlir-opt %s -convert-complex-to-rocdl -canonicalize | FileCheck %s

// After: Focuses only on the conversion being tested  
// RUN: mlir-opt %s -convert-complex-to-rocdl | FileCheck %s

This approach makes tests easier to understand, maintain, and debug while ensuring they remain effective at catching regressions.

3
Comments Analyzed
Other
Primary Language
Testing
Category

Source Discussions