[Checkers] Ideas for reducing verbosity of annotations

Mahmood Ali mahmood at MIT.EDU
Thu Jun 4 06:56:19 EDT 2009


Greetings Mike,

In our next meeting, I would like to know more about:

1. What defaults daikon currently uses (e.g. do you mainly use NNEL  
nullness default?)?  How/Why is applying different defaults in other  
classes relevant?

2. For handling cases where method return null if nothing is found,  
how does Flow handle them?

Comments on the new default schemes:
>    * syntactically containing elements (variable, method, class,  
> package)
I assume that we are handling that.
>    * the overridden method declaration
I think that this very useful especially if you have deep hierarchy.   
We should definitely go for it.  However, personally, I prefer having  
an InheritQualifiers meta annotation, at least until we have a  
defaults tool.

>    * the declaration of the type (whose qualifier we are trying to  
> determine)
Do you have an idea of how helpful this is?  Roughly how many  
annotations would it reduce?

For the tools:
> * A tool that determines the current annotation on a given type.   
> This can
>   be looked up in the classfile (complication:  flow-sensitive type
>   refinement), or written using the checker framework.
This is a necessity I think if we support any more complicated default.

> * A tool that identifies all extraneous annotations (for instance, a
>   programmer write add a default and see how many annotations it makes
>   redundant).
> * A tool that converts from one set of defaults to another,
>   adding/removing source code annotations as appropriate in such a way
>   that the semantics of the program is preserved (the effective  
> qualifier
>   on each variable remains the same).
While these are useful (especially for us), I doubt that programmers  
once they annotate the codebase they would go back and spend time  
doing manual work to minimize the annotations.

> * An "annotation minimizer" that determines the set of defaults that
>   minimizes the annotations in a given codebase.
I like this, as long as the minimization doesn't hinder code  
understandability.

My general comment about the tools (which I assume you are already  
aware of): I think that that the potential users are more concerned  
about actually manually writing a lot of annotations rather than the  
final number of annotations in the code.  All of these tools (but the  
first) help the programmers reduce the number of final annotations but  
the programmer would still need to go over the first overhead of  
writing them.

Regards,
Mahmood





More information about the checkers mailing list