Idealized Commit Logs: Code Simplification via Program Slicing – Alan Shreve
youtube.com
youtube.com
Imagine having a large piece of hard to understand code, `complexFunction()`. Write a test case for the function, `complexFunction("hello")`, figure out what lines run, show only those lines. Now your 100-line function becomes a 10 line function, it actually makes sense!
Another incredibly compelling idea proposed here is the idea of an "idealized commit log". Again, we have a complex function, this function has 5 test cases covering it. When it was first written, only 2 test cases were written. The other three test cases were added in later commits, after a bug was encountered in production.
So now I join your firm, I need to understand this 250-line monster. By using program slicing, it becomes to possible to identify what parts of the code correspond to a test case. You can immediately group parts of the function up to see what part is responsible for what.
This gives us another really powerful tool, we can construct a git-log that is ideal. By constructing your codebase from test-cases and program slices, it becomes possible to construct a git-log that without any of your initial mistakes. Every commit contains functions without mistakes.
I think there are some really interesting ideas discussed in this talk. I hope others agree, and do some exploration. :)