Forum Discussion

nish1's avatar
nish1
Occasional Contributor
10 years ago

Developing test framework from scrach

Resently I joined a small software company to build auomation framwork for regression testing. TC was selected tool. There was no proper testing was implimented at there. But found lot of DUnit testings were written without documentation and cover considarable functional tests.

So I'm not sure how to re use Dunit test. No documentation and is tedious task to analyze each and every tests. 



Anybody out there to give an openion ?  Ignoring existing Dunits and wirting all new would be a waste. At the same time investigation on those would be tedious and time consuming.

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi,



    > But found lot of DUnit testings were written without documentation and cover considarable functional tests.



    May I wonder why do you think that the existing tests cover something if they are not documented?

    Is it just because you was told this? Any reason to trust this? (The situation is exactly like with the regression testing you are trying to automate - you do not trust developers that nothing was broken and need to verify this.)

    Also, even if the existing tests were verifying something when been created, do you have any reason to believe that the tested functionality did not change and existing tests are still relevant?



    If your answers to the above questions are positive, then you may reuse existing tests and you should know what they do.

    Otherwise you need either analyse them and figure out what they do and decide than whether this or that test is still valid and can be reused or should be abandoned and recreated, or, if you estimate analysis stage as too resource consumimg, just forget about existing tests and create new tests according to the requirements.
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi Hi Murugan S, sorry about, I totally forgot VBScripts comment style.


     


    I do have a (kind of hacky) way to get it to work.


     


    The following is valid in VBScript


     


    '/**

    '* Represents operations against an SQL Database

    '* @class DBaseOperations

    '* @constructor

    '* @author Phillip Baird

    '* @date 22/05/2013

    '* @namespace com.arcinnovations.framework.database

    '*/


     


    True, the YUIDoc parser will not recognise this.


     


    However, it would should be possible to write a script that does the following:


     


    1. Copy source files to a temporary location


    2. For each file:


        a. Read the file into memory


        b. Replace all occurances of "'/" with a "/"


        c. Replace all occurances of "'*" with a "*"


        d. Save the altered contents back to file


    3. Build the documentation using YUIDoc


     


    As the YUIDoc parser only reads comment blocks and ignores source code, the fact that it is invalid VBScript should not matter.


     


    Regard,


    Phil Baird

  • jose_pita's avatar
    jose_pita
    Super Contributor
    I don't know how DUnit works and what kind of tests it does, but, If I were you and didn't know anything about them, just forget about it.



    Get a good documentation of the app you are going to test and start breaking keyboards :D



    Also, try to document your code so that the next guy does not go through the same than you.



    You can use yuidoc comments in your JS files.



    Also, if you are starting, build a good framework first so that you can reuse tests wherever needed instead of creating new ones all the time.



    Anyway, that's what I would do...



    Best of luck!
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert

    Hi Murugan S, the YUIDoc tool that Jose commented on is language independant.


     


    Instead of trying to parse the code to associate comment blocks, the documentation generator only parses comment blocks which means although the syntax is a little more verbose, the tool can be used to document any language.


     


    Regards,


    Phil Baird

  • murugans1011's avatar
    murugans1011
    Regular Contributor
    Hi Phil,



    Thanks for ur reply.



    The YUIDoc documentation its mentioned like  "You can use it with any language that supports /* */ comment blocks."  but vbscript doesnt support command line. i can able to use only   ' (single quote)  for commonad line
  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hello, Nishantha



    If you decide to reuse the existing DUnit tests (considered pros and cons that Alexei Karas mentioned), then take a look at Unit Testing and DUnit Unit Testing sections in online help to learn how to perform unit testing with TestComplete.