code-kotis / meta

Repo that talks about all the crazy ideas.
1 stars 0 forks source link

Understand your code better #3

Open geraldchecka opened 8 years ago

geraldchecka commented 8 years ago

Introduction

I've been doing Angular 1.X recently and had chance to deep dive into its internals. This totally changed my perception towards Angular. It works great, but it's internals are overwhelmingly complex and uncanny.

Motivation(s)

Let's call our imaginary library Alpha. It takes input from a configuration file. For e.g.,

{
   "watch": "../angular-1.5.1.js",          // Library to watch
   "listenOn": "http://localhost:9000/"     // Your local webpage port to listen to
}

Alpha has an _AST_ parser running in the background listening to execution in your webpage. It will track the interactions on your webpage, like the functions, variables, context, flows etc... and remembers them(including the data state). It will immediately go to the library supplied as inputs in the config, correlates all matching items and pulls out their documentation. Execution of your webpage ends.

Now you have 5 items in hand

Combine all the above data and present it in a meaningful information.

Say what all methods in the library have been covered during your webpage runtime and explain their documentation and purpose
How many times the flows are covered
State of your data at different point during app runtime
How much time is spent on individual items
etc...

Peeps can deep dive into the internals in a presentable and meaningful way.

Please feel free to debate :-) @hemanth @juarezpaf @andreicek @gokulkrishh @josueggh @juarezpaf @manekinekko @mhartington @pselle @radhikakhetan