| || |
QTP Function Library Documentation Generator
First post here, I have a ton of QTP experience and would love to become a contributor to this community.
The goal of this distributable is feedback on this standalone script I have written that generates a help file based on comments in my team's function libraries.
The goal here was to be able to dynamically generate a reference file after every day of work. Documentation for programming, one, often becomes out of date hours after it's written because of changes, and two, is never any programmers top priority. I got this idea after reading The Pragmatic Programmer by Andrew Hunt and David Thomas. I highly recommend it!
The biggest advantages of this:
1.) Not having to open up script/function libraries to figure out syntax/names of functions.
2.) New developers to your team have reference to every function written in one place.
3.) Your boss will love you for documenting your code!
4.) Provides one place to go when searching for existing functionality.
5.) All your code is documented with the click of a button any time you want.
6.) Improves team communication.
Right now my wrapper code (the QTP script itself, basically a text scanner - CommentReader) uses several function libraries in the form of classes.
1.) It will read through every subfolder of a specified folder in the QC Resources pane using the QC API (it can be easily tweaked to take files from the filesystem instead).
2.) Download each file in each folder, and copy them as a text file.
3.) Each file is then opened one at a time via text stream, scanned for a specified comment format, and stored in a make-shift data structure (function name, description, author, last modified, arguments, and return value).
4.) Each data structure (function) is written to a separate XML file with its respective properties.
5.) A table of contents XML file is generated from the collection of XML files.
6.) The XML is formatted via XSL and CSS.
The goal of posting this here is a bit of a critique of my code, requests for additional functionality, if anyone has interest in using this, and also an open-source project that could be modified and used by anyone. I am 100% open to making this more robust and parameterized so that it could be used for various operations (ideas of the top of my head: not relying on files being in QC Resources, decoupling the script from QTP totally, supporting multiple comment formats, better styling via XSL and CSS, etc).
There are XML samples provided in the zip as a testament to the final output.
I would love some feedback from the knowledgable community here, and am all ears to some improvements.