Skip to main content
Log in

Visual exploration of dependency graph in source code via embedding-based similarity

  • Regular Paper
  • Published:
Journal of Visualization Aims and scope Submit manuscript

Abstract

 A large software system contains millions of lines of source code, and the development often involves many developers over a long period. How to understand and analyze its complex code dependencies is challenging but meaningful to developers for program comprehension. In this paper, we propose a novel visual analytics system to explore code dependencies between files for visually understanding software architecture and interactively analyzing bad dependencies. The dependencies between files are abstracted as a directed graph (i.e., the dependency graph) at different levels via the file hierarchy to show the modularization design of source code. Node embeddings of the dependency graph are learned to identify the files with specific dependencies and analyze the similarity between bad dependencies. Finally, we evaluate the usability of our system by two case studies in different JavaScript libraries as well as a user study on software architecture understanding and bad dependency analysis.

Graphic abstract

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

Notes

  1. https://vuejs.org/.

  2. https://nodejs.org/.

  3. https://babeljs.io/.

  4. https://github.com/snap-stanford/graphwave.

  5. https://github.com/aditya-grover/node2vec.

  6. https://d3js.org/.

References

  • Al-Mutawa HA, Dietrich J, Marsland S, McCartin C (2014) On the shape of circular dependencies in java programs. In: IEEE 2014 23rd Australian software engineering conference, pp 48–57

  • Balzer M, Deussen O (2005) Exploring relations within software systems using treemap enhanced hierarchical graphs. In: 3rd IEEE international workshop on visualizing software for understanding and analysis, pp 1–6

  • Chen Y, Guan Z, Zhang R, Du X, Wang Y (2019) A survey on visualization approaches for exploring association relationships in graph data. J Vis 22(3):625–639

    Article  Google Scholar 

  • Daniel DT, Wuchner E, Sokolov K, Stal M, Liggesmeyer P (2014) Polyptychon: a hierarchically-constrained classified dependencies visualization. In: 2014 2nd IEEE working conference on software visualization, pp 83–86

  • Dietrich J, Yakovlev V, McCartin C, Jenson G, Duchrow M (2008) Cluster analysis of java dependency graphs. In: Proceedings of the 4th ACM symposium on software visualization, pp 91–94

  • Donnat C, Zitnik M, Hallac D, Leskovec J (2018) Learning structural node embeddings via diffusion wavelets. In: Proceedings of the 24th ACM SIGKDD International conference on knowledge discovery and data mining, pp 1320–1329

  • Grover A, Leskovec J (2016) node2vec: Scalable feature learning for networks. In: Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp 855–864

  • Hamilton WL, Ying R, Leskovec J (2017) Representation learning on graphs: methods and applications. IEEE Data Eng Bull 40:52–74

    Google Scholar 

  • Holmes R, Ratchford T, Robillard MP, Walker RJ (2009) Automatically recommending triage decisions for pragmatic reuse tasks. In: 2009 IEEE/ACM international conference on automated software engineering, pp 397–408

  • Holmes R, Walker RJ (2007) Supporting the investigation and planning of pragmatic reuse tasks. In: 29th International conference on software engineering (ICSE’07), pp 447–457

  • Holmes R, Walker RJ (2007) Task-specific source code dependency investigation. In: 2007 4th IEEE international workshop on visualizing software for understanding and analysis, pp 100–107

  • Holmes R, Walker RJ (2008) Lightweight, semi-automated enactment of pragmatic-reuse plans. In: International conference on software reuse, Springer, pp 330–342

  • Holten D (2006) Hierarchical edge bundles: visualization of adjacency relations in hierarchical data. IEEE Trans Vis Comput Gr 12(5):741–748

    Article  Google Scholar 

  • Holten D, Van Wijk JJ (2009) A user study on visualizing directed edges in graphs. In: Proceedings of the SIGCHI conference on human factors in computing systems, pp 2299–2308

  • Koschke R (2003) Software visualization in software maintenance, reverse engineering, and re-engineering: a research survey. J Softw Maint Evol Res Pract 15(2):87–109

    Article  Google Scholar 

  • Lanza M, Ducasse S, Gall H, Pinzger M (2005) Codecrawler: an information visualization tool for program comprehension. In: Proceedings of the 27th international conference on Software engineering, pp 672–673

  • Laval J, Denier S, Ducasse S, Bergel A (2009) Identifying cycle causes with enriched dependency structural matrix. In: 2009 16th Working conference on reverse engineering, pp 113–122

  • Laval J, Ducasse S (2014) Resolving cyclic dependencies between packages with enriched dependency structural matrix. Softw Pract Exp 44(2):235–257

    Article  Google Scholar 

  • Lewerentz C, Noack A (2004) Crococosmos—3d visualization of large object-oriented programs. In: Graph drawing software, Springer, pp 279–297

  • Lopes CV, Bajracharya SK (2005) An analysis of modularity in aspect oriented design. In: Proceedings of the 4th international conference on aspect-oriented software development, pp 15–26

  • Maaten Lvd, Hinton G (2008) Visualizing data using t-sne. J Mach Learn Res 9(Nov):2579–2605

    MATH  Google Scholar 

  • MacCormack A, Rusnak J, Baldwin CY (2006) Exploring the structure of complex software designs: an empirical study of open source and proprietary code. Manag Sci 52(7):1015–1030

    Article  Google Scholar 

  • Melton H, Tempero E (2006) Identifying refactoring opportunities by identifying dependency cycles. In: Proceedings of the 29th australasian computer science conference, vol 48, pp 35–41

  • Melton H, Tempero E (2007) Jooj: real-time support for avoiding cyclic dependencies. In: Proceedings of the thirtieth Australasian conference on computer science, vol 62, pp 87–95

  • Mumtaz H, Latif S, Beck F, Weiskopf D (2019) Exploranative code quality documents. IEEE Trans Vis Comput Gr 26:1129–1139

    Google Scholar 

  • Perozzi B, Al-Rfou R, Skiena S (2014) Deepwalk: Online learning of social representations. In: Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp 701–710

  • Pinzger M, Graefenhain K, Knab P, Gall HC (2008) A tool for visual understanding of source code dependencies. In: 2008 16th IEEE International conference on program comprehension, pp 254–259

  • Reniers D, Voinea L, Telea A (2011) Visual exploration of program structure, dependencies and metrics with solidsx. In: 2011 6th International workshop on visualizing software for understanding and analysis (VISSOFT), pp 1–4

  • Ribeiro LF, Saverese PH, Figueiredo DR (2017) struc2vec: Learning node representations from structural identity. In: Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining, pp 385–394

  • Sangal N, Jordan E, Sinha V, Jackson D (2005) Using dependency models to manage complex software architecture. In: ACM Sigplan notices, vol 40, pp 167–176

  • Seider D, Schreiber A, Marquardt T, Brüggemann M (2016) Visualizing modules and dependencies of OSGI-based applications. In: 2016 IEEE working conference on software visualization (VISSOFT), pp 96–100

  • Snyder A (1986) Encapsulation and inheritance in object-oriented programming languages. In: ACM Sigplan notices, vol 21, pp 38–45

  • Telea A, Hoogendorp H, Ersoy O, Reniers D (2009) Extraction and visualization of call dependencies for large c/c++ code bases: a comparative study. In: 2009 5th IEEE International workshop on visualizing software for understanding and analysis, pp 81–88

  • Wermelinger M, Yu Y, Lozano A (2008) Design principles in architectural evolution: a case study. In: 2008 IEEE international conference on software maintenance, pp 396–405

  • Yoshida N, Higo Y, Kamiya T, Kusumoto S, Inoue K (2005) On refactoring support based on code clone dependency relation. In: 11th IEEE international software metrics symposium (METRICS’05), p 10

Download references

Acknowledgements

This work was supported by the National Key Research & Development Program of China (2016YFC1401504), National Natural Science Foundation of China (61672452, 61890954, and 61972343), and NSFC-Guangdong Joint Fund (U1611263).

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Yubo Tao or Hai Lin.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary material 1 (mp4 71001 KB)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Liu, H., Tao, Y., Huang, W. et al. Visual exploration of dependency graph in source code via embedding-based similarity. J Vis 24, 565–581 (2021). https://doi.org/10.1007/s12650-020-00727-x

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12650-020-00727-x

Keywords

Navigation