Download presentation
Presentation is loading. Please wait.
Published byClinton Arnold Modified over 8 years ago
2
escj 28
3
Compaq Confidential - Need to Know Required
4
Static checkers
5
Compaq Confidential - Need to Know Required Type checking vs. extended static checking Are annotations needed? How many annotations per variable/method? Escape hatch for when annotation gets too complicated? Type checkingE.s.c. yes 10 -- many dynamic castsassume, nowarn
6
Compaq Confidential - Need to Know Required
7
Annotation assistant
8
Compaq Confidential - Need to Know Required Annotation assistant
9
Compaq Confidential - Need to Know Required Annotation assistant
10
Compaq Confidential - Need to Know Required Annotation assistant
11
Compaq Confidential - Need to Know Required Annotation assistant
12
Compaq Confidential - Need to Know Required Annotation assistant
13
Compaq Confidential - Need to Know Required -suggest switch Use simple (possibly bogus) heuristics Cup.java:18: Warning: possible null dereference (Null) x = o.f; ^
14
Compaq Confidential - Need to Know Required -suggest switch Use simple (possibly bogus) heuristics Cup.java:18: Warning: possible null dereference (Null) x = o.f; ^ Suggestion: perhaps declare ‘o’ as ‘non_null’
15
Compaq Confidential - Need to Know Required Annotation wizard design repeat call ESC/Java -suggest on sources; distill output into update instructions; act on update instructions until quiescence
16
Compaq Confidential - Need to Know Required Update instructions insert “/*@ … */” at 6,12 in Cup.java else “/*@ nowarn … */” at 28,17 in Client.java
17
Compaq Confidential - Need to Know Required Pachyclient case study ~11,000 lines of code ~650 methods 43 files 110 minutes (2.5 minutes to compile) 13 iterations 971 annotations
18
Compaq Confidential - Need to Know Required How were the 110 minutes spent? Iteration Warnings Minutes 039214 125612 213610 3789 4428 5248 6207 7117 867 937 1027 1117 1207 -------- -------- -------- TOTAL:13971110
19
Compaq Confidential - Need to Know Required What became of the 971 warnings? non_null instance fields304 instance fields304 parameters219 parameters219 local variables108(later: 27) local variables108(later: 27) static fields5 static fields5 postcondition RES != null49 requires 0 <= x2 ensures 0 <= RES2 invariant 0 <= x1 no heuristic null related47(29 for ‘null’) null related47(29 for ‘null’) negative related16 negative related16 suggestion in different file169 annotation inserter gives up49
20
Compaq Confidential - Need to Know Required Did the wizard help? null and negative checking only warnings on unannotated code:938 warnings on unannotated code:938 warnings on wizard-annotated code:274 warnings on wizard-annotated code:274 all checking (but heuristics only for null and negative) warnings on unannotated code:>1100 warnings on unannotated code:>1100 warnings on wizard-annotated code:488 warnings on wizard-annotated code:488
21
Compaq Confidential - Need to Know Required What kinds of warnings remain? Null121(83) NonNull131(83) NonNullInit5 IndexNegative15 NegSize2(1) Cast111 Pre48 IndexTooBig32 Post14 ZeroDiv7 Invariant2 (Numbers in parentheses indicate how many of the warnings have annotation suggestions in libraries.)
22
Compaq Confidential - Need to Know Required Annotating libraries Suggestion [359,52]: perhaps declare method 'getText' in /tmp_mnt/bill/r/dlusers14/sanjay/srcjava1.1/files/../files/jdk-114.zip: java/awt/TextComponent.class with 'ensures RES != null;'
23
Compaq Confidential - Need to Know Required
26
Compaq Research Harder questions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.