1 / 30

Searching through Source Code using CVS Comments

Searching through Source Code using CVS Comments. Annie Chen, Eric Chou, Joshua Wong, Andrew Yao, Qing Zhang, Shao Zhang, Amir Michail University of New South Wales. Motivation. Current methods of searching for source code have a number of drawbacks:

dior
Télécharger la présentation

Searching through Source Code using CVS Comments

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Searching through Source Code using CVS Comments Annie Chen, Eric Chou, Joshua Wong, Andrew Yao, Qing Zhang, Shao Zhang, Amir Michail University of New South Wales

  2. Motivation • Current methods of searching for source code have a number of drawbacks: • Usually requires some knowledge of source code • Relies on programming styles • Relies on good documentation of code • Only matches line, not section of code

  3. CVS – Concurrent Versions System • Allows multiple developers to work together on a central repository • Developers make their changes and commit the files to the repository along with a description of changes made • CVS keeps track of these changes made • Widely used in the open source community

  4. CVS Comments

  5. Associated Lines

  6. CVS Comments - Advantages • Good source of documentation • Have lines of code that it refers to • Not only describes changes, but purpose: • Added features • Bug fixes • Holds for many future versions • Fragment of code can be involved in multiple commits • Provides multiple descriptions

  7. CVSSearch • Search for source code through CVS comments • Returns the source code fragment in the most recent version of the file which the matched comment refers to

  8. Algorithm Overview • For each revision i with comment C, find lines l modified in i in files of that revision • Propagate l to the corresponding lines in the most recent version of its file • Associate C with the corresponding lines in the most recent version

  9. Propagation Example

  10. Useful CVS commands • cvs log – displays for all revisions and its comments for each file • cvs diff – shows differences between different versions of a file

  11. Searching • Comments for each line are stored in MG (Managing Gigabytes) system • MG provides stemming and ranking for query using cosine similarity • Query are inputted into MG, and it returns lines matched, ranked • We group the lines and sort by overall ranking for each group

  12. CVSSearch Demo

  13. Search for Files

  14. Show File

  15. Search for Commits

  16. Show Code for Commit

  17. Browse Repository

  18. Browse Commits

  19. Browse Files

  20. View Code Evolution

  21. Problems with the Tool • Troublesome to setup and install • Does not update on changes to the repository

  22. Obtaining CVSSearch • open source • GPL • http://cvssearch.sourceforge.net/

  23. Related Work • Lexical tools • grep • awk • lex • Natural language documentation • CVS tools – bonsai, WebCVS

  24. Bonsai

  25. WebCVS

  26. Future Work / Work in Progress • Program understanding feature that describes arbitrary lines in the code using CVS comments collectively • Mining CVS commits to look for class/function usage patterns

  27. Search Classes/Functions Usage

  28. View Code

  29. People Involved • Amir Michail • Andrew Y. Yao • Eric Chou • Joshua Wong • Qing Zhang • Shao Zhang • Annie Chen

  30. Thank you

More Related