jacodb icon indicating copy to clipboard operation
jacodb copied to clipboard

IFDS core refactor

Open sergeypospelov opened this issue 1 year ago • 5 comments

Description

PR TODOs:

  • [x] Unused Analysis
  • [x] Multi chunk scenario + tests
  • [x] Graceful shutdown on timeout
  • [x] Try to remove Fact generic parameter
  • [x] Revert Kotlin version (better fix IRTest)
  • [x] Unify helper extension functions (system creation, analysis start, result retrieval)
  • [x] Fix workaround with flag
  • [x] Remove and replace old entities
  • [x] Some tests
  • [ ] Comments
  • [ ] Description

sergeypospelov avatar Apr 04 '24 14:04 sergeypospelov

Test results on JDK 19

1 328 tests  +3   1 316 :white_check_mark: +3   4m 55s :stopwatch: - 3m 3s    50 suites +2      12 :zzz: ±0     50 files   +2       0 :x: ±0 

Results for commit 1b5872c2. ± Comparison against base commit 5068453f.

This pull request removes 1055 and adds 1058 tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), true) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 42) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 999) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'other') is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'test') is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(unresolved, any) is false()
…
org.jacodb.actors.RoutersTest ‑ Test message key router()
org.jacodb.actors.RoutersTest ‑ Test random router()
org.jacodb.actors.RoutersTest ‑ Test round robin router()
org.jacodb.actors.StoppingTest ‑ Test stops()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work 2()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
…
This pull request removes 7 skipped tests and adds 7 skipped tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.impl.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.impl.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.impl.IfdsNpeTest ‑ simple points-to analysis()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ simple points-to analysis()

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 04 '24 14:04 github-actions[bot]

Test results on JDK 8

1 328 tests  +3   1 314 :white_check_mark: +3   5m 1s :stopwatch: - 1m 27s    50 suites +2      14 :zzz: ±0     50 files   +2       0 :x: ±0 

Results for commit 1b5872c2. ± Comparison against base commit 5068453f.

This pull request removes 1055 and adds 1058 tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), true) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 42) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 999) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'other') is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'test') is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(unresolved, any) is false()
…
org.jacodb.actors.RoutersTest ‑ Test message key router()
org.jacodb.actors.RoutersTest ‑ Test random router()
org.jacodb.actors.RoutersTest ‑ Test round robin router()
org.jacodb.actors.StoppingTest ‑ Test stops()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work 2()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
…
This pull request removes 7 skipped tests and adds 7 skipped tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.impl.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.impl.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.impl.IfdsNpeTest ‑ simple points-to analysis()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ simple points-to analysis()

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 04 '24 14:04 github-actions[bot]

Lifecycle test results

48 tests  ±0   48 :white_check_mark: ±0   1m 21s :stopwatch: -2s  5 suites ±0    0 :zzz: ±0   5 files   ±0    0 :x: ±0 

Results for commit 1b5872c2. ± Comparison against base commit 5068453f.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 04 '24 14:04 github-actions[bot]

Test results on JDK 11

1 328 tests  +3   1 318 :white_check_mark: +3   5m 48s :stopwatch: -38s    50 suites +2      10 :zzz: ±0     50 files   +2       0 :x: ±0 

Results for commit 1b5872c2. ± Comparison against base commit 5068453f.

This pull request removes 1055 and adds 1058 tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), true) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 42) is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(intArg(42), 999) is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'other') is false()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(stringArg('test'), 'test') is true()
org.jacodb.analysis.impl.ConditionEvaluatorTest ‑ ConstantEq(unresolved, any) is false()
…
org.jacodb.actors.RoutersTest ‑ Test message key router()
org.jacodb.actors.RoutersTest ‑ Test random router()
org.jacodb.actors.RoutersTest ‑ Test round robin router()
org.jacodb.actors.StoppingTest ‑ Test stops()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work 2()
org.jacodb.analysis.custom.NullabilityAssumptionAnalysisTest ‑ null-assumption analysis should work()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(Not(True)) is false()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ And(True) is true()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ AnnotationType in unexpected()
org.jacodb.analysis.ifds.ConditionEvaluatorTest ‑ ConstantEq(boolArg(true), false) is false()
…
This pull request removes 7 skipped tests and adds 7 skipped tests. Note that renamed tests count towards both.
org.jacodb.analysis.impl.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.impl.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.impl.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.impl.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.impl.IfdsNpeTest ‑ simple points-to analysis()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ activation points maintain flow sensitivity()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ array aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ complex aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ context injection in points-to()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ mixed array and class aliasing()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ no NPE after checked access with field()
org.jacodb.analysis.ifds.IfdsNpeTest ‑ simple points-to analysis()

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 04 '24 14:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 77.19113% with 216 lines in your changes are missing coverage. Please review.

Project coverage is 74.79%. Comparing base (5068453) to head (1b5872c).

Files Patch % Lines
...g/jacodb/analysis/ifds/taint/TaintFlowFunctions.kt 53.33% 21 Missing :warning:
.../org/jacodb/actors/impl/workers/UserActorWorker.kt 72.58% 15 Missing and 2 partials :warning:
.../jacodb/actors/impl/workers/InternalActorWorker.kt 45.83% 12 Missing and 1 partial :warning:
...jacodb/actors/impl/actors/internal/WatcherActor.kt 80.00% 6 Missing and 6 partials :warning:
...in/kotlin/org/jacodb/analysis/ifds/npe/Builders.kt 57.14% 11 Missing and 1 partial :warning:
...n/kotlin/org/jacodb/actors/impl/ActorSystemImpl.kt 71.79% 11 Missing :warning:
...kotlin/org/jacodb/analysis/ifds/unused/Builders.kt 76.08% 10 Missing and 1 partial :warning:
...org/jacodb/analysis/ifds/common/ChunkStrategies.kt 47.36% 10 Missing :warning:
...org/jacodb/analysis/ifds/common/JcChunkResolver.kt 79.16% 6 Missing and 4 partials :warning:
.../kotlin/org/jacodb/analysis/ifds/taint/Builders.kt 64.28% 9 Missing and 1 partial :warning:
... and 22 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #225      +/-   ##
=============================================
- Coverage      75.81%   74.79%   -1.02%     
- Complexity      1649     1695      +46     
=============================================
  Files            175      188      +13     
  Lines          10241    10218      -23     
  Branches        1892     1838      -54     
=============================================
- Hits            7764     7643     -121     
- Misses          1713     1834     +121     
+ Partials         764      741      -23     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 15 '24 13:04 codecov[bot]