Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The False False Positives of Static Analysis (s...

The False False Positives of Static Analysis (sattose2017)

Static analysis tools may produce false positive results, which negatively impact the overall usability of these tools. However, even a correct static analysis report is sometimes classified as a false positive if a developer does not understand it or does not agree with it. Lately developers' classification of false positives is treated on a par with the actual static analysis performance which may distort the knowledge about the real state of static analysis.
In this paper we discuss various use cases where a false positive report is not false and the issue is caused by another aspects of static analysis. We provide an in-depth explanation of the issue for each use case followed by recommendations on how to solve it, and thus exemplify the importance of careful false positive classification.

Yuriy Tymchuk

June 07, 2017
Tweet

More Decks by Yuriy Tymchuk

Other Decks in Research

Transcript

  1. @yuriy_tymchuk The False False Positives of Static Analysis SCG @

    UNIBE The False False Positives of Static Analysis
  2. Wanna Evolve This? if(isValid == true) { //Do something. }

    don’t compare with true… detected by tatic analysis S s
  3. False Positives? if(isValid == true) { //Do something. } don’t

    compare with true… This is a “true positive”
  4. “Developers will decide what a false positive is” Tricorder: Building

    a program analysis ecosystem,
 C. Sadowski, J. van Gogh, C. Jaspan, E. So ̈derberg, and C. Winter ICSE 2015 pst… the authors are from
  5. “Developers will decide what a false positive is” Tricorder: Building

    a program analysis ecosystem,
 C. Sadowski, J. van Gogh, C. Jaspan, E. So ̈derberg, and C. Winter ICSE 2015 pst… the authors are from this is Bad
  6. sender: aSenderContext | nArgs | self requestor: aSenderContext method methodClass.

    nArgs := aSenderContext method numArgs. methodArgs := aSenderContext method ffiArgumentNames. self receiver: aSenderContext receiver. self assert: (methodArgs size = nArgs). Assert Beyond Tests
  7. sender: aSenderContext | nArgs | self requestor: aSenderContext method methodClass.

    nArgs := aSenderContext method numArgs. methodArgs := aSenderContext method ffiArgumentNames. self receiver: aSenderContext receiver. self assert: (methodArgs size = nArgs). Assert Beyond Tests
  8. sender: aSenderContext | nArgs | self requestor: aSenderContext method methodClass.

    nArgs := aSenderContext method numArgs. methodArgs := aSenderContext method ffiArgumentNames. self receiver: aSenderContext receiver. self assert: (methodArgs size = nArgs). shiftLevelDown level := (level - 1) max: 0. self assert: level >=0 And this is a quality assistance tool that Yuriy developed… and here you see an example of a false positive report.
  9. And this is a quality assistance tool that Yuriy developed…

    and here you see an example of a false positive report. It’s a bug :(
  10. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false Anti-Quick Return Rule
  11. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false ˆ background isNil or: [ (background isColor and: [ background isTranslucentButNotTransparent ]) or: [ border isColor and: [ border isTranslucentButNotTransparent ] ] ] Anti-Quick Return Rule
  12. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false ˆ background isNil or: [ (background isColor and: [ background isTranslucentButNotTransparent ]) or: [ border isColor and: [ border isTranslucentButNotTransparent ] ] ] Anti-Quick Return Rule
  13. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false ˆ background isNil or: [ (background isColor and: [ background isTranslucentButNotTransparent ]) or: [ border isColor and: [ border isTranslucentButNotTransparent ] ] ] Anti-Quick Return Rule FP?
  14. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false ˆ background isNil or: [ (background isColor and: [ background isTranslucentButNotTransparent ]) or: [ border isColor and: [ border isTranslucentButNotTransparent ] ] ] Anti-Quick Return Rule fFP
  15. background ifNil: [ ˆ true ]. (background isColor and: [

    background isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. (border isColor and: [ border isTranslucentButNotTransparent ]) ifTrue: [ ˆ true ]. ˆ false ˆ background isNil or: [ (background isColor and: [ background isTranslucentButNotTransparent ]) or: [ border isColor and: [ border isTranslucentButNotTransparent ] ] ] Anti-Quick Return Rule fFP
  16. exaggerate FP ratio mask intentions
 ignore user groups neglect tool

    de!ciencies Do not Introduce
 False False Positives! FP
  17. exaggerate FP ratio mask intentions
 ignore user groups neglect tool

    de!ciencies @yuriy_tymchuk Do not Introduce
 False False Positives! FP