The results of a joint research project between several universities about improving the state of code completion was demonstrated.
In a world where we are constantly faced with larger and larger APIs, many of which have limited documentation, or we simply lack the time and experience to gain insight into how to correctly use them. Improved code completion can be used to help the problem by using existing patterns found in code to offer suggestions based on the current context.
Auto-method completion:
- Analyse current method and calculate probability for the use of each method in the list of possibilities
Improving code templates:
- Templates are very useful, especially with frameworks such as SWT. However, we don't often take the time to identify when they can be used and write them.
- Solution: dynamic templates
- Figure out how a variable was used before and offer suggestions based on that
- If you create certain objects, you tend to initialise it the same way over and over again
- Annotation recommendations for annotations, which will be used extensively in E4
- Multiple hops (call chains) to get at member for assignment
- Search API graph and find matching paths
- Collect stats to improve recommendations in complex APIs
- Documentation gets outdated quickly and mistakes are made (i.e., parameters or conditions not updated)
- Generated documentation is often obvious and not useful
- Help users by extracting common usage patterns to help with the correct use of a class or method; leverage existing bodies of code, and provide extended documentation based on this information
- When extending a class, recommend what methods should be overridden based on previous use
Code snippet search:
- Search on-line snippet repository and insert directly into code
- Generate snippit repositories based on existing bodies of code
- How do I use this variable?
- Analyse current code to see how it is being used and display suggestions
- Helpful alternative to find type functionality
Future work:
- Collect user usage data centrally
- Users can rate suggestions; then take this into account
- Identify API problems based on suggestions (e.g., if something always has to be set, but isn't)
No comments:
Post a Comment