User interface code can be complex and buggy. Moreover, designing user-friendly interfaces can be difficult. One way around this is to reuse interfaces others have written and tested. We are developing a framework whereby the user provides a sketch of the desired interface and we use code search over open source repositories to find existing user implementations that have an interface similar to the sketch. The tool we have developed extracts user interfaces from the open source applications, matches them against the user’s sketch, lets the programmer interact with the results, supports minor editing of the results, and then returns working code for any selected interfaces.
This talk will show the underlying test-based code search tool, demonstrate our new front end for investigating search results using various search engines, and describe the techniques used to analyze the user’s sketch, extract runnable user interface code from the results of code search, match the interfaces to the user’s sketch, and provide an interactive and editable view of the result.