Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Function Library Documentation Generator
#1
Not Solved Question 
Hello,

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.


Attached Files
.zip   CommentReader.zip (Size: 46.67 KB / Downloads: 188)
Reply
#2
Not Solved
Which version of QTP is required to see the implementation
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad External Library in GIT FerGl 0 1,080 04-15-2020, 07:09 PM
Last Post: FerGl
  Issue QTP with Jogl (Java OpenGL) library lsansuin 0 2,185 03-27-2012, 08:24 PM
Last Post: lsansuin
  Unable to load function library from QC in QTP!! vijay.gupta 0 3,678 09-06-2011, 11:28 AM
Last Post: vijay.gupta
Big Grin Load Function Library asisha 0 5,942 03-09-2011, 10:35 PM
Last Post: asisha
  Object Library MR21135 2 3,874 01-21-2009, 09:49 AM
Last Post: MR21135

Forum Jump:


Users browsing this thread: 1 Guest(s)