[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.TestCaseassert methods were showing asUNRESOLVED_INVOCATIONinstead ofASSERT - Root Cause:
isAssert()method only checked fororg.junitbut notjunit.frameworkpackage - Solution: Added explicit support for
junit.frameworkpackage in assertion detection - Impact: Eliminates false unresolved invocations in projects using JUnit 3.x style assertions
- Problem:
β¨ 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@Testannotations - Validation: Ensures methods are public, void, parameterless, and follow
testXxxnaming convention - Backward Compatibility: Maintains full support for modern
@Testannotated methods
- Pattern Recognition: Detects
π§ Technical Improvements
- Enhanced
isAssert()Method: Addedjunit.frameworkpackage 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.