Asheq Hamid

Graduation Semester and Year




Document Type


Degree Name

Master of Science in Computer Science


Computer Science and Engineering

First Advisor

Christoph Csallner


In an Object Oriented Program, we often see that a package contains several classes, a class contains several methods, a method calls other methods. We may say, there is a contains relationship between a package and a class or a calls relationship between two methods. We refer to these relationships as structural relationships. There may be other structural relationships apart from contains or calls in the source code. A software developer may sometime want to search for structural relationships within source code. She may prefer using Google like free form query to do so. To facilitate free form query based structural relationship search in the source code, we have proposed a code search system. Our system allows a user to type free form query and find structural relationships from the code repository relevant to that query. We consider an Entity Relationship Model where class, method etc. are entities and structural relations between entities are the actual relations. We construct a directed data graph taking each entity element as a node and each relation between elements as an edge. Each node in the data graph has a name (such as foo) and a type (such as method). Each edge has a type (such as calls). For each node, we construct a neighborhood document that lists the names and types of the nodes and types of the edges within edge length d from that node along with their respective distance score. The closer is the node or edge from the given node, the higher is the distance score. We use these neighborhood documents to construct inverted index and then do a Google like search. We find the nodes in the data graph where all the query keywords can be found in the neighborhood and order the nodes based on a simple ranking mechanism. To verify the effectiveness of our proposed code search model, we have implemented a prototype considering one structural relation. We have come up with some possible user queries and evaluated our system for each of those queries. Our experiment findings show that, our system is fairly successful in finding out the related structural relationships the user may be looking for.


Computer Sciences | Physical Sciences and Mathematics


Degree granted by The University of Texas at Arlington