File: gsoc-ideas.html

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (1424 lines) | stat: -rw-r--r-- 57,416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
<!DOCTYPE html>
<html>
<head>
  <title>Checker Framework organization: GSoC ideas 2020</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="icon" type="image/png" href=
  "../logo/Checkmark/CFCheckmark_favicon.png">
</head>
<body>

<img src="../logo/Logo/CFLogo.png" alt="Checker Framework logo" />

<h1>GSoC ideas 2020</h1> <!-- omit from toc -->

<p>Contents:</p>
<!-- start toc.  do not edit; run html-update-toc instead -->
<ul>
  <li><a href="#introduction">Introduction</a>
    <ul>
      <li><a href="#get-started">How to get started: do a case study</a></li>
      <li><a href="#ask-questions">How to get help and ask questions</a></li>
      <li><a href="#types-of-projects">Types of projects</a></li>
      <li><a href="#apply">How to apply</a></li>
    </ul></li>
  <li><a href="#evaluate-type-system">Evaluate a type system or a Checker Framework feature</a>
    <ul>
      <li><a href="#case-study-signature">Signature strings</a></li>
      <li><a href="#case-study-signedness">Signed and unsigned numbers</a></li>
      <li><a href="#optional-case-study">Java's Optional class</a></li>
      <li><a href="#Whole-program_type_inference">Whole-program type inference</a></li>
      <li><a href="#determinism">Determinism</a></li>
      <li><a href="#sound-by-default">Sound checking by default</a></li>
      <li><a href="#compare-other-tools">Comparison to other tools</a></li>
      <li><a href="#case-study-android-support">Android support annotations</a></li>
    </ul></li>
  <li><a href="#annotate-library">Annotate a library</a>
    <ul>
      <li><a href="#choose-a-library">Choosing a library to annotate</a></li>
      <li><a href="#case-study-nullness-guava">Guava library</a></li>
    </ul></li>
  <li><a href="#create-new-type-system">Create a new type system</a>
    <ul>
      <li><a href="#non-empty-checker">Non-Empty Checker for precise handling of Queue.peek() and poll()</a></li>
      <li><a href="#custom-tainting-checking">Custom tainting checking</a></li>
      <li><a href="#overflow">Overflow checking</a></li>
      <li><a href="#index-checker-mutable-length">Index checking for mutable length data structures</a></li>
      <li><a href="#nullness-bug-detector">Nullness bug detector</a></li>
    </ul></li>
  <li><a href="#cf-other">Enhance the toolset</a>
    <ul>
      <li><a href="#index-errors">Improving error messages</a></li>
      <li><a href="#flow-expression-parser">Flow expression parser</a></li>
      <li><a href="#dataflow">Dataflow enhancements</a></li>
      <li><a href="#Purity_analysis">Purity (side effect) analysis</a></li>
      <li><a href="#javadoc">Javadoc support</a></li>
    </ul></li>
</ul>
<!-- end toc -->

<h1 id="introduction">Introduction</h1>

<p>
  The <a href="https://checkerframework.org/">Checker Framework</a> is an
  innovative programming tool that prevents bugs at development
  time, before they escape to production.
</p>

<p>
  Java's type system prevents some bugs, such as <code>int count =
  "hello";</code>.  However, it does not prevent other bugs, such as null
  pointer dereferences, concurrency errors, disclosure of private
  information, incorrect internationalization, out-of-bounds indices, etc.
  <em>Pluggable type-checking</em> replaces a
  programming language's built-in type system with a more powerful,
  expressive one.
</p>

<p>
  We have created around 20
  <a href="https://checkerframework.org/manual/#introduction">new type
  systems</a>, and other people have created
  <a href="https://checkerframework.org/manual/#third-party-checkers">many
  more</a>.
  The more powerful type system is not just a
  bug-finding tool:  it is a verification tool that gives a guarantee that
  no errors (of certain types) exist in your program.  Even though it is
  powerful, it is easy to use.  It follows the standard typing rules
  that programmers already know, and it fits into their workflow.
</p>

<p>
  The Checker Framework is popular:  it is used daily at Google, Amazon,
  Uber, on Wall Street, and in other companies from big to small.  It is
  attractive to programmers who care about their craft and the quality of
  their code.  The Checker Framework is the motivation for Java's type
  annotations feature.  It has received multiple awards.
  <!-- at conferences such as JavaOne. -->
  With this widespread use, there is a need for people to help with the
  project:  everything from bug fixes, to new features, to case studies, to
  integration with other tools.  We welcome your contribution!
</p>

<p>
  Why should you join this project?  It's popular, so you will have an
  impact.  It makes code more robust and secure, which is a socially
  important purpose.  Past GSOC students have had great success.
  (David Lazar became a graduate student at MIT; multiple students
  have published papers in scientific conferences, such
  as <a href="https://homes.cs.washington.edu/~mernst/pubs/array-indexing-issta2018-abstract.html">Vlastimil
  Dort at ISSTA 2018</a>.)  You will
  get to scratch your own itch by creating tools that solve problems that
  frustrate you.  And, we have a lot of fun on this project!
</p>

<p>
  <b>Prerequisites:</b> You should be very comfortable with the Java
  programming language and its type system.  You should know how a type
  system helps you and where it can hinder you.  You should be willing to
  dive into a moderately-sized codebase.
  You should understand fundamental object-oriented programming concepts,
  such as
  <a href="https://en.wikipedia.org/wiki/Liskov_substitution_principle">behavioral
  subtyping</a>:  subtyping theory
  permits argument types to change contravariantly (even though Java forbids it
  for reasons related to overloading), whereas return types may change
  <a href="https://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29">covariantly</a>
  both in theory and in Java.
</p>


<p>
<b>Potential projects:</b>
Most of this document lists potential summer projects.  The projects are
grouped roughly from easiest to most challenging.  Many of the projects are
applicable beyond Google Summer of Code.
<!--
You can find more potential projects in the
<a href="https://github.com/typetools/checker-framework/issues">issue
  tracker</a>.
-->
</p>



<h2 id="get-started">How to get started: do a case study</h2>

<p>
  To <b>get started</b>, first do a case study of using the Checker
  Framework:  that is, run the Checker Framework on some program.
  A case study gives you experience in using the Checker
  Framework, and it may reveal bugs in either the Checker Framework or in
  the program it is analyzing.
</p>

<p>
  Do the case study before submitting your proposal.
  You might want to start with a small program such as from your
  coursework, then repeat the process with an open-source program or library.
</p>
<ol>
  <li>
    <a href="https://checkerframework.org/manual/#installation">Install</a>
    the Checker Framework.
  <li>
    <a href="https://checkerframework.org/manual/#how-to-read-this-manual">Review
    the Checker Framework documentation.</a>
  <li>
    Choose an existing library or program to type-check.
    Choose a program that is at least 1000 lines long.
    The library or program should be under active maintenance; don't choose one
    that has not had a commit in several years.
    You will find the case study easier if you are already familiar with
    the program, or if it is written in good style.
  <li>
    Choose one type system, from
    among <a href="https://checkerframework.org/manual/#introduction">those
    distributed with the Checker Framework</a>, that is appropriate for the
    program.
  <li>
    If the program is hosted on GitHub, fork it and create a branch for
    your work.  (Leave the master branch unchanged
    from upstream.)
  <li>
    Annotate the program, based on its documentation.
    <br/>
    Please do <em>not</em> make changes unrelated to annotating the
    program, such as inserting/removing whitespace or sorting
    the <code>import</code> statements.  Doing so bloats the size of the
    diffs and makes it hard to understand the essential changes.
  <li>
    Run the type-checker.  If it issues
    warnings, <a href="https://checkerframework.org/manual/#handling-warnings">correct them</a>.
    This might require adding more annotations,
    fixing bugs in the program, or suppressing warnings.
    Be sure that the program's test suite continues to pass.
    Repeat until
    the type-checker passes on the program.
    <ul>
      <li>Don't add an <code>if</code> statement that always succeeds, just
        to suppress a warning.  Convince yourself that both branches can
        execute, or else don't add the <code>if</code> statement.
      <li>If you add a <code>@SuppressWarnings</code> annotation,
        <a href="https://checkerframework.org/manual/#suppresswarnings-best-practices-justification">explain
        why</a> the checker warning is a false positive and you are certain
        the code is safe.
    </ul>
    Change the build system so that building the annotated branch runs the type-checker.
  <li>
    Share it with us so that
    we can evaluate it and give you feedback.

    <p>
    Share the case study as soon
    as you finish it or as soon as you have a question that is not answered
    in the <a href="https://checkerframework.org/manual/">manual</a>;
    don't wait until you submit your proposal.
    The subject line should be descriptive (not just "Case study", but
    "Nullness case study of Apache Commons Exec library").
    You should give us access to
    <ul>
      <li>the original (unannotated) version of the program,
      <li>the annotated version of the program, and
      <li>the exact command that runs the type-checker from the command
        line.
    </ul>
    The best way to give all this information is a pointer to your GitHub
    fork of the library.
</ol>

<p>
The primary result of your case study is that you will discover bugs in the
subject program, or you will verify that it has no bugs (of some particular
type).  If you find bugs in open-source code, report them to the program's
maintainer, and let us know when they are resolved.
</p>

<p>
Another outcome of your case study is that you may discover bugs, limitations,
or usability problems in the Checker Framework.  Please
<a href="https://checkerframework.org/manual/#reporting-bugs">report them</a>.
We'll try to fix them, or they might give you inspiration for
improvements you would like to make to the Checker Framework this summer.
</p>

<p>
You can also try to fix problems yourself and submit a
<a href="https://github.com/typetools/checker-framework/pulls">pull
  request</a>, but that is <em>not</em> a requirement; most successful GSOC
  applicants had not submitted a successful pull request before being selected.
(Some GSOC projects have a requirement to fix an issue in the issue tracker.
We do not, because it is unproductive.
Don't try to start fixing issues before you
understand the Checker Framework from the user point of view, which will
not happen until you have completed a case study on an open-source program.)
You may discuss your ideas with us by sending mail
to <a href="https://groups.google.com/forum/#!forum/checker-framework-gsoc">checker-framework-gsoc@googlegroups.com</a>.
</p>

<p>
  Why should you start with a case study?
  <!-- , instead of diving right into fixing
bugs, designing a new type system, or making other changes to the Checker
Framework?
-->
Before you can contribute to any project, you must
understand the tool from a user point of view, including its strengths,
weaknesses, and how to use it.
A case study is the best way to
learn about the Checker Framework, determine whether you would enjoy
joining the project during the summer, and show your aptitude so that you
will be chosen for the summer.
</p>


<h2 id="ask-questions">How to get help and ask questions</h2>

<p>
We are very happy to answer your questions, and we are eager to interact
with you!  It's OK to have questions, and your questions can lead to
improvements in the documentation and the tool.
</p>

<p>
Before you ask a question, read this file and the
<a href="https://checkerframework.org/manual/#troubleshooting">"Troubleshooting"
  section</a> of the Checker Framework manual
  (including <a href="https://checkerframework.org/manual/#reporting-bugs">"How
  to report problems"</a>),
and also search in the
<a href="https://checkerframework.org/manual/">Checker Framework manual</a>
for the answer.
Don't send us a message
that says nothing but &ldquo;please guide me&rdquo;
or &ldquo;tell me how to fix this bug&rdquo;.  Such a message disqualifies
you from participating in GSOC, because it shows that you do not read
instructions, and you haven't thought about the problem nor
tried to solve it.
</p>

<p>
Your questions should show that you will be a productive colleague over the
summer:  tell us what you have tried, tell us what went wrong or
where you got stuck, and ask a concrete technical question that will
help you get past your problem.  If you can do that, then definitely ask
your question, because we don't want you to be stuck or frustrated.
</p>

<p>
Whenever you send email (related to GSoC or not),
please use standard email etiquette, such as:  avoid all-caps; use a
descriptive subject line; don't put multiple different topics in a single
email message; start a new thread with a new subject line
when you change the topic; don't clutter discussions with irrelevant
remarks; don't use screenshots (unless there is a problem with a GUI), but
instead cut-and-paste the output or code into your message;
if you are making a guess, clearly indicate that it is a guess and
your grounds for it.  If you violate these basic rules, you will
demonstrate that you don't read instructions and you don't act
professionally.  Bug
reports should be
<a href="https://checkerframework.org/manual/#reporting-bugs">complete</a>
and should usually be
<a href="https://checkerframework.org/manual/#reporting-bugs">reported</a>
to the issue tracker.
</p>


<h2 id="types-of-projects">Types of projects</h2>

<p>
  Here are some possible focuses for a project:
</p>
<ul>
  <li>
    <a href="#evaluate-type-system">Evaluate</a> a recently-written type
    system, or a feature used by multiple type systems.
  </li>
  <li>
    <a href="#annotate-library">Annotate</a> a popular library, so that it
    is easier to type-check clients of the library.
  </li>
  <li>
    <a href="#create-new-type-system">Create</a> a new type system, to
    prevent some Java programming error.
  </li>
  <li>
    <a href="#cf-other">Enhance</a> a type system or the Checker Framework
    itself.
  </li>
</ul>

<p>
This document gives a few suggestions in each category.
</p>


<h2 id="apply">How to apply</h2>

<p>
  To <b>apply</b>, you will submit a single PDF through the Google Summer
  of Code website.  This PDF should contain two main parts.  We suggest
  that you number the parts and subparts to ensure that you don't forget anything, and
  to ensure that we don't overlook anything when reading your application.  You might find it
  easiest to create multiple PDFs for the different parts, then concatenate
  them before uploading to the website, but how you create your proposal is
  entirely up to you.
</p>

<ol>
  <li>The proposal itself:  what project you want to work on during the
    summer.  You might propose to do a project listed on this webpage, or
    you might propose a different project.

    <p>The proposal should have a descriptive title, both in the PDF and in
      the GSoC submission system.  Don't use a title like "Checker
      Proposal" or "Proposal for GSoC".  Don't distract from content with
      gratuitous graphics.

    <p>List the tasks or subparts that are required to complete your
    project.  This will help you discover a part that you had forgotten.
    We do not require a detailed timeline, because you don't yet
    know enough to create one.
    </p>

    <p>
    If you want to do a
    case study, say what program you will do your case study on.

    <p>If you want to create a new type system (whether one proposed on
    this webpage or one of your own devising), then your proposal should include
    the type system's user manual.  You don't have to integrate it in the Checker
    Framework repository (in other words, use any word processor or text
    editor you want to create a PDF file you will submit), but you should describe
    your proposed checker's <a href="https://checkerframework.org/manual/#creating-parts-of-a-checker">parts</a>
    in precise English or simple formalisms, and you should follow the
    suggested <a href="https://checkerframework.org/manual/#creating-documenting-a-checker">structure</a>.

    <p>
    If you want to do exactly what is already listed on this page, then
    just say that (but be specific about which one!), and it will not hurt
    your chances of being selected.  However, show us what progress you
    have made so far.  You might also give specific ideas
    about extensions, about details that are not mentioned on this webpage,
    about implementation strategies, and so forth.
    </p>

    <p>Never literally cut-and-paste text that was not written by you, because
    that would be plagiarism.  If you quote from text written by someone
    else, give proper credit.
    Don't
    submit a proposal that is just a rearrangement of text that already
    appears on this page or in the Checker Framework manual, because it does
    not help us to assess your likelihood of being successful.
    </p>

  </li>

  <li>Your qualifications.  Please convince us that you
    are likely to be successful in your proposed summer project.

    <ol>
      <li>A URL that points to a code sample.
        Don't write any new code, but provide code you wrote in the
        past, such as for a class assignment
        or a project you have worked on outside class.
        It does not need to have anything to do with
        the Checker Framework project.  It should be your own personal work.
        The purpose is to assess your programming skills so we can assign you
        to an appropriate project.
        A common problem is to submit undocumented code; we expect every
        programmer to write documentation when working on the Checker
        Framework.
        Don't put a lot of different files in Google Drive and share that
        URL; it's better to upload a single <code>.zip</code> file or
        provide a GitHub URL.
      </li>
      <li>
        What you have done to prepare yourself
        for working with the Checker Framework during the summer.
        You may wish to structure this as a list.
    Examples of items in the list include:
    <ul>
      <li>A URL for code you have annotated as a case study.  Please indicate the
    original unannotated code, the annotated code, and the exact command to
    run the type-checker from the command line.  Ensure that the GSoC
    mentors can compile your code.
    (It is acceptable to use the same code, or different code, for this
      item and the code sample above.)
      </li>
      <li>URLs for bugs or pull requests that you have filed.</li>
      <li>Information about other projects you have done, or classes you
        have taken, that prepare you for your proposed summer task.  This
        is optional, because it might already appear in your resume.</li>
    </ul>
  </li>
  <li>A resume.
    A <a href="https://en.wikipedia.org/wiki/R%C3%A9sum%C3%A9">resume</a>
    contains a brief description of your skills and your job or project
    experience.  It will often list classes you have taken so far and your
    GPA.  It should not be longer than one page.</li>
  <li>An unofficial transcript or grade report (don't spend
    money for an official one).</li>
  </ol>
  </li>
</ol>

<p>
The <b>best way</b> to impress us is by doing a thoughtful job in the case
study.  The case study is even more important than the proposal text,
because it shows us your abilities.
The case study may result in you submitting issues against the issue tracker of the
program you are annotating or of the Checker Framework.
Pull requests against our GitHub project are a plus but are not required:
good submitted bugs are just as valuable as bug fixes!
You can also make a good impression by correctly answering questions from
other students on the GSOC mailing list.
</p>

<p>
Get feedback!  Feel free to <a href="#ask-questions">ask questions</a>
to make your application more
competitive.  We want you to succeed.  Historically, students who start
early and get feedback are most successful.  You can submit a draft
proposal via the Google Summer of Code website, and we will review it.  We
do <em>not</em> receive any notification when you submit a draft
proposal, so if you want feedback, please tell us that.
Also, we can only see draft proposals; we cannot see final proposals until
after the application deadline has passed.
</p>


<h1 id="evaluate-type-system">Evaluate a type system or a Checker Framework feature</h1>

<p>
  These projects evaluate a recently-written type system or a feature used
  by multiple type systems.
  Using the type systems on real code is our most important source of new ideas and improvements.
  Many people have started out &ldquo;just&rdquo; doing a case
  study but have ended up making deep, fundamental contributions and even
  publishing scientific papers about their discoveries.
</p>

<p>
One possible outcome is to identify
  weaknesses in the type-checker so that we can improve it.  Another
  possible outcome is to provide evidence that the type-checker is
  effective and convince more users to adopt it.  You will probably
  also discover defects (bugs) in the codebase being type-checked.
</p>



<h2 id="case-study-signature">Signature strings</h2>

<p>
Determine whether the <a href="https://asm.ow2.org/">ASM library</a>, or
some other library, properly handles signature strings.
</p>

<p>
   Some challenging aspects of this case study are:
</p>
<ul>
  <li>
    Some libraries define their own new signature string formats (!), which
    you need to define in the Signature String Checker.
  </li>
  <li>
    Sometimes the library's documentation is incorrect, and in other cases the
    string format is not defined.
  </li>
</ul>


<h2 id="case-study-signedness">Signed and unsigned numbers</h2>

<p>
  The <a href="https://checkerframework.org/manual/#signedness-checker">Signedness
  Checker</a> ensures that you do not misuse unsigned values, such as
  by mixing signed and unsigned values in a computation or by performing a
  meaningless operation.
</p>

<p>
  Perform a case study of the Signedness Checker, in order to detect errors
  or guarantee that code is correct.
</p>

<p>
  You will need to find Java projects that use unsigned arithmetic, or
  that <em>could</em> use unsigned arithmetic but do not.
  When doing the case study, it is important to type-check both a library and
  a client that uses it.  Type-checking the client will ensure that the
  library annotations are accurate.
</p>

<p>
  Here are some libraries that you could annotate (some are already
  annotated for you).  You would need to find client code that uses the
  signedness-sensitive routines.
</p>
<ul>
  <li>In the JDK's <code>Integer</code>
  and <code>Long</code>, these include
   <code>compareUnsigned</code>,
   <code>divideUnsigned</code>,
   <code>parseUnsignedInt</code>,
   <code>remainderUnsigned</code>, and
   <code>toUnsignedLong</code>.
   <br/>
   Classes like <code>DataInputStream</code>, <code>ObjectInputStream</code>,
   and <code>RandomAccessFile</code> have <code>readUnsignedByte</code>.
   <br/>
   <code>Arrays</code> has <code>compareUnsigned</code>.
  </li>
  <li>
    In Guava, see
  its <a href="https://github.com/google/guava/wiki/PrimitivesExplained#unsigned-support">unsigned
  support</a>, such
  as <a href="https://google.github.io/guava/releases/snapshot-jre/api/docs/com/google/common/primitives/UnsignedBytes.html">UnsignedBytes</a>,
  <a href="https://google.github.io/guava/releases/snapshot-jre/api/docs/com/google/common/primitives/UnsignedLong.html">UnsignedLong</a>,
  <a href="https://google.github.io/guava/releases/snapshot-jre/api/docs/com/google/common/primitives/UnsignedLongs.html">UnsignedLongs</a>,
  etc.
  </li>
  <li>The <a href="https://github.com/jOOQ/jOOU">jOOU</a> library consists of support for unsigned
      integers.</li>
</ul>

<p>
  Here are some other possible case studies; you would need to determine
  whether this code is the library, the client, or both:
</p>
<ul>
  <li><a href="https://github.com/bcgit/bc-java">bc-java</a>.  This is
  over 200 KLOC of code.</li>

  <!-- Not a good choice because this is just example code, not an actively-maintained project.
  <li>Project
  Nayuki: <a href="https://www.nayuki.io/page/forcing-a-files-crc-to-any-value">CRC</a>, <a href="https://www.nayuki.io/page/notepadcrypt-format-decryptor-java">crypt</a>, <a href="https://www.nayuki.io/page/native-hash-functions-for-java">hash</a>.</li>
  -->

  <!-- Not a good choice because it is not under active development:
  <li><a href="https://bytonic.de/html/jake2.html">Jake2</a></li>
   -->
</ul>

<p>
  Your case studies will show the need for enhancements to the Signedness
  Checker.  For example, the Signedness Checker does not currently handle
  boxed integers and BigInteger; these haven't yet come up in case studies
  but could be worthwhile enhancements.  You may also need to
  write more annotations for libraries such as the JDK.
</p>


<h2 id="optional-case-study">Java's Optional class</h2>

<p>
Java 8 introduced the
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html"><code>Optional</code></a>
class, a container that is either empty or contains a non-null value.
It is intended to solve the problem of null
pointer exceptions.  However, <code>Optional</code> has <a href="https://homes.cs.washington.edu/~mernst/advice/nothing-is-better-than-optional.html">its own problems</a>.
</p>

<p>
Because of <code>Optional</code>'s problems, many commentators advise programmers to use
<code>Optional</code> only in limited ways.
</p>

<p>
The goal of this project is to evaluate
the <a href="https://checkerframework.org/manual/#optional-checker">Optional
    Checker</a>, which warns programmers who
have misused <code>Optional</code>.
Another goal is to extend the Optional Checker to make it more precise or
to detect other misuses of <code>Optional</code>.
</p>


<h2 id="Whole-program_type_inference">Whole-program type inference</h2>

<p>
A type system is useful because it prevents certain errors.  The downside
of a type system is the effort required to write the types.  Type inference
is the process of writing the types for a program.
</p>

<p>
The Checker Framework includes
a <a href="https://checkerframework.org/manual/#whole-program-inference">whole-program
    inference</a> that inserts type qualifiers in the user's program.
It works well on some programs, but needs more enhancements to work well on
all programs.
</p>


<h2 id="determinism">Determinism</h2>

<p>
Programs are easier to use and debug if their output is deterministic.  For
example, it is easier to test a deterministic program, because
nondeterminism can lead to flaky tests that sometimes succeed and sometimes
fail.  As another example, it is easier for a user or programmer to compare
two deterministic executions than two nondeterministic executions.
</p>

<p>
  We have created a prototype Determinism Checker.  It is documented in
  this <a href="https://checkerframework.org/determinism-checker-manual/manual.html#determinism-checker">draft
  manual chapter</a>, and its implementation is in
<a href="https://github.com/t-rasmud/checker-framework/tree/nondet-checker">t-rasmud/nondet-checker</a>.
You will do a case study of this type system.
</p>


<h2 id="sound-by-default">Sound checking by default</h2>

<p>
By default, the Checker Framework is
<a href="https://checkerframework.org/manual/#unsound-by-default">unsound
  in</a> <a href="https://checkerframework.org/manual/#nullness-lint">several</a>
<a href="https://github.com/typetools/checker-framework/issues/986">circumstances</a>.
&ldquo;Unsound&rdquo; means that the Checker Framework
may report no warning even though the program can misbehave at run time.
</p>

<p>
The reason that the Checker Framework is unsound is that we believe that
enabling these checks would cause too many false positive warnings:
warnings that the Checker Framework issues because it cannot prove that the
code is safe (even though a human can see that the code is safe).  Having
too many false positive warnings would irritate users and lead them not to
use the checker at all, or would force them to simply disable those checks.
</p>

<p>
We would like to do studies of these command-line options to see whether
our concern is justified.  Is it prohibitive to enable sound checking?  Or can we
think of enhancements that would let us turn on those checks that are
currently disabled by default?
</p>

<p>
There is no need to annotate new code for this project.  Just use existing
annotated codebases, such as those that are type-checked as part of the
Checker
Framework's <a href="https://github.com/typetools/checker-framework/blob/master/azure-pipelines.yml">Azure
    Pipeline</a>.  In other words, you can start by enabling Azure
Pipelines for your fork and then changing the default behavior in a
branch.  The Azure Pipelines job will show you what new warnings appear.
</p>


<h2 id="compare-other-tools">Comparison to other tools</h2>

<p>
  Many other tools exist for prevention of programming errors, such as
  Error Prone, NullAway, FindBugs, JLint, PMD, and IDEs such as Eclipse and
  IntelliJ.  These tools
  are not as powerful as the Checker Framework (some are bug finders rather
  than verification tools, and some perform a shallower analysis), but they
  may be easier to use.
  Programmers who use these tools wonder, "Is it worth my time to switch to
  using the Checker Framework?"
</p>

<p>
  The goal of this project is to perform a head-to-head comparison of as
  many different tools as possible.  You will quantify:
</p>

<ul>
  <li>the number of annotations that need to be written</li>
  <li>the number of bugs detected</li>
  <li>the number of bugs missed</li>
  <li>the number of false positive warnings</li>
</ul>

<p>
  This project will help programmers to choose among the different tools
  &mdash; it will show when a programmer should or should not use the
  Checker Framework.
  This project will also indicate how each tool should be improved.
</p>

<p>
  One place to start would be with an old version of a program that is
  known to contain bugs.  Or, start with the latest version of the program
  and re-introduce fixed bugs.  (Either of these is more realistic than
  introducing artificial bugs into the program.)  A possibility would be to
  use the Lookup program that has been used in previous case studies.
</p>


<h2 id="case-study-android-support">Android support annotations</h2>

<p>
Android uses its own annotations that are similar to some in the Checker
Framework.  Examples include the
<a href="https://tips.seebrock3r.me/annotations-to-support-your-contracts-609ff259d5df">Android
  Studio support annotations</a>,
  including <code>@NonNull</code>, <code>@IntRange</code>, <code>@IntDef</code>,
  and others.
</p>

<p>
The goal of this project is to implement support for these annotations.
That is probably as simple as creating aliased annotations
by calling method <code>addAliasedAnnotation()</code>
in <a href="https://checkerframework.org/api/org/checkerframework/framework/type/AnnotatedTypeFactory.html">AnnotatedTypeFactory</a>.
</p>

<p>
  Then, do a case study to show the utility (or not) of
  pluggable type-checking, by comparison with how Android Studio currently
  checks the annotations.
</p>


<h1 id="annotate-library">Annotate a library</h1>

<p>
  These projects annotate a library, so that it is easier to
  type-check clients of the library.  Another benefit is that this may find
  bugs in the library.  It can also give evidence for the usefulness of
  pluggable type-checking, or point out ways to improve the Checker
  Framework.
</p>


<p>
When type-checking a method call, the Checker Framework uses the method
declaration's annotations.
This means that in order to type-check code that uses a library, the
Checker Framework needs an annotated version of the library.
</p>

<p>
The Checker Framework comes with a
few <a href="https://search.maven.org/search?q=annotatedlib">annotated
libraries</a>.  Increasing this number will make the Checker Framework even
more useful, and easier to use.
</p>

<p>
After you have <a href="#choose-a-library">chosen a library</a>,
fork the library's source code, adjust
its <a href="https://checkerframework.org/manual/#external-tools">build
system</a> to run the Checker Framework, and add annotations to it until
the type-checker issues no warnings.
</p>

<p>
Before you get started, be sure to read
<a href="https://checkerframework.org/manual/#get-started-with-legacy-code">How
to get started annotating legacy code</a>.  More generally, read the
<a href="https://checkerframework.org/manual/#how-to-read-this-manual">relevant
sections of the Checker Framework manual</a>.
</p>


<h2 id="choose-a-library">Choosing a library to annotate</h2>

<p>
There are several ways to <b>choose a library</b> to annotate:
</p>
<ul>
  <li>
The best way to choose a library is to try to annotate a program and notice
that library annotations are needed in order to type-check the program.
</li>
<li>
Alternately, you can
    choose a <a href="https://docs.google.com/spreadsheets/d/17x_jKkGquEFq7LBQhS9HGXiG7iIl2AlXoPGfB6N5_bw">popular
      Java library</a>.
</li>
</ul>

<p>
  When annotating a library, it is important to type-check both the library
  and at least one client that uses it.  Type-checking the client will
  ensure that the library annotations are accurate.
</p>

<p>
  Whatever library you choose, you will need to deeply understand its
  source code.  You will find it easier to work with a library that is
  well-designed and well-documented.
</p>

<p>
  You should choose a library that is
  not <a href="https://github.com/typetools/checker-framework/tree/master/checker/lib">already
    annotated</a>.  There are two exceptions to this.
</p>
<ul>
  <li>
    A library might be annotated for one type system, but you add
    annotations for a different type system.  One advantage of this is that
    the library's build system is already set up to run the Checker
    Framework.  You can tell which type systems a library is annotated for
    by examining its source code.
  </li>
  <li>
    A library might be annotated, but the annotations have not been
    verified by running the type-checker on the library source code.  You
    would verify that the annotations in the library are correct.
  </li>
</ul>


<h2 id="case-study-nullness-guava">Guava library</h2>

<p>
  Guava is already partially annotated with nullness annotations &mdash; in
  part by Guava's developers, and in part by the Checker Framework team.
  However, Guava does not yet type-check without errors.  Doing so could
  find more errors (the Checker Framework has found nullness and indexing
  errors in Guava in the past) and would be a good case study to learn the
  limitations of the Nullness Checker.
</p>


<h1 id="create-new-type-system">Create a new type system</h1>

<p>
The Checker Framework is shipped with <a href="https://checkerframework.org/manual/#introduction">about 20 type-checkers</a>.  Users can
<a href="https://checkerframework.org/manual/#creating-a-checker">create a
  new checker</a> of their own.  However, some users don't want to go to
that trouble.  They would like to have more type-checkers packaged with the
Checker Framework for easy use.
</p>

<p>
Each of these projects requires you to design a <a href="https://checkerframework.org/manual/#creating-a-checker">new type system</a>,
implement it, and perform case studies to demonstrate that it is both
usable and effective in finding/preventing bugs.
</p>


<h2 id="non-empty-checker">Non-Empty Checker for precise handling of Queue.peek() and poll()</h2>

<p>
The Nullness Checker issues a false positive warning for this code:
</p>

<pre>
import java.util.PriorityQueue;
import org.checkerframework.checker.nullness.qual.NonNull;

public class MyClass {
    public static void usePriorityQueue(PriorityQueue&lt;@NonNull Object&gt; active) {
        while (!(active.isEmpty())) {
            @NonNull Object queueMinPathNode = active.peek();
        }
    }
}
</pre>

<p>
The Checker Framework does not determine that <code>active.peek()</code> returns a non-null value in this context.
</p>

<p>
The contract of <code>peek()</code> is that it returns a non-null value if the queue is not empty and the queue contains no null values.
</p>

<p>
To handle this code precisely, the Nullness Checker needs to know, for each queue, whether it is empty.
This is analogous to how the Nullness Checker tracks whether a particular
value <a href="https://checkerframework.org/manual/#map-key-checker">is a key in a map</a>.
</p>

<p>
It should be handled the same way:  by adding a new subchecker, called the
  Nonempty Checker, to the Nullness Checker.  Its types are:
</p>
<ul>
<li><code>@UnknownNonEmpty</code> &mdash; the queue might or might not be empty
<li><code>@NonEmpty</code> &mdash; the queue is definitely non-empty
</ul>

<p>
There is a start at this type-checker in branch <code>nonempty-checker</code>.  It:
</p>
<ul>
  <li>defines the annotations
  </li>
  <li>creates the integration into the Nullness Checker
  </li>
</ul>
<p>
However, it is not done.  (In fact, it doesn't even compile.)
For information about what needs to be done, see <a href="https://github.com/typetools/checker-framework/issues/399">issue #399</a>.
</p>

<p>
When you are done, the Nullness Checker should issue only the <code>// ::</code> diagnostics from <code>checker/tests/nullness/IsEmptyPoll.java</code> &mdash; no more and no fewer.
You can test that by running the Nullness Checker on the file, and when you are done you should delete the <code>// @skip-test</code> line so that the file is run as part of the Checker Framework test suite.
</p>


<h2 id="custom-tainting-checking">Custom tainting checking</h2>

<p>
The Checker Framework comes with
a <a href="https://checkerframework.org/manual/#tainting-checker">Tainting
  Checker</a> that is so general that it is not good for much of anything.
In order to be useful in a particular domain, a user must customize it:
</p>
<ul>
  <li>
    rename the <code>@Tainted</code> and <code>@Untainted</code> qualifiers
    to something more specific (such as <code>@Private</code>
    or <code>@PaymentDetails</code> or <code>@HtmlQuoted</code>), and
  <li>
    annotate libraries.
</ul>

<p>
The first part of this project is to make this customization easier to do
&mdash; preferably, a user will not have to change any code in the Checker
Framework (the
<a href="https://checkerframework.org/manual/#subtyping-checker">Subtyping
Checker</a> already works this way).
As part of making customization easier, a user should be able to specify
multiple levels of taint &mdash; many information classification hierarchies
have more than two levels (for example, the US government separates classified
information into three categories: Confidential, Secret, and Top Secret).
</p>

<p>
The second part of this project is to provide several examples, and do case
studies showing the utility of compile-time taint checking.
</p>

<p>
  Possible examples include:
</p>
<ul>
  <li>SQL injection
  <li>OS command injection
  <li>the <code>@PrivacySource</code> and <code>@PrivacySink</code>
    annotations used by the Facebook <a href="http://fbinfer.com/">Infer
    static analyzer</a>.
  <li>information flow
  <li>many of the <a href="http://cwe.mitre.org/top25/">CWE/SANS most
  dangerous software programming errors</a> (and the "on the cusp" ones too)
  <!-- More details appear in these files:
      ~/research/games/notes/notes
      ~/prof/grants/2012-02-darpa-verigames/proposal/top25-as-types.pdf
  -->
</ul>

<p>
For some microbenchmarks, see the Juliette test suite for Java from CWE.
</p>




<h2 id="overflow">Overflow checking</h2>

<p>
Overflow is when 32-bit arithmetic differs from ideal arithmetic.  For
example, in Java the <code>int</code> computation 2,147,483,647 + 1 yields
a negative number, -2,147,483,648.  The goal of this project is to detect
and prevent problems such as these.
</p>

<p>
One way to write this is as an extension of the Constant Value Checker,
which already keeps track of integer ranges.  It even already
<a href="https://checkerframework.org/manual/#value-checker-overflow">checks
  for overflow</a>, but it never issues a warning when it discovers
  possible overflow.  Your variant would do so.
</p>

<p>
This problem is so challenging that there has been almost no previous
research on static approaches to the problem.  (Two relevant papers are
<a href="https://www.researchgate.net/publication/221655385_IntScope_Automatically_Detecting_Integer_Overflow_Vulnerability_in_X86_Binary_Using_Symbolic_Execution">IntScope:
Automatically Detecting Integer Overflow Vulnerability in x86 Binary Using
Symbolic Execution</a> and
<a href="https://dl.acm.org/citation.cfm?id=3136872">Integer Overflow
Vulnerabilities Detection in Software Binary Code</a>.)  Researchers are
concerned that users will have to write a lot of annotations indicating the
possible ranges of variables, and that even so there will be a lot of false
positive warnings due to approximations in the conservative analysis.
For example, will every loop that contains <code>i++</code> cause a warning that <code>i</code> might overflow?
That would not be acceptable:  users would just disable the check.
</p>

<p>
You can convince yourself of the difficulty by manually analyzing programs
to see how clever the analysis has to be, or manually simulating your
proposed analysis on a selection of real-world code to learn its
weaknesses.  You might also try it
on <a href="https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html">good
  and bad binary search code</a>.
</p>

<p>
One way to make the problem tractable is to limit its scope:  instead of
being concerned with all possible arithmetic overflow, focus on a specific
use case.
As one concrete application,
the <a href="https://checkerframework.org/manual/#index-checker">Index
Checker</a> is currently unsound in the presence of integer overflow.  If
an integer <code>i</code> is known to be <code>@Positive</code>, and 1 is
added to it, then the Index Checker believes that its type
remains <code>@Positive</code>. If <code>i</code> was
already <code>Integer.MAX_VALUE</code>, then the result is negative &mdash;
that is, the Index Checker's approximation to it is unsound.
</p>

<p>
This project involves removing this unsoundness by implementing a type system to track when an
integer value might overflow &mdash; but this only matters for values that
are used as an array index.
That is, checking can be restricted to computations that involve an operand
of type <code>@IntRange</code>).
Implementing such an analysis would permit the Index Checker
to extend its guarantees even to programs that might overflow.
</p>

<p>
This analysis is important for some indexing bugs in practice.
Using the Index Checker, we found 5 bugs in Google
Guava related to overflow.  Google marked these as high priority and
fixed them immediately.  In practice, there would be a run-time exception
only for an array of size approximately <code>Integer.MAX_INT</code>.
</p>

<p>
You could write an extension of the Constant Value Checker, which already
keeps track of integer ranges and
even <a href="https://checkerframework.org/manual/#value-checker-overflow">determines
when overflow is possible</a>.  It doesn't issue a warning, but your
checker could record whether overflow was possible (this could be a
two-element type system) and then issue a warning, if the value is used as
an array index.
Other implementation strategies may be possible.
</p>

<p>
Here are some ideas for how to avoid the specific problem
of issuing a warning about potential overflow for every <code>i++</code> in
a loop (but maybe other approaches are possible):
</p>
<ul>
  <li>
    The loop checks whether <code>i == Integer.MAX_VALUE</code> before
    incrementing.  This wide-scale, disruptive code change is not
    acceptable.
  </li>
  <li>
    Make the default array size (the length of an unannotated array) be
    <code>@ArrayLenRange(0, Integer.MAX_VALUE-1)</code> rather
    than <code>@UnknownVal</code>, which is equivalent
    to <code>@ArrayLenRange(0, Integer.MAX_VALUE-1)</code>.  Now, every
    array construction requires the client to establish that the length is
    not <code>Integer.MAX_VALUE</code>.  I don't have a feel for whether
    this would be unduly burdensome to users.
  </li>
</ul>


<h2 id="index-checker-mutable-length">Index checking for mutable length data structures</h2>

<p>
The <a href="https://checkerframework.org/manual/#index-checker">Index
Checker</a> is currently restricted to fixed-size data structures.  A
fixed-size data structure is one whose length cannot be changed once it is
created, such as arrays and Strings.  This limitation prevents the Index
Checker from verifying indexing operations on mutable-size data structures,
like Lists, that have <code>add</code> or <code>remove</code>
methods. Since these kind of collections are common in practice, this is a
severe limitation for the Index Checker.
</p>

<p>
The limitation is caused by the Index Checker's use of types that are dependent on the length of data structures,
like <code>@LTLengthOf("data_structure")</code>. If <code>data_structure</code>'s length could change,
then the correctness of this type might change.
</p>

<p>
A naive solution would be to invalidate these types any time a method is called on <code>data_structure</code>.
Unfortunately, aliasing makes this still unsound. Even more, a great solution to this problem would keep
the information in the type when a method like add or remove is called on <code>data_structure</code>.
A more complete solution might involve some special annotations on List that permit the information to be persisted.
</p>

<p>
This project would involve designing and implementing a solution to this problem.
</p>


<h2 id="nullness-bug-detector">Nullness bug detector</h2>

<p>
Verifying a program to be free of errors can be a daunting task.  When
starting out, a user may be more interested in
<a href="https://checkerframework.org/manual/#other-tools">bug-finding</a>
than verification.  The goal of this project is to create a nullness bug
detector that uses the powerful analysis of the Checker Framework and its
Nullness Checker, but omits some of its more confusing or expensive
features.  The goal is to create a fast, easy-to-use bug detector.  It
would enable users to start small and advance to full verification in the
future, rather than having to start out doing full verification.
</p>

<p>
This could be structured as a new NullnessLight Checker, or as a
command-line argument to the current Nullness Checker.  Here are some
differences from the real Nullness checker:
</p>
<ul>
  <li>No initialization analysis; the checker assumes that every value is
  initialized.</li>
  <li>No map key analysis; assume that, at every call to
    <code>Map.get</code>, the given key appears in the map.</li>
  <li>No invalidation of dataflow facts.  Assume all method calls are pure,
  so method calls do not invalidate dataflow facts.  Assume there is no
    aliasing, so field updates do not invalidate dataflow facts.
    </li>
  <li>Assume that boxing of primitives is <code>@Pure</code>: it returns
  the same value on every call.</li>
  <li>If the Checker Framework cannot infer a type argument, assume that
  the type argument is <code>@NonNull</code>.</li>
</ul>
<p>
  Each of these behaviors should be controlled by its own command-line
  argument, as well as being enabled in the NullnessLight Checker.
</p>

<p>
  The implementation may be relatively straightforward, since in most cases
  the behavior is just to disable some functionality of existing checkers.
</p>

<p>Tools such as FindBugs, NullAway, NullnessLight, and the Nullness
  Checker form a spectrum from easy-to-use bug detectors to sound
  verification.  NullnessLight represents a new point in the design space.
  It will be interesting to compare these checkers:
</p>

<ul>
    <li>How much easier is it to use?  For example, how many fewer
      annotations need to be written?</li>
    <li>
      How many more fewer true positives does it report &mdash; in other
      words, how many more false negatives does it suffer?
    </li>
    <li>
      How many fewer false positives does it report?
    </li>
</ul>

<p>
  Uber's <a href="https://github.com/uber/NullAway">NullAway</a> tool is also
  an implementation of this idea (that is, a fast, but incomplete and
  unsound, nullness checker).  NullAway doesn't let the user specify Java
  Generics:  it assumes that every type parameter is <code>@NonNull</code>.
  Does Uber's tool provide users a good
  introduction to the ideas that a user can use to transition to a nullness
  type system later?
</p>



<h1 id="cf-other">Enhance the toolset</h1>


<h2 id="index-errors">Improving error messages</h2>

<p>
Compiler writers have come to realize that clarity of error
messages is as important as the speed of the executable
(<a href="http://www.brettbecker.com/wp-content/uploads/2016/06/Becker-Effective-2016-SIGCSE.pdf">1</a>, <a href="https://www.mville.edu/sites/default/files/p53-munson_1.pdf">2</a>,
<a href="http://se.ethz.ch/~meyer/publications/teaching/compiler-errors.pdf">3</a>,
<a href="http://static.barik.net/barik/publications/icse2017/PID4655707.pdf">4</a>).  This is especially true when the language or type system has rich features.
</p>

<p>
The goal of this project is to improve a compiler's error messages.  Here are
some distinct challenges:
</p>
<ul>
  <li>
    Some type errors can be more concisely or clearly expressed than the
    standard "found type A, expected type B" message.
  </li>
  <li>
    Some types are complex.  The error message could explain them, or link
    to the manual, or give suggested fixes.
  </li>
  <li>
    Compiler messages currently show
    the <a href="https://checkerframework.org/manual/#effective-qualifier">effective
    type</a>, which may be different than what the user wrote due to
    defaulting, inference, and syntactic sugar.  For example, a user-written
    <code>@IndexFor("a")</code> annotation is syntactic sugar for
    <code>@NonNegative @LTLengthOf("a")</code>, and those types are
    the ones that currently appear in error messages.
    It might be good to show simpler types or ones that the user wrote.
  </li>
  <li>
    Some checkers combine multiple cooperating type systems;
    the <a href="https://checkerframework.org/manual/#nullness-checker">Nullness
    Checker</a> and
    the <a href="https://checkerframework.org/manual/#index-checker">Index
    Checker</a> are examples.  If there is a problem with a variable's
    lower bound type, then its upper bound type should not be shown in the
    error message.  This will make the message shorter and more specific,
    and avoid distracting the user with irrelevant information.
  </li>
  <li>
    When a checker has multiple type systems, a type error or the lack of one may depend on facts from multiple type systems, and this should be expressed to the user.
  </li>
</ul>


<h2 id="flow-expression-parser">Flow expression parser</h2>

<p>
A number of type annotations take, as an
argument, <a href="https://checkerframework.org/manual/#java-expressions-as-arguments">a
Java expression</a>.  The parser for these is a hack.  The goal of this
project is to replace it by calls
to <a href="https://github.com/javaparser/javaparser">JavaParser</a>.
For example, the <code>FlowExpressions.Receiver</code> class, which
represents an AST, should be replaced by the JavaParser AST.
</p>

<p>
This task
should be straightforward, since JavaParser is already used in other parts
of the Checker Framework.
</p>


<h2 id="dataflow">Dataflow enhancements</h2>

<p>
The Checker
Framework's <a href="https://checkerframework.org/manual/#creating-dataflow">dataflow
    framework</a>
(<a href="https://checkerframework.org/manual/checker-framework-dataflow-manual.pdf">manual
    here</a>) implements flow-sensitive type refinement (local type
inference) and other features.  It is used in the Checker
Framework and also in <a href="http://errorprone.info/">Error Prone</a>,
<a href="https://github.com/uber/NullAway">NullAway</a>, and elsewhere.
</p>

<p>
There are a number
of <a href="https://github.com/typetools/checker-framework/issues?q=is%3Aopen+is%3Aissue+label%3ADataflow">open
issues</a> &mdash; both bugs and feature requests &mdash; related to the
dataflow framework.  The goal of this project is to address as many of
those issues as possible, which will directly improve all the tools that
use it.
</p>


<h2 id="Purity_analysis">Purity (side effect) analysis</h2>

<p>
A program analysis technique makes estimates about the current values of
expressions.  When a method call occurs, the analysis has to throw away
most of its estimates, because the method call might change any variable.
If the method is known to have no side effects, then the analysis doesn't
need to throw away its estimates, and the analysis is more precise.
</p>

<p>
For example, the Checker Framework unsoundly trusts but does not check
<a href="https://checkerframework.org/manual/#type-refinement-purity">purity annotations</a>.  This makes
the system vulnerable to programmer mistakes when writing annotations.  The
Checker Framework contains a sound checker for immutability annotations,
but it suffers too many false positive warnings and thus is not usable.  A
better checker is necessary.  It will also incorporate aspects of an escape
analysis.
</p>

<p>
Choosing an algorithm from the literature is the best choice, but there
still might be research work to do:  in the past, when implementing
algorithms from research papers, we have sometimes found that they did not
work as well as claimed, and we have had to enhance them.  One challenge is
that any technique used by pluggable type-checking to verify immutability
must be modular, but many side effect analyses require examining the whole
program.  The system should require few or no method annotations within
method bodies.  I'm not sure whether such a system already exists or we
need to design a new one.
</p>

<p>
Perhaps one of these existing side effect analyses could be used:
<a href="https://github.com/Sable/soot/wiki/Using-Side-Effect-Attributes">Soot</a>,
<a href="https://pdfs.semanticscholar.org/d2bd/29e20c99a10ab9d0c5ecf3acaf15606407d1.pdf">Geffken</a>.
</p>

<!--
For design and implementation ideas, see:
 * $qn/notes-purity
 * ~/prof/grants/2011-09-darpa-apac/phase3-extension-proposal
-->


<h2 id="javadoc">Javadoc support</h2>

<p>
Currently, type annotations are only displayed in Javadoc if they are
explicitly written by the programmer.  However, the Checker Framework
provides flexible defaulting mechanisms, reducing the annotation overhead.
This project will integrate the Checker Framework defaulting phase with
Javadoc, showing the signatures after applying defaulting rules.
</p>

<p>
There are other type-annotation-related improvements to Javadoc that can be
explored, e.g. using JavaScript to show or hide only the type annotations
currently of interest.
</p>



</body>
</html>

<!--  LocalWords:  GSoC uwplse codespecs randoop typetools blogosphere Shi
 -->
<!--  LocalWords:  Marks's Bikesheds ICST Gyori Legunsen Marinov NonDex bc
 -->
<!--  LocalWords:  PossiblyNonDeterministic PossiblyNonDeterministicOrder
 -->
<!--  LocalWords:  DeterministicOrder Bazel PossbilyPropagatable Lazar tex
 -->
<!--  LocalWords:  NotPropagatable JavaParser contravariantly mortem EnerJ
 -->
<!--  LocalWords:  unsoundnesses nondeterministic nondeterministically ASM
 -->
<!--  LocalWords:  deterministically prototyped Stateful plugins plugin
 -->
<!--  LocalWords:  PDFs Stubparser JLint NullnessLight bytecodes YourKit
 -->
<!--  LocalWords:  timeline Uber's NullAway Uber coala BCEL mvn BCEL's AFU
 -->
<!--  LocalWords:  Signedness Jake2 README Lookup ASM's Nayuki CRC mis CWE
 -->
<!--  LocalWords:  BigInteger lockB lockA signedness microbenchmarks pre
 -->
<!--  LocalWords:  checklink subparts UnsignedBytes runtime MyClass jOOU
 -->
<!--  LocalWords:  usePriorityQueue PriorityQueue queueMinPathNode didn
 -->
<!--  LocalWords:  subchecker IntScope UnsignedLong UnsignedLongs doesn
 -->
<!--  LocalWords:  rasmud nondet Geffken
 -->