4 ms·
Hmm. Hard to monetize I guess. Does anyone know of any code analysis software that looks at dataflow? Specifically for embedded contexts, a lot of code is writt
by potatochup 5y ago
Hmm. Hard to monetize I guess. Does anyone know of any code analysis software that looks at dataflow? Specifically for embedded contexts, a lot of code is written in a very non-functional style, where the output of one module is a series of global variables. That variable is then picked up by other modules as an input, and used to calculate that modules output, etc etc. I'd pay big $$$ for any software that would tell me "modifying variable X will affect downstream Y which will affect Z"
- pabs3 5y agoSounds like a task for symbolic execution engines? https://en.wikipedia.org/wiki/Symbolic_execution https://en.wikipedia.org/wiki/Symbolic_execution
- jschwartzi 5y agoThat’s effectively what Sourcetrail/Coati does in C/C++. Coati was super-helpful for me many years ago when I had to dissect and analyze some crappy vendor code. It also helped me get up to speed on a bunch of C++ spaghetti code on the same project. They hit the nail on the head with their tool and I’ve been using it off and on ever since. I’m actually wondering now if it could be used to analyze Yocto project dependencies and build steps.
- nyanpasu64 5y agoI was using Sourcetrail in the past, and I thought it was only an interactive code field/method browser, and didn't have any way to trace causality... unless I missed some functionality.
- jschwartzi 5y agoI was able to use it to trace causality because the code base I used it for was simple enough that given the relationships between each variable and function call I was able to construct the call graph for a particular set of inputs myself.
- nyanpasu64 5y agoIs Sourcetrail and a document for taking notes measurably better than having an IDE with 2 panes, "go to definition" and "find all references", and a document for taking notes? In my experience it's not really, and it was tricky to setup Sourcetrail for a given project. I saw in another comment saying Sourcetrail supplies "who-implements-who". CLion gives you this, Qt Creator doesn't really (outside of Find References), and I'm not sure about VS Code Clangd or Microsoft C++.
- jschwartzi 5y agoWell it’s a matter of friction. Clion gives you the same information but for each item in the chain you have to click on it bunches. In Sourcetrail you mouse over the symbol and click once. And it exposes the dependencies graphically so you can see who uses it. I hardly use that function in Clion but I use it all the time in Sourcetrail because the way it’s presented is easier for me to read and understand.
- tn1 5y agoI read a paper a while back that does almost the inverse of what you're asking (given Z, how could I get a Y and an X). I tried the code and it almost worked, but gave up and had to move on unfortunately. Still, you might find it useful. https://dl.acm.org/doi/10.1145/3052973.3053038 https://dl.acm.org/doi/10.1145/3052973.3053038
- habitue 5y agoWill Crichton just open sourced flowistry for Rust: https://github.com/willcrichton/flowistry https://github.com/willcrichton/flowistry It's a vscode plugin that analyzes the data flow graph, and lets you do things like highlight statements that depend on the current one, etc.
- fiddlerwoaroof 5y agoIntelliJ has some tools for this for Java.
- bleuchase 5y agoEver looked at https://codeql.github.com/docs/codeql-overview/about-codeql/ https://codeql.github.com/docs/codeql-overview/about-codeql/?
- eugene0 5y agoWe do dependency visualization (it's correlates with dataflow) at viezly. You can check it out here: https://viezly.com/change_requests/3986 https://viezly.com/change_requests/3986
- jellyfishbrain 5y agohttps://lattix.com/ https://lattix.com/ can produce impact reports showing “changing X affects A, B and Y on the first level which in turn affects C, D, E, F and Z on the second level” and so on… https://scitools.com/ https://scitools.com/ Understand can answer similar questions and tries to perform flow analysis “through” function pointers as well.
- kgilpin 5y agoAppMap (https://appland.com/products/appmap https://appland.com/products/appmap) takes the approach of recording code execution flows and presenting them visually. There are also some tools to diff and compare AppMaps. These more advanced tools aren’t on the website because they are in development but I’d be happy to share with you, or do a demo. In this way you can get a clear view of the difference in code paths and dependencies, based on different parameters. @kegilpin