747Accesses
29Citations
Abstract
The process of understanding and reusing software is often time-consuming, especially in legacy code and open-source libraries. While some core code of open-source libraries may be well-documented, it is frequently the case that open-source libraries lack informative API documentation and reliable design information. As a result, the source code itself is often the sole reliable source of information for program understanding activities. In this article, we propose a reverse-engineering approach that can provide assistance during the process of understanding software through the automatic recovery of hidden design patterns in software libraries. Specifically, we use ontology formalism to represent the conceptual knowledge of the source code and semantic rules to capture the structures and behaviors of the design patterns in the libraries. Several software libraries were examined with this approach and the evaluation results show that effective and flexible detection of design patterns can be achieved without using hard-coded heuristics.
This is a preview of subscription content,log in via an institution to check access.
Access this article
Subscribe and save
- Get 10 units per month
- Download Article/Chapter or eBook
- 1 Unit = 1 Article or 1 Chapter
- Cancel anytime
Buy Now
Price includes VAT (Japan)
Instant access to the full article PDF.








Similar content being viewed by others
Notes
Although they have a few distinguishing features, we use the terms ‘library’, ‘framework’, and ‘software system’ interchangeably.
The Mediator pattern is also supported but no results included since Semaptrec did not recover any pattern instances in these frameworks and other tools do not support this pattern.
References
Alnusair, A., Zhao, T.: Towards a model-driven approach for reverse engineering design patterns. In: 2nd International Workshop on Transforming and Weaving Ontologies in Model Driven Engineering (TWOMDE’09) at ACM/IEEE MoDELS’09. Denver CO., USA (2009)
Alnusair, A., Zhao, T.: Source Code Representation Ontology (SCRO), Design Pattern Ontologies, and Framework Ontologies. (2012) Available online athttp://www.indiana.edu/~awny/index.php/research/ontologies
Balanyi, Z., Ferenc, R.: Mining design patterns from C++ source code. In: Proceedings of the 19th IEEE International Conference on Software Maintenance (ICSM’03), pp. 305–314. The Netherlands, Amsterdam (2003)
Berners-Lee, T., Hendler, J., Lassila, O.: The semantic web. Sci. Am.284(5), 34–43 (2001)
Binun, A., Kniesel, G.: DPJF-design pattern detection with high accuracy. In: Proceedings of the 16th European Conference on Software Maintenance and Reengineering (CSMR’12), pp. 245–254. Szeged, Hungary (2012)
Chen, L., Shadbolt, N.R., Globe, C.A.: A semantic web-based approach to knowledge management for grid applications. IEEE Trans. Knowl. Data Eng.19(2), 283–296 (2001)
Cinneide, M.O., Nixon, P.: A methodology for the automated introduction of design patterns. In: Proceedings of the IEEE International Conference on Software Maintenance (ICSM’99), pp. 463–472. UK, Oxford (1999)
De Lucia, A., Deufemia, V., Gravino, C., Risi, M.: Behavioral pattern identification through visual language parsing and code instrumentation. In: Proceedings of 13th European Conference on Software Maintenance and Reengineerig (CSMR’09), pp. 99–108. Kaiserslautern, Germany (2009)
De Lucia, A., Deufemia, V., Gravino, C., Risi, M.: Improving behavioral pattern detection through model checking. In: Proceedings of 14th European Conference on Software Maintenance and Reengineerig (CSMR’10), pp. 176–185. Spain, Madrid (2010)
Dietrich, J., Elgar, C.: A formal description of design patterns using OWL. In: Proceedings of the Australian Software Engineering Conference (ASWEC 2005), pp. 243–250. Brisbane, Australia (2005)
Dietrich, J., Elgar, C.: Towards a web of patterns. In: Workshop on Semantic Web Enabled Software Engineering (SWESE), pp. 117–132. Galway, Ireland (2005)
Emami, M., Rakesh, G., Hendren, L.: Context-sensitive interprocedural points-to analysis in the presence of function pointers. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’94), pp. 242–256 (1994)
Falbo, R., Guizzardl, G., Duarte, K.C., Natali, A.C.: Developing software for and with reuse: an ontological approach. In: ACIS International Conference on Computer Science, Software Engineering, Information Technology, e-Business and Applications (CSITeA-2002), pp. 311–316. Foz do Iguacu, Brazil (2002)
Ferenc, R., Beszedes, A., Fulop, L., Lele, J.: Design patterns mining enhanced by machine learning. In: Proceedings of the 21st IEEE International Conference on Software Maintenance (ICSM’05), pp. 295–304. Budapest, Hungary (2005)
Gamma, E., Helm, E., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional Computing Series (1995)
Gruber, T.R.: A translation approach to portable ontology specification. Knowl. Acquis.5(2), 192–220 (1993)
Guéhenéuc, Y.G.: P-MARt: pattern-like micro architecture repository (2007). Retrieved 27 July 2012, fromhttp://ptidej.dyndns.org/downloads/pmart/
Guéhenéuc, Y.G., Antoniol, G.: DeMIMA: a multilayered approach for design pattern identification. IEEE Trans. Softw. Eng.34(5), 667–684 (2008)
Horrocks, I.: Ontologies and the semantic web. Commun. ACM51(12), 58–67 (2008)
Jasper, R.J., Uschold, M.F.: A framework for understanding and classifying ontology applications. In: IJCAI99 Workshop on Ontologies and Problem-Solving Methods. Stockholm, Sweden (1999)
Kirasić, D., Basch, D.: Ontology-based design pattern recognition. In: Proceedings of the International Conference on Knowledge-Based and Intelligent Information and Engineering Systems (KES’08), pp. 384–393 (2008)
Kramer, C., Prechelt, L.: Design recovery by automated search for structural design patterns in object oriented software. In: Proceedings of Working Conference on Reverse, Engineering (WCRE96), pp. 208–215 (1996)
Manola, F., Miller, E.: RDF primer. W3C Recommendation (2004). Retrieved July 7 2012, fromhttp://www.w3.org/TR/rdf-primer/
Motik, B., Grau, B.C., Sattler, U.: Structured objects in OWL: representation and reasoning. In: Proceedings of the International World Wide Web Conference (WWW’08), pp. 555–564. Beijing, China (2008)
Motik, B., Patel-Schneider, P.F., Grau, B.C.: OWL Web Ontology Language Reference. W3C Recommendation (2009). Retrieved 4 July 2012, fromhttp://www.w3.org/TR/owl2-direct-semantics/
Noy, F.N., McGuinness, D.L.: Ontology Development 101: A Guide to Creating your First Ontology. Stanford Knowledge System Laboratory Technical Report KSL-01-05 and Stanford Medical Informatics Technical, Report. SMI-2001-0880 (2001)
O’Connor, M.J., Knublauch, H., Tu, S., Grosof, B., Dean, M., Grosso, W., Musen, M.: Supporting rule systems interoperability on the semantic web with SWRL. In: Proceedings of the 4th International Semantic Web Conference. Galway, Ireland (2005)
Olson, D.L., Delen, D.: Advanced Data Mining Techniques. Springer, Verlag (2008)
Prud’hommeaux, E., Seaborne, A.: SPARQL query language for RDF. W3C Recommendation (2008). Retrieved 7 July 2012, fromhttp://www.w3.org/TR/rdf-sparql-query/
Rasool, G., Mader, P.: Flexible design pattern detection based on feature types. In: Proceedings of the International Conference on Automated Software Engineering (ASE’11), pp. 243–252. Lawrence, KS, USA (2011)
Sartipi, K., Hu, L.: Behavior-driven design pattern recovery. In: Proceedings of the Twelfth International Conference on Software Engineering and Applications(SEA’08), pp. 179–185. Orlando, Florida, USA (2008)
Shi, N., Olsson, R.A.: Reverse engineering of design patterns from Java source code. In: Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering (ASE’06), pp. 123–132. Tokyo, Japan (2006)
Sirin, E., Parsia, B., Grau, B.C., Kalyanpur, A., Kartz, Y.: Pellet: a practical OWL-DL reasoner. Web Semant. Sci Serv. Agents World Wide Web5(2), 51–53 (2007)
Tsantalis, T., Stephanides, A., Halkidis, S.: Design pattern detection using similarity scoring. IEEE Trans. Softw. Eng.32(11), 896–909 (2006)
Uschold, M., Healy, M., Williamson, K., Clark, P., Woods, S.: Ontology reuse and application. In: Proceedings of the 1st International Conference on Formal Ontology in Information Systems (FOIS 1998), pp. 179–192 (1998)
Wang, W., Tzerpos, V.: Design pattern detection in Eiffel systems. In: Proceedings of the 12th Working Conference on Reverse, Engineering (WCRE’05), pp. 165–174 (2005)
Author information
Authors and Affiliations
Indiana University, Kokomo, IN, 46904, USA
Awny Alnusair
University of Wisconsin-Milwaukee, Milwaukee, WI, 53201, USA
Tian Zhao
University of Southern Indiana, Evansville, IN, 47712, USA
Gongjun Yan
- Awny Alnusair
You can also search for this author inPubMed Google Scholar
- Tian Zhao
You can also search for this author inPubMed Google Scholar
- Gongjun Yan
You can also search for this author inPubMed Google Scholar
Corresponding author
Correspondence toAwny Alnusair.
Additional information
A. Alnusair was partially supported by the Indiana University fellowship research grant.
Rights and permissions
About this article
Cite this article
Alnusair, A., Zhao, T. & Yan, G. Rule-based detection of design patterns in program code.Int J Softw Tools Technol Transfer16, 315–334 (2014). https://doi.org/10.1007/s10009-013-0292-z
Published:
Issue Date:
Share this article
Anyone you share the following link with will be able to read this content:
Sorry, a shareable link is not currently available for this article.
Provided by the Springer Nature SharedIt content-sharing initiative