Skip to content

Rule: Test improvement detection (test-improvement) #9

@ddjain

Description

@ddjain

Rule: Test Improvement Detection

Overview

Identifies significant test enhancements, such as large test additions or comprehensive test coverage improvements.

Label Metadata

  • Label Name: test-improvement
  • Color: 0e8a16 (Green)
  • Description: Significant test improvements detected

Detection Logic

Count lines added in test files:

  • Sum additions from test file diffs
  • Threshold: Default 50+ lines added (configurable via input)
  • Alternative: Count test cases added (it(, test(, describe( blocks)

Configuration Options

  • test_improvement_threshold: Minimum lines to add (default: 50)
  • count_test_cases: Count test blocks instead of lines (boolean)

Example Scenarios

Triggers (50+ lines added in tests):

  • Added describe('API Integration', () => { ... }) with 60 lines
  • Multiple new test files totaling 75 lines

Does NOT trigger:

  • 10-line test case added
  • Test refactoring with no net addition

Test Cases Needed

  • Detects large test additions (>threshold)
  • Counts only test file additions
  • Ignores source code line additions
  • Handles multiple test files
  • Configurable threshold
  • Alternative: count test cases instead of lines

Edge Cases

  • Test file deletion + large addition (net result)
  • Only test refactoring (same line count)
  • Test documentation added (count or ignore?)

Integration Notes

  • Should only check test files (depends on test file pattern matching)
  • Consider combining with test-only-change for comprehensive analysis

Priority

Low - Nice to have metric


Status: Not implemented
Category: Test Coverage & Quality

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions