Thread: generate test cases

  1. #1
    Registered User
    Join Date
    Aug 2006

    generate test cases

    Hi, I'm fairly horrible in c++ so I've come here to ask for help. I'm required to implement Adaptive Random Testing (ART) to generate test cases in a simulated program. The program needs to be in C++. I've tried searching for tutorials online or even books from my library but was not able to find one that can help me. Can anyone help me how to get started or know any tutorials online that I can refer to coz I really need help and I'm not sure how to get started.

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    That's really vague. What kind of system or program are you testing?

    DISCLAIMER - I don't know anything about ART.

    In general the idea of a simulation is to generate a bunch of random conditions over and over. In C++, that means you need to use rand() (or some other random number generator) and loops.

    It's easier to test a banking program with 10,000 simulated customers than with 10,000 people sitting at keyboards.

    As I understand it - With ART, you try to bias the randomness near the limits and worst-case conditions. With this technique, you are more likely to find a fault or weakness than with purely random testing. That might require filtering the random numbers through a statistical-distribution filter... i.e. create a "normal distribution" curve.

    In a banking simulation, you might want to bias the simulation with lots of situations when many users are simultaneously withdrawing lots of money. Or, when a husband and wife at two different branches are trying to withdraw money from a joint account at the same time, etc.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Here is the full question to understand better:

    The simulated program should cover functions in the following pseudo code:
    (1) Define the input domain D1.
    (2) Repeatedly implement Steps 3 to 6 for 2000 times.
    (3) Randomly2 select a subdomain Di from D.
    (4) Use ART to generate test cases from D until a point inside Di is selected.
    (5) Record the total number ni of test cases generated so far.
    (6) Calculate the average value of all ni. (This is your experimental F-measure.)

    The parameters for the simulated program are restricted as follows:
    (i) The number of dimension of D: 3, i.e., there are three axes, x, y, and z;
    (ii) The shape of D: cube, i.e., |zmax – zmin| = |ymax – ymin| = |xmax – xmin|;
    (iii) The type of coordinates of D: real number;
    (iv) The shape of Di: cube;
    (v) The failure rate θ (= Di / D): 0.01 and 0.005.That means you MUST run the simulation program TWICE.

    So that means its just a random number generator that I need to do? DougDbug do u or anyone else knows any sites with tutorials of random number generator that can help me get started?

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Out of scope
    Quote Originally Posted by lisa18
    DougDbug do u or anyone else knows any sites with tutorials of random number generator that can help me get started?
    Sent from my iPad®

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sustring test puzzle
    By WDT in forum C# Programming
    Replies: 3
    Last Post: 06-29-2009, 07:19 AM
  2. Help needed to verify a new on-line C test
    By JanHruska in forum Projects and Job Recruitment
    Replies: 15
    Last Post: 06-20-2009, 06:48 AM
  3. Creating C/C++ Unit Test Cases
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 04-28-2009, 08:29 PM
  4. Request for comments
    By Prelude in forum A Brief History of
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. Generate random numbers in Lucky7 project using C#
    By Grayson_Peddie in forum C# Programming
    Replies: 1
    Last Post: 04-11-2003, 11:03 PM