Specification-based component retrieval by means of examples

Software components such as functions, modules and classes should be reused in order to reduce development cost of the application. The situation is essentially the same for databases. Reuse of such components requires a retrieval facility based on its specification. We represent the specification of a component using a set, and propose a retrieval mechanism using a sample containing positive and negative entities. The mechanism enables polynomial time retrieval. Moreover the mechanism provides user assistance for sample construction. We have proposed the notion of element dictionary in our recent paper. A sample which identifies the target set can always be constructed using the element dictionary. We propose two methods to minimize the sample size which corresponds to the sample construction cost. The first one is to retrieve entities from the element dictionary using a user specified query. Another one is based on the weight of each entity. The user selects an appropriate entity from the entity list presented by the system. These two methods can be combined to retrieve the target set using a log n size sample among n sets in most cases.