Slide 1

Slide 1 text

JIT Feedback — what Experienced Developers like about Static Analysis Yuriy Tymchuk Swisscom, Switzerland Mohammad Ghafari UniBern, Switzerland Oscar Nierstrasz UniBern, Switzerland 3

Slide 2

Slide 2 text

How do Developers use Static Analysis When They use Static Analysis Mohammad Ghafari UniBern, Switzerland Oscar Nierstrasz UniBern, Switzerland *WITH A TWIST 4 @yuriy_tymchuk Swisscom, Switzerland

Slide 3

Slide 3 text

Wouldn’t Make it Alone Mohammad Oscar 5

Slide 4

Slide 4 text

6 The research presented here was all done in the University of Bern. Nothing Swisscom-related in this presentation, folks.

Slide 5

Slide 5 text

Static Analyzers 7

Slide 6

Slide 6 text

8 Static Analyzers

Slide 7

Slide 7 text

9 Static Analysis Camps

Slide 8

Slide 8 text

9 Static Analysis Camps

Slide 9

Slide 9 text

10 Static Analysis Camps Continuous quality assessment with inCode.
 Ganea, Verebi, Marinescu.
 Science of Computer Prog. 2017 Usage contracts: Offering imme- diate feedback on violations of structural source-code regularities.
 Lozano, Mens, Kellens 
 Science of Computer Prog. 2015 Using Static Analysis to Find Bugs.
 Ayewah, Hovemeyer, Morgenthaler, Penix, Pugh. IEEE Software 2008

Slide 10

Slide 10 text

11 Static Analysis Camps We have new useful analyzers!

Slide 11

Slide 11 text

12 Static Analysis Camps We have new useful analyzers! Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Source Software.
 Beller, Bholanath, McIntosh, Zaidman.
 SANER 2016. Why Don’t Software Developers Use Static Analysis Tools to Find Bugs? 
 Johnson, Song, Murphy-Hill, Bowdidge.
 ICSE 2013

Slide 12

Slide 12 text

13 Static Analysis Camps We have new useful analyzers! Nobody uses static analyzers

Slide 13

Slide 13 text

14 Static Analysis Camps We have new useful analyzers! Nobody uses static analyzers But they are not used?

Slide 14

Slide 14 text

15 Static Analysis Camps We have new useful analyzers! Nobody uses static analyzers But they are not used? But do they know about…

Slide 15

Slide 15 text

We shape our tools, and thereafter our tools shape us. — McLuhan/Culkin 16

Slide 16

Slide 16 text

17 Context: Pharo

Slide 17

Slide 17 text

18 Context: Pharo Object-Oriented Dynamically Typed

Slide 18

Slide 18 text

19 Context: Pharo Object-Oriented Dynamically Typed Language and IDE

Slide 19

Slide 19 text

20 Central Tool: Code Editor

Slide 20

Slide 20 text

21 Central Tool: Code Editor

Slide 21

Slide 21 text

22 Intrusive Quality Assistant

Slide 22

Slide 22 text

23 Is QA Useful or Distracting?

Slide 23

Slide 23 text

24 0% 20% 40% < 1 1–3 4–6 7–10 10+ Smalltalk Pharo N/A 4% Academia 75% Industry 21% 24 Participants (years) Is QA Useful or Distracting? Survey

Slide 24

Slide 24 text

25 Useful SOMETIMES Sometimes Distracting VERY Neutral 0% 25% 50% 75% 100% 8% Is QA Useful or Distracting? Survey 0% 20% 40% < 1 1–3 4–6 7–10 10+ Smalltalk Pharo N/A 4% Academia 75% Industry 21% 24 Participants (years)

Slide 25

Slide 25 text

26 Why/How Quality Assistant?

Slide 26

Slide 26 text

27 14 Researcher 36% Sen. Engineer 14% Engineer 50% 0% 20% 40% 60% 80% 100% <5 5–10 10–20 20+ 0% 20% 40% 60% 80% 100% <3 3–6 6+ Development Experience Pharo Experience Interview Why/How Quality Assistant? 5 3 2 5 3 4 2 3 9 2 7 2 5

Slide 27

Slide 27 text

28 It’s Always There

Slide 28

Slide 28 text

29 “No installation required” “No execution required” It’s Always There

Slide 29

Slide 29 text

30 Not Always There

Slide 30

Slide 30 text

31 Adds a Final Drop Maybe just once?

Slide 31

Slide 31 text

32 No! Adds a Final Drop Maybe just once?

Slide 32

Slide 32 text

34 Instant and Scoped Feedback

Slide 33

Slide 33 text

35

Slide 34

Slide 34 text

36 Scoped Feedback

Slide 35

Slide 35 text

37 Scoped Feedback

Slide 36

Slide 36 text

38 Scoped Feedback ~8.5 ~1.5

Slide 37

Slide 37 text

39 The Bad Side of QA

Slide 38

Slide 38 text

40 “There is this ‘missing yourself ’ rule with many false positives” The Bad Side of QA

Slide 39

Slide 39 text

41 “Uncommented class? Meh…” The Bad Side of QA “There is this ‘missing yourself ’ rule with many false positives”

Slide 40

Slide 40 text

42 “Sometimes not clear what is the problem” “Uncommented class? Meh…” The Bad Side of QA “There is this ‘missing yourself ’ rule with many false positives”

Slide 41

Slide 41 text

43 “Sometimes not clear what is the problem” “Takes too much of the editor space” “Uncommented class? Meh…” The Bad Side of QA “There is this ‘missing yourself ’ rule with many false positives”

Slide 42

Slide 42 text

44 Part of Something More

Slide 43

Slide 43 text

45 Part of Something More

Slide 44

Slide 44 text

46 Part of Something More

Slide 45

Slide 45 text

47 Part of Something More Fast Slow Slow

Slide 46

Slide 46 text

48 Part of Something More Fast Slow Slow Personal Personal Shared

Slide 47

Slide 47 text

49 Part of Something More Fast Slow Slow Personal Personal Shared Overview Glimpse Summary

Slide 48

Slide 48 text

50 QualityAssistant as a Teacher

Slide 49

Slide 49 text

51 QualityAssistant as a Teacher nodes select: [ :node | node isUsed not ]

Slide 50

Slide 50 text

52 QualityAssistant as a Teacher nodes select: [ :node | node isUsed not ] nodes reject: [ :node | node isUsed ] “I learned how to program better” — Student

Slide 51

Slide 51 text

53 QA as Communication Medium

Slide 52

Slide 52 text

54 QA as Communication Medium

Slide 53

Slide 53 text

55 QA as Communication Medium

Slide 54

Slide 54 text

55 QA as Communication Medium

Slide 55

Slide 55 text

56 QA as Communication Medium

Slide 56

Slide 56 text

56 QA as Communication Medium

Slide 57

Slide 57 text

57 QA as Communication Medium return presentation.list() .title("Best movies") .display(...) .sorting(...) .items(downloadMovies())

Slide 58

Slide 58 text

58 QA as Communication Medium return presentation.list() .title("Best movies") .display(...) .sorting(...) .items(downloadMovies())

Slide 59

Slide 59 text

59 QA as Communication Medium return presentation.list() .title("Best movies") .display(...) .sorting(...) .items(λ(downloadMovies()))

Slide 60

Slide 60 text

60 QA as Communication Medium

Slide 61

Slide 61 text

61 QA as Communication Medium

Slide 62

Slide 62 text

62 QA as Communication Medium “The most
 useful rules!”

Slide 63

Slide 63 text

63 Automatic, constant feedback

Slide 64

Slide 64 text

64 Automatic, constant feedback Narrow, contextual scope

Slide 65

Slide 65 text

65 Automatic, constant feedback Static analysis as a teacher Narrow, contextual scope

Slide 66

Slide 66 text

66 Automatic, constant feedback Static analysis as a teacher Narrow, contextual scope Common static analysis issues

Slide 67

Slide 67 text

67 Do you want to see developers using static analyzers?