Live data from Hacker News

Ask HN: Visualizing software designs, especially of large systems (if at all)?

news.ycombinator.com

111–120 of 129 posts

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#111
Visualization of a code base (using anything) is absolutely a must for System comprehension. You need to look at both the Static structures/call graphs (use Doxygen, any UML tool, CFlow/Codeviz etc.) and Dynamic (i.e. Runtime) call graphs (Use profiler call graph, Debug Tracing within the App. etc.) for a code base. Printout relevant diagrams/graphs and liberally add notes as reqd.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#112
I took a stab at writing my own UML-type diagram in Python using networkx and rendered with dot. Since it's a real network instead of just pictures, I can slice it however I want it (eg "show me all dependencies of page X" or "show me all nodes of type 'state'". It's still a work in progress, but it's helped me think through some things.

https://github.com/hammeiam/saddle-data-graph/blob/master/Sa... (scroll down for images)

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#113
I mostyl use PlantUML and C4 Model (by Simon Brown). I have my own collection of PlantUML related resources [1]. I've also recently found these examples [2] which are really nice.

I also do some sketchnoting (using pen & pencil) when I design a system for the first time. I wish I could easily convert those sketches to PlantUML.

[1]: https://brainfck.org/#PlantUML [2]: https://skyksit.com/programming/uml/plantuml-samples/

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#114
"What does an algorithm look like?"

I'm an intensely visual person, but have never found a visual programming system which scales well --- the problem is, past a certain level of complexity one has to use modules, which then devolves the visual representation down to just a bunch named blocks.

That said, I'm using BlockSCAD:

https://www.blockscad3d.com/community/projects/1421975

to work up designs which I'm then putting into other tools.

Looking at GraphSCAD:

http://graphscad.blogspot.com

and there's also Ryven and pythonocc which I managed to get installed:

https://ryven.org

https://github.com/Tanneguydv/Pythonocc-nodes-for-Ryven

but I'd really like to see a tool for this sort of thing which made G-code.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#115
I wrote tool to generate diagrams from Java code: https://www3.svjatoslav.eu/projects/javainspect/

It produces diagrams like these: https://www3.svjatoslav.eu/projects/sixth-3d/graphs/

Advantage of this is that diagram can be automatically updated from latest code. Classes discovery and visual layout is automatic.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#116
I am fond of UML diagrams for the programming part and UML or ER for the database schema.

There are a lot of great tools that can reverse engineer code -> UML and databases to ER or UML. (and forward engineer UML or ER -> code or database)

I find them quite helpful.

If someone has taken care to keep up UML diagrams, and I can grab the blessed ones with more context that is great.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#117

UML is not a documentation tool, it´s a communication tool. It is a standardized way to communicate. It removes ambiguity. UML is the best way to manage, communicate and handle a large amounts of complexity. Most of the free UML tools are very basic and does not have traceability features (we can see many in the comments), and this is really a no-go if you want to understand large systems.

I agree with your view on UML, but now I'm curious what you consider documents to be for.

I can assure that documentation is not UML. Documentation can contain exported diagrams that were created using UML.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#118

UML is not a documentation tool, it´s a communication tool. It is a standardized way to communicate. It removes ambiguity. UML is the best way to manage, communicate and handle a large amounts of complexity. Most of the free UML tools are very basic and does not have traceability features (we can see many in the comments), and this is really a no-go if you want to understand large systems.

Documentation is communication, albeit asynchronous.

Documentation is a tool for communication, not the same thing. The dictionary is our best friend =]

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#119
I had a systematic way of doing this for reverse engineering a large undocumented system. First you get first principles in mind - there is control flow (execution), data (files, databases), and communication interfaces (IPC, network, etc.). You don't need a sophisticated modeling tool - just any Visio-esque, giphly, draw.io, etc.

For these things you know there are systematic ways of finding them - for mine it was a C/C++ Project so:

1. Find all executables via build output, or in the running system. For now you're largely going to ignore the details of what the code is doing. You just want to know what is actually "running" at runtime :). 2. Figure out where the entry points to those executables are, like a main. These are usually easy to search for or discover by convention. 3. Find out what threads it spawns 4. Start a simple diagram with a box at the top named for the executable, and branch down to one box for each thread. Manually trace control flow for each thread, adding boxes at points you think are noteworthy logical units. E.g. often threads will have some kind of main loop they sit in, which is a key element for understanding what that thread is doing. 5. Continue for nested threads and worker (short lived but not ephemeral) threads.

Once you complete this, you should have an abstract block diagram that gives a decent map of "What code is running in the system". And just through the process of naming and looking over, maybe a rough idea of what the various pieces of software are doing and possibly how they relate.

You can then repeat this for the other basics in a similar fashion - data and communication interfaces. It's good to emphasize staying at a first-principles kind of abstract mindset. You know there are a finite number of ways a process or thread can communicate or create side-effects outside of itself. If you literally just find all of them (not the details of what is happening over those interfaces), usually it ends up being quite few, and all of a sudden the complexity becomes less intimidating. You have a little box that does some manipulation of data via logic and state, and it goes in one pipe and out the other.

I should point out how difficult all this is largely derives from those "coding practices" droned on about for benefiting maintainability, but so often get tossed. For example, say your system uses message IDs as part of an IPC mechanism. If the code followed good practice, using some kind of constant definitions shared from a single place, you can now do things like search for that message identifier and find all places it's sent/received. If some code used it's own re-definition of the same ID, or hardcoded just the raw numerical value, this becomes nearly impossible.

Also you'll need multiple diagrams. You won't be able to clearly show a complete "code execution" diagram at the same time as an interface relationship diagram or shared data sources diagram. The complexity of it will not help, it will just be more overwhelming complexity.

Re: Ask HN: Visualizing software designs, especially of large systems (if at all)?

#120

Earlier quoted context omitted.

Documentation is communication, albeit asynchronous.

Documentation is a tool for communication, not the same thing. The dictionary is our best friend =]

No, documentation is communication, not just a tool for it.

Please don’t be condescending and incorrect.

Post reply on HN