6 Interesting Ideas from Research Papers about Java

There are a lot of research papers related with Java. If we type “Java programming”, there are more than a million result in Google scholar. Some papers are very theoretical, some seem to be practical. I recently found some ideas are pretty interesting, so I collect them and create a list. These papers are from world top software engineering conferences.

1. Automatically Insert Blank Lines to Improve Code Readability

As a coding convention, programmers use blank line to separate different logical sections in a Java method. When a method does not contains blank lines, the technique presented in this paper can insert blank lines.

Paper Link 1, Paper Link 2

2. Automatically Identify One of the Most Common Idioms – Loops-If

Code idioms are code fragments that recur frequently across software projects and have a single semantic purpose. This paper detect loops that contains a single if, such as the following:

for (Iterator<RepoSource> it=mSources.iterator(); it.hasNext(); ) {
  RepoSource s=it.next();
  if (s.isUserSource()) {
    it.remove();
  }
}

Such a structure does 12 common things, such as find an element, count, filter, etc. If the idea is implemented, old version Java might be migrated to Java 8 Stream API automatically.

Paper Link 1, Paper Link 2

3. Mine idioms from source code

This paper presents a technique which automatically retrieve all common code idioms. It is interesting to see that one of the most common idioms is:

Document doc=Jsoup.connect(URL). userAgent("Mozilla"). header("Accept","text/html"). get();

Of course, the result depends on what open source projects they use for the mining purpose.

Paper Link

4. Mine Code Examples from Open Source Projects

The technique presented in this paper can recommend code examples based on context. I always hope there is a tool that can recommend the next line based on the code that has already been typed. Hopefully such a tool can come out of research lab soon.

Paper Link 1, Paper Link 2

5. Generate Comment for Source Code by Using Stack Overflow

Comments improve program comprehension and software maintainability. It is beneficial to generate code comments automatically. In this paper, they propose a general approach to generate code comments automatically by analyzing existing open source projects and Stack Overflow posts. They discover similar code and use the description on Stack Overflow to describe the other similar code segments.

Paper Link

6. Generate Comment from Source Code

Comments improve program comprehension and software maintainability. This paper summarizes the comment generation work.

Paper Link

Those ideas are pretty cool. Hopefully they can release their implementation soon.

Leave a Comment