Package nz.ac.waikato.modeljunit.coverage

Examples of nz.ac.waikato.modeljunit.coverage.StateCoverage


   *  It may need adjusting when the seed or random walk algorithm changes.
   */
  public void testStateCoverage()
  {
    //    System.out.println("Starting testStateCoverage");
    FsmCoverage(new StateCoverage(), 3,
        new int[] {1,1, 2,2, 3,3, 20,3});
  }
View Full Code Here


   *  It may need adjusting when the seed or random walk algorithm changes.
   */
  public void testStateCoverage()
  {
    //    System.out.println("Starting testStateCoverage");
    FsmCoverage(new StateCoverage(), 3,
        new int[] {1,1, 2,2, 3,3, 20,3});
  }
View Full Code Here

   */
  public AllRoundTester(Tester tester)
  {
    super(tester.getModel());
    test = tester;
    state = test.addCoverageMetric(new StateCoverage());
    loopTolerance = 1;
  }
View Full Code Here

    {
      GreedyTester tester = new GreedyTester(model);
     
      tester.setRandom(new Random());
     
      tester.addCoverageMetric(new StateCoverage());
      tester.addCoverageMetric(new TransitionCoverage());
      tester.addCoverageMetric(new TransitionPairCoverage());
     
      tester.addListener(new StopOnFailureListener());
     
View Full Code Here

   * @param length  The number of test steps to do.
   * @param rand    The random number generator used to choose paths.
   */
  public void allRoundTrips(int length, Random rand)
  {
    CoverageMetric state = new StateCoverage();
    this.addCoverageMetric(state);
    int totalLength = 0;
    doReset("Initial", true);
    while (totalLength < length) {
      int taken = doGreedyRandomActionOrReset(rand, true);
      if (taken < 0) {
        System.out.println("reset state coverage");
        state.clear();
      }
      else {
        totalLength++;
        if (state.getDetails().get(getCurrentState()) > 1) {
          doReset("found loop", true);
          state.clear();
        }
      }
    }
    this.printProgress(1, "finished allRoundTrips of " + length
        + " transitions.");
View Full Code Here

    // increase the default maximum search to complete the exploration.
    GraphListener graph = tester.buildGraph(100000);
    graph.printGraphDot("ecinema.dot");
    CoverageMetric trans = tester.addCoverageMetric(new TransitionCoverage());
    CoverageMetric trpairs = tester.addCoverageMetric(new TransitionPairCoverage());
    CoverageMetric states = tester.addCoverageMetric(new StateCoverage());
    CoverageMetric actions = tester.addCoverageMetric(new ActionCoverage());
    tester.addListener("verbose");
    // this illustrates how to generate tests upto a given level of coverage.
    int steps = 0;
    while (actions.getPercentage() < 100 /* || steps < 1000*/) {
View Full Code Here

    tester.setResetProbability(0.01);
    //GraphListener graph = tester.buildGraph(0);
    //tester.addListener("Verbose", new VerboseListener(tester.getModel()));
    tester.addListener(new StopOnFailureListener());
    tester.addCoverageMetric(new TransitionCoverage());
    tester.addCoverageMetric(new StateCoverage());
    int test = 0;
    for (; test < numTests; test++) {
      tester.generate(1);
    }
    System.out.println("After " + test + " tests");// ", todo=" + graph.numTodo());
View Full Code Here

        if (bCoverage[0] || bCoverage[1] || bCoverage[2] || bCoverage[3])
            m_tester[0].buildGraph();
        CoverageMetric[] coverage = new CoverageMetric[COVERAGE_NUM];

        if (bCoverage[0]) {
            coverage[0] = new StateCoverage();
            m_tester[0].addCoverageMetric(coverage[0]);
        }

        if (bCoverage[1]) {
            coverage[1] = new TransitionCoverage();
View Full Code Here

            // Leave the coverage window hidden until manually opened from the View menu
            // displayCoverageWindow();
            buildGraphGUI();

            CoverageHistory[] coverage = new CoverageHistory[TestExeModel.COVERAGE_NUM];
            coverage[0] = new CoverageHistory(new StateCoverage(), 1);
            coverage[1] = new CoverageHistory(new TransitionCoverage(), 1);
            coverage[2] = new CoverageHistory(new TransitionPairCoverage(), 1);
            coverage[3] = new CoverageHistory(new ActionCoverage(), 1);
            tester.addCoverageMetric(coverage[0]);
            tester.addCoverageMetric(coverage[1]);
View Full Code Here

TOP

Related Classes of nz.ac.waikato.modeljunit.coverage.StateCoverage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.