Loading ...
Sorry, an error occurred while loading the content.
 

Re: testcase writing ans code coverage

Expand Messages
  • Dennis K. Paulsen
    As you know, code coverage checking and functional testing are two very different practices; which should be treated as such... Without going into detail on my
    Message 1 of 2 , Jul 29, 2003
      As you know, code coverage checking and functional testing are two
      very different practices; which should be treated as such...
      Without going into detail on my thoughts, doing both of these
      together in parallel would require a lot of work and in the end
      could impact functional test quality.

      Below is a cheap example testcase implementation I threw together
      based off something I've done in the past.. You could also get
      advanced and dynamically create the testcase in the master script
      based off command line data, a database, etc.

      1) Master Script:
      #!/usr/bin/perl
      # Note: Array elements are named after test script file prefixes.
      my @TestCase = qw/
      ButtonTest
      MovementTest
      MinimizeTest
      /;
      foreach my $test (@TestCase) {
      do($test.'.pl') or die("$test.pl failed to execute! $@");
      }

      2) Result Handling Library (ResultHandler.pl):
      #!/usr/bin/perl
      sub LogErr {
      my $msg = shift;
      # Could modify to log to a database, etc.
      die "$msg";
      }
      sub LogMsg {
      my $msg = shift;
      # Could modify to log to a database, etc.
      print "$msg\n";
      }
      # Needed so require can be used by test scripts
      1;

      3) Test scripts named after entries in @TestCase (ButtonTest.pl):
      #!/usr/bin/perl
      package buttontest; # Because of do usage, give namespace so no
      conflicts with other test scripts that have duplicate sub names, etc.
      require 'ResultHandler.pl';
      # use Win32::GuiTest
      LogMsg("Starting test.");
      # [TEST CODE]
      LogErr("$0 failed!");


      Regards,
      Dennis K. Paulsen

      --- In perlguitest@yahoogroups.com, "PMgave" <san_pmgave@s...> wrote:
      > pl. tell me how to write testcase using guitest module
      >
      > also i want measure code coverage wile executing test case how it
      is
      > possigle
    Your message has been successfully submitted and would be delivered to recipients shortly.