Skip to content

v1.3.3

Latest

Choose a tag to compare

@Codegass Codegass released this 02 Jun 19:15

[1.3.3] - 2025-06-02

πŸ› Critical Bug Fix - JUnit Framework Support Enhancement

  • Fixed junit.framework.TestCase Assert Recognition: Major fix for assertion detection in legacy JUnit projects
    • Problem: junit.framework.TestCase assert methods were showing as UNRESOLVED_INVOCATION instead of ASSERT
    • Root Cause: isAssert() method only checked for org.junit but not junit.framework package
    • Solution: Added explicit support for junit.framework package in assertion detection
    • Impact: Eliminates false unresolved invocations in projects using JUnit 3.x style assertions

✨ New Feature - JUnit 3.x Test Method Detection

  • Legacy Test Method Support: Added support for JUnit 3.x style test method detection
    • Pattern Recognition: Detects public void testXxx() methods without requiring @Test annotations
    • Validation: Ensures methods are public, void, parameterless, and follow testXxx naming convention
    • Backward Compatibility: Maintains full support for modern @Test annotated methods

πŸ”§ Technical Improvements

  • Enhanced isAssert() Method: Added junit.framework package detection for comprehensive assertion recognition
  • Extended isTestMethod() Method: Added JUnit 3.x test method pattern detection alongside annotation-based detection
  • Smart Test Detection: Combines modern annotation-based and legacy naming convention-based test detection

πŸ§ͺ Verification - commons-vfs Project

Before (v1.3.2):

"unresolvedInvocations": [
  "UNRESOLVED_INVOCATION: assertSame(opts,newOpts)#[61-61]",
  "UNRESOLVED_INVOCATION: assertTrue(builder.isVersioning(newOpts))#[62-62]",
  "UNRESOLVED_INVOCATION: assertFalse(file.exists())#[63-63]"
]

After (v1.3.3):

"parsedStatementsSequence": [
  "ASSERT junit.framework.Assert.assertSame(Object, Object)#[61-61]",
  "ASSERT junit.framework.Assert.assertTrue(boolean)#[62-62]", 
  "ASSERT junit.framework.Assert.assertFalse(boolean)#[63-63]"
]

πŸ“Š Impact Analysis

  • Legacy Projects: Significantly reduces false unresolved invocations in JUnit 3.x projects
  • commons-vfs: From 1279 unresolved invocations to much fewer (mainly legitimate resolution issues)
  • Test Coverage: Now supports full spectrum of JUnit versions (3.x, 4.x, 5.x)
  • Analysis Accuracy: Dramatically improved assertion recognition across different JUnit frameworks

This fix is particularly important for analyzing older Java projects that still use JUnit 3.x conventions.