Manuel Fähndrich and K. Rustan M. Leino

Manuel Fähndrich and K. Rustan M. Leino

Article: Declaring and Checking Non-null Typesin an Object-Oriented LanguageAuthors: Manuel Fähndrich and K. Rustan M. Leino

Authors• Manuel Fähndrich• Diplome, Ecole Polytechnique Fédérale de Lausanne (1993)• PhD, University of California, Berkeley (1998)• Senior Researcher, Microsoft−PLA, Programming Languages and Analysis• K. Rustan M. Leino• BA, The University of Texas at Austin (1989)• MS, California Institute of Technology (1993)• PhD, California Institute of Technology (1995)• Principal Researcher, Microsoft−−RiSE, Research in Software EngineeringLeads the Spec# project

Article• Published: 2003• OOPSLA'03• Conference on Object-Oriented Programming, Systems,Languages, and Applications

Article Outline• Introduction• Non-null types• Adding non-null to C#• Implementation of checker• Experiment• Design alternatives• Related work• Conclusion

Introduction• What is “null”?• What is the problem with “null”?• Basicly, handling a value that does not exists• NullReferenceException• ArgumentNullException

Non-null type• What is “non-null”?• T+, types including null, “possible-null”• T-, “proper objects”• What is the advantages?• Removal of null types and exceptions

Non-null in C#• Local variables• Construction of objects• this• Traw, “partially initialised”• Class frames• Array types• Value types, structs• Call-by-reference (ref)• Static class fields

Implementation• Adds custom attributes to C#• [MayBeNull], [Raw]• [NotNull], [Inits]• Checker at CIL level• Not all is implemented• Assumes e.g. thread-safety

Experiment• Checks one of their old projects• ~20.000 lines of code• Validated ~8000 places• Found higher-level design issues• Annotation density• Fairly low− (2.6% of fields, 0.5% of parameters)• Shortcomings

Finalizing• Design alternatives• Constructor in three parts• Related work• Conclusion

My Comments• Article• Implementation lacks a bit• Probably been used in Spec#• Non-null types• Not in C# today• Raised with the C++ “null-pointer exception”− Often a sign of bad code• Good example of how lazy we are!


More magazines by this user
Similar magazines