Examples of TCGDisjunctiveNormalForm


Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

            oEvent = oOutgoingTransition.getEvents().get(0);
         
          Map<TCGNode, List<TestGoalBase>> colTestGoals =
            new LinkedHashMap<TCGNode, List<TestGoalBase>>();
//          ArrayList<TestGoalBase> colTestGoals = new ArrayList<TestGoalBase>();
          TCGDisjunctiveNormalForm oTestGoalDNF =
            TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(oOutgoingTransition.getPrecondition());
          // remove inequations and double nots (not not X)
          TCGDisjunctiveNormalFormHelperClass.splitUpInequationsInDNF(oTestGoalDNF);
          TCGDisjunctiveNormalFormHelperClass.removeDoubleNots(oTestGoalDNF);
          // clean up conjunctions
          TCGConjunctionHelperClass.removeContradictingConjunctions(
            oTestGoalDNF.getConjunctions());
          TCGConjunctionHelperClass.removeRedundantExpressionsInConjunctions(
            oTestGoalDNF.getConjunctions());
          TCGConjunctionHelperClass.removeRedundantConjunctions(
            oTestGoalDNF.getConjunctions());
         
          if(Configuration.getDuplicateTestGoalsForContainedNodes()) {
            for(TCGNode oSubNode : TCGNodeHelperClass.getAllSubNodes(oTCGNode)) {
              if(oSubNode instanceof TCGRealNode &&
                  TCGNodeHelperClass.getAllTransitionsWithoutTrigger(oSubNode).isEmpty()) {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

        for(TCGTransition oOutgoingTransition : oTCGNode.getOutgoingTransitions()) {
          TCGEvent oEvent = null;
          if(!oOutgoingTransition.getEvents().isEmpty())
            oEvent = oOutgoingTransition.getEvents().get(0);
         
          TCGDisjunctiveNormalForm oDNF = oOutgoingTransition.getPrecondition();
          {
            if(oDNF == null)
              continue;
           
            // only proceed if the current DNF is intended for test goal creation
            if(!oDNF.isUseForTestGoals())
              continue;
           
            // create test goals for each generated DNF
            for(TCGDisjunctiveNormalForm oTestGoalDNF : in_oCoverageCriterion.createDNFsForTestGoals(oDNF))
            {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

      if(oTestGoal instanceof TestGoalGuardConditions) {
        TestGoalGuardConditions oTestGoalGuard =
          (TestGoalGuardConditions)oTestGoal;
        TCGNode oNode = (TCGNode)oTestGoalGuard.getElement();
        TCGEvent oEvent = oTestGoalGuard.getEventToBeCalled();
        TCGDisjunctiveNormalForm oDNF = oTestGoalGuard.getDNFToBeSatisfied();

        ArrayList<TCGConjunction> colConjunctionsToTheFront =
          new ArrayList<TCGConjunction>();
        ArrayList<TCGConjunction> colConjunctionsToTheEnd =
          new ArrayList<TCGConjunction>();
       
        // conjunction list is empty -> add a default conjunction to allow to add conditions
        TCGConjunction oTemporalConjunction = null;
        if(oDNF.getConjunctions().isEmpty()) {
          oTemporalConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
          oDNF.getConjunctions().add(oTemporalConjunction);
        }
       
        // check all conjunctions if they determine exactly one target state
        for(TCGConjunction oConjunction : oDNF.getConjunctions()) {
//          List<TCGTransition> colTransitions =
//            TCGTransitionHelperClass.findResultingTransitions(
//              oNode, oEvent, oConjunction);
//          abc: �berpr�fen, ob es mehrere m�gliche Kandidaten f�r die resultierende Transition gibt
//          Gibt es daf�r nicht schon ein Beispiel? Siehe FreightElevator!
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

      if(oTestGoal instanceof TestGoalGuardConditions) {
        TestGoalGuardConditions oTestGoalGuard =
          (TestGoalGuardConditions)oTestGoal;
        TCGNode oNode = (TCGNode)oTestGoalGuard.getElement();
        TCGEvent oEvent = oTestGoalGuard.getEventToBeCalled();
        TCGDisjunctiveNormalForm oDNF = oTestGoalGuard.getDNFToBeSatisfied();

        ArrayList<TCGConjunction> colConjunctionsToTheFront =
          new ArrayList<TCGConjunction>();
        ArrayList<TCGConjunction> colConjunctionsToTheEnd =
          new ArrayList<TCGConjunction>();
       
        // check all conjunctions if they determine exactly one target state
        for(TCGConjunction oConjunction : oDNF.getConjunctions()) {
          getAdditionalConjunctions(
              colConjunctionsToTheFront, colConjunctionsToTheEnd,
              oNode, oEvent, oConjunction);
        }
        if(oDNF.getConjunctions().isEmpty()) {
          getAdditionalConjunctions(
              colConjunctionsToTheFront, colConjunctionsToTheEnd,
              oNode, oEvent, null);         
        }
        // sort ambiguous conjunctions to the end
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

      m_oTestCaseRunnerState.getRuntimeState().setActiveNode(oStartNode);
     
      // create separate guard condition-based test goal
      if(in_bCreateConditionBasedTestGoal) {
        // create temporary modification of the original test goal
        TCGDisjunctiveNormalForm oModifiedDNF =
          GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
        if(in_oConjunction != null)
          oModifiedDNF.getConjunctions().add(in_oConjunction);
        TestGoalGuardConditions oModifiedTestGoal =
          new TestGoalGuardConditions(in_oNode, in_oEventToBeTriggered,
              oModifiedDNF);
        m_oTestCaseRunnerState.getTestGoalsToSatisfy().add(oModifiedTestGoal);
      }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

//    System.out.println("process transition from >" + in_oPair.getSecond().getSourceNode().getName()
//        + "< to >" + in_oPair.getSecond().getTargetNode().getName() + "<");
   
    ExpressionChangeLog oExpressionChangeLog = new ExpressionChangeLog();
    TCGDisjunctiveNormalForm oPostDNF = in_oPair.getSecond().getPostcondition();
    TCGConjunction oPostConjunction = GeneratedFactory.eINSTANCE.createTCGConjunction();
   
    if(!transformPreconditionAccordingToPostcondition(
        oExpressionChangeLog, oPostDNF, oPostConjunction)) {
      // conflict occurred ... return
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

      TCGDisjunctiveNormalForm in_oPreCondition,
      TCGConjunction in_oPostCondition)
  {
    // *** include precondition in search algorithm
//    TCGDisjunctiveNormalForm oPreDNF = in_oPair.getSecond().getPrecondition();
    TCGDisjunctiveNormalForm oPreDNF = in_oPreCondition;
   
    // insert restricted guard condition here
    if(Configuration.isInnerTransitionHasPriorityOverOuterTransition()) {
      if(in_oPair.getSecond() != null &&
          TCGNodeHelperClass.firstNodeIsSubStateOfSecondNode(
          in_oPair.getFirst(), in_oPair.getSecond().getSourceNode())) {
//        Hier entstehen widerspr�chliche Bedingungen? Mit Beispiel-debug 167 testen!
        Map<TCGEvent, TCGDisjunctiveNormalForm> colAllowedEventToDNF =
          TCGTransitionHelperClass.returnAvailableEventsAndGuardsForStateAndOutgoingTransition(
            in_oPair.getFirst(), in_oPair.getSecond());
        // TODO : ### ObjectComparator durchziehen: nach "contains" suchen
        Object oRefObject = ObjectComparator.getEqualObject(colAllowedEventToDNF.keySet(), in_oEvent);
        if(oRefObject != null) {
          TCGEvent oRefEvent = (TCGEvent)oRefObject;
          boolean bBothDNFsAreNonEmpty = !(oPreDNF == null || oPreDNF.getConjunctions().isEmpty())
            && !(colAllowedEventToDNF.get(oRefEvent) == null || colAllowedEventToDNF.get(oRefEvent).getConjunctions().isEmpty());
          oPreDNF = TCGDisjunctiveNormalFormHelperClass.connectTwoDNFWithAnd(
              oPreDNF, colAllowedEventToDNF.get(oRefEvent));
          TCGDisjunctiveNormalFormHelperClass.removeContradictingConjunctions(oPreDNF);
          // check if the removal of contradicting conjunctions completely cleared the conjunction set
          if(bBothDNFsAreNonEmpty == oPreDNF.getConjunctions().isEmpty())
            return;
//          oPreDNF = colAllowedEventToDNF.get(in_oEvent);
        }
        else
          return;
      }
    }

    // continue search for all conjunctions of the precondition (guard)
    if((oPreDNF != null) && (!oPreDNF.getConjunctions().isEmpty())) {
      for(TCGConjunction oPreConjunction : oPreDNF.getConjunctions()) { 
        searchBackwardsFromEventAndPostcondition(
            in_oPair, in_oEvent, oPreConjunction, in_oPostCondition);
      }
    }
    else {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

    {
      // element referenced by the first iterator
      Object oReferencedObject = in_colSecondObjectToExpressions.keySet().iterator().next();
      if(in_colFirstObjectToExpressions.get(oReferencedObject) == null) {
      }
      TCGDisjunctiveNormalForm oResultingDNF = GeneratedFactory.eINSTANCE.createTCGDisjunctiveNormalForm();
     
      // negate each expression for one referenced object
      for(TCGOCLExpression oExpression : in_colFirstObjectToExpressions.get(oReferencedObject))
      {
        TCGOCLExpression oNegativeExpression = TCGOCLExpressionHelperClass
          .copyExpression(oExpression);
       
        // create DNF from negated expressions 
        TCGDisjunctiveNormalForm oNegatedDNF =
          TCGDisjunctiveNormalFormHelperClass.createDisjunctiveNormalForm(
            net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(
                oNegativeExpression), true);
        oResultingDNF = TCGDisjunctiveNormalFormHelperClass.
          connectTwoDNFWithOr(oResultingDNF, oNegatedDNF);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

    {
      for(TCGOCLExpression oExpression : oConjunction.getExpressions())
      {
        TCGOCLExpression oNegatedExpression =
          net.sf.parteg.base.testcasegraph.helperclasses.TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(oExpression);
        TCGDisjunctiveNormalForm oDNF =
          TCGDisjunctiveNormalFormHelperClass.createDisjunctiveNormalForm(oNegatedExpression, false);
        colResultValue.add(oDNF);
      }
    }
   
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGDisjunctiveNormalForm

      DecisionTableFlat oDecisionTable = new DecisionTableFlat(oExpression);
      oDecisionTable.buildUpCompleteDecisionTable();
     
      for(DecisionTableExpressionValueSelection oRow : oDecisionTable)
      {
        TCGDisjunctiveNormalForm oDNF =
          TCGOCLExpressionHelperClass.
          createDNFForExpressionAndDecisionTableRow(oExpression, oRow);
       
        TCGConjunctionHelperClass.removeContradictingConjunctions(
            oDNF.getConjunctions());
        if(!oDNF.getConjunctions().isEmpty()) {
          colRetDNFs.addAll(TCGDisjunctiveNormalFormHelperClass.
            splitUpDNFsAccordingToInequationsAndConfiguration(oDNF));
        }
      }
    }   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.