zoukankan      html  css  js  c++  java
  • Visualize Code with Visual Studio


    In this post, App Dev Manager Ed Tovsen spotlight the features and benefits of Code Maps in Visual Studio.


    Systems architects have long used modeling to design the structure, behavior, and interaction of systems within an organization. Modeling helps to ensure that requirements are clearly defined between users and IT. Models are created with varying levels of detail throughout the application lifecycle and used as part of the development process. Typically, modeling tools assist architects in the initial stages of application conceptualize and construction. However, there are also visualization tools to comprehend existing code and find potential problems. Being able to visualize code allows for the following:

    • Learn relationships between different potions of code.
    • Map dependencies for an entire solution.
    • Understand how application modification will affect the existing code.
    • Assess the coding modifications and possible risks that may result from those changes.

    The following table shows the availability of each architecture tool in Visual Studio.

    codemap1
    UML designers have been removed from Visual Studio 2017 due to lack of usage within the community.

    Code Maps

    This blog article is a quick start for code maps, the visualization tool provided with Visual Studio. Code maps provide the following capabilities.

    • When debugging, a code map allows a user to visually comprehend relationships within applications and methods on the call stack.
    • When executing a code review, a code map can be a tool used during the systematic examination to find vulnerabilities.
    • When working with unfamiliar or legacy code, a code map provides navigation with a visual experience.

    If the Architecture item does not appear in the Visual Studio menu, please follow these steps to install code map. Execute the Visual Studio Installer and select the Individual components item. Scroll down to Code tools, check the box next to Code Map, and click on the Modify button.

    codemap2

    In order to generate a code map for an existing solution, click on the Architecture item in the Visual Studio menu and select Generate Code Map for Solution.

    codemap3

    After the code map is generated, the diagram is displayed.

    codemap4

    Browse and rearrange the code map by expanding, grouping, filtering, and drilling-down the elements within the diagram.

    codemap5

    Lastly, Visual Studio includes code map analyzers to identify complex code that could possibly be improved. To run the code map analyzers, click on the Layout item in the Code Map menu, click Analyzers, and select the analyzer (Circular Reference Analyzer, Find Hubs Analyzer, Unreferenced Nodes Analyzer).

    codemap6

    While architects are experienced using modeling tools to design systems, they may not be familiar visualizing applications that have been previously written. Code maps are that tool for understanding existing code. Architects can compare design models to actual code, and developers can debug and review code.

  • 相关阅读:
    Shell从入门到精通进阶之四:流程控制
    15个Python面试问题(附答案)
    python教程:内置函数和语法糖触发魔法方法
    python教程:利用while求100内的整数和
    python 教程:read(),readline() 和 readlines() 比较
    python生成随机数:uniform(), randint(), gauss(), expovariate()
    Python教程: 字符串转义序列及格式化
    python单例模式的五种实现方式
    Python NumPy的常用函数
    python五种调试或排错的方法
  • 原文地址:https://www.cnblogs.com/Javi/p/9114840.html
Copyright © 2011-2022 走看看