The document discusses using logic meta-programming to query software history stored in repositories. It describes using tools like Ekeko, QWAL and a history model to query characteristics of code across multiple versions using logic rules. Regular path expressions allow formulating complex queries over the graph of program elements and their changes over time. Future work includes enhancing the history model and scaling the approach to larger projects.
3. Context
Program
Comprehension
Using Information Fragments to Answer the Questions Developers Ask
Thomas Fritz and Gail C. Murphy
International Conference on Software Engineering (ICSE), p.175--184, 2010
3
4. Context
Program Development Process
Comprehension Verification
Using Information Fragments to Answer the Questions Developers Ask
Thomas Fritz and Gail C. Murphy
International Conference on Software Engineering (ICSE), p.175--184, 2010
3
5. Logic Meta-Programming
• Querying a single program version.
• Describe characteristics of the code.
• Ekeko, PQL, CodeQuest, JTL, SOUL, ...
4
6. History Query Tool
{
Temporal Query Language
Repository Representation
Program Query Language
5
16. NoName
1 (run* [?name1]
2 (fresh [?end ?method1 ?method2 ?name2]
3 (qwal graph root ?end
4 []
5 (q=>*) ;;skip arbitrary number of versions
6 (qcurrent [current] ;;in this version do
7 (ast :MethodDeclaration ?method1) ;;find a method
8 (has :name ?method1 ?name1)) ;;with a name
9 (q=>+) ;;skip arbitrary number of versions, >1
0 (qcurrent [current] ;;in this version do
1 (ast :MethodDeclaration ?method2) ;;find a method
2 (has :name ?method2 ?name2) ;;with a name
3 (!= (get-identifier ?name1) ;;that is different from
4 (get-identifier ?name2));;the previous method
5 (has-same-body ?method1 ?method2)))))
14
17. Future Work
• Extend History Model
• Unification across versions
• Detect and precompute refactorings
• Large-scale projects
• Include other sources of information
• Semantic Patches
15