Package nz.ac.waikato.modeljunit.coverage

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


    System.out.println(numTests + " tests, with seed = " + seed);
    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);
    }
View Full Code Here


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

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

        if (bCoverage[2]) {
            coverage[2] = new TransitionPairCoverage();
View Full Code Here

  /** An example of generating tests from this model. */
  public static void main(String[] args) throws IOException
  {
    Tester tester = new GreedyTester(new LargeSet(2));
    tester.buildGraph(100000);
    CoverageHistory hist = new CoverageHistory(new TransitionCoverage(), 1);
    tester.addCoverageMetric(hist);
    tester.addListener("verbose");
    while (hist.getPercentage() < 99.0)
      tester.generate();
    System.out.println("Transition Coverage ="+hist.toString());
View Full Code Here

    // build the complete FSM graph for our model, just to ensure
    // that we get accurate model coverage metrics.
    tester.buildGraph();

    // set up our favourite coverage metric
    CoverageMetric trCoverage = new TransitionCoverage();
    tester.addListener(trCoverage);

    // ask to print the generated tests
    tester.addListener("verbose");

    // generate a small test suite of 20 steps (covers 4/5 transitions)
    tester.generate(20);

    tester.getModel().printMessage(trCoverage.getName() + " was "
        + trCoverage.toString());
  }
View Full Code Here

    //tester.addListener(new VerboseListener());
    //tester.addListener(new VerboseListener());
    GraphListener graph = tester.buildGraph();
    System.out.println("FSM has " + graph.getGraph().numVertices() + " states and "
        + graph.getGraph().numEdges() + " transitions");
    CoverageMetric metric = tester.addCoverageMetric(new TransitionCoverage());
    for (double prob = 0.1; prob < 0.99; prob += 0.1) {
      double totalSteps = 0.0;
      int totalTime = 0; // sum of all the totalTimes.
      for (int seed = 0; seed < experiments; seed++) {
        int testSeqTime = 0;
View Full Code Here

        redrawGraph();
    }

    public void runClass(Project project) {
        CoverageHistory[] coverage = new CoverageHistory[4];
        coverage[0] = new CoverageHistory(new TransitionCoverage(), 1);
        coverage[1] = new CoverageHistory(new TransitionCoverage(), 1);
        coverage[2] = new CoverageHistory(new TransitionCoverage(), 1);
        coverage[3] = new CoverageHistory(new TransitionCoverage(), 1);

        Tester randomTester = constructRandomTester(project, coverage[0]);
        Tester greedyTester = constructGreedyTester(project, coverage[1]);
        Tester lookaheadTester = constructLookaheadTester(project, coverage[2]);
        Tester quickTester = constructQuickTester(project, coverage[3]);
View Full Code Here

        return new Model(TestExeModel.createNewModelInstance(project));
    }

    private void setMaximumCoverage(Project project) {
        GreedyTester tester = new GreedyTester(loadModelClass(project));
        CoverageMetric metric = new TransitionCoverage();
        tester.addCoverageMetric(metric);
        int i = 1;
        while (metric.getMaximum() == -1) {
            tester.generate(i);
            i++;
        }
        mMaximum = metric.getMaximum();
    }
View Full Code Here

            // 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]);
            tester.addCoverageMetric(coverage[2]);
View Full Code Here

    // build the complete FSM graph for our model, just to ensure
    // that we get accurate model coverage metrics.
    tester.buildGraph();

    // set up our favourite coverage metric
    CoverageMetric trCoverage = new TransitionCoverage();
    tester.addListener(trCoverage);

    // ask to print the generated tests
    tester.addListener("verbose");

    // generate a small test suite of 20 steps (covers 4/5 transitions)
    tester.generate(100);

    tester.getModel().printMessage(trCoverage.getName() + " was "
        + trCoverage.toString());
  }
View Full Code Here

    // build the complete FSM graph for our model, just to ensure
    // that we get accurate model coverage metrics.
    tester.buildGraph();

    // set up our favourite coverage metric
    CoverageMetric trCoverage = new TransitionCoverage();
    tester.addListener(trCoverage);

    // ask to print the generated tests
    tester.addListener("verbose");

    // generate a small test suite of 20 steps (covers 4/5 transitions)
    tester.generate(100);

    tester.getModel().printMessage(trCoverage.getName() + " was "
        + trCoverage.toString());
  }
View Full Code Here

TOP

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

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.