Class BranchProbe

  extended by org.hansel.Probe
      extended by org.hansel.probes.BranchProbe
All Implemented Interfaces:
Direct Known Subclasses:
ACmpBranchProbe, BinaryBranchProbe, CompBranchProbe, NullCmpBranchProbe, UnaryBranchProbe

public abstract class BranchProbe
extends Probe

A probe for a conditional branch. For decision coverage both possible conditions for the branch have to be encountered.

Niklas Mehner.

Field Summary
Fields inherited from class org.hansel.Probe
Constructor Summary
BranchProbe(ProbeData pd, HanselValue value)
Method Summary
protected  void cover(boolean condition)
 boolean coverageFailure()
 boolean displayFailure()
          Return wether this probe failed to be covered.
 java.lang.String getFailureMessage()
          Return the filure message for this probe.
Methods inherited from class org.hansel.Probe
addResult, countTestCases, equals, getDescription, getID, getName, getProbeData, hashCode, insertProbeCode, run, run, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail


public BranchProbe(ProbeData pd,
                   HanselValue value)
Method Detail


public java.lang.String getFailureMessage()
Return the filure message for this probe.

Specified by:
getFailureMessage in class Probe
Failure message.


protected void cover(boolean condition)


public boolean displayFailure()
Return wether this probe failed to be covered. A probe for a conditional branch fails, if the branch is only taken, or only omitted. If both cases are encountered, the probe is fully covered. If the probe is not executed at all, this method still returns false, because in that case, another probe has to fail (otherwise this probe had been reached). Because the other failure is more important, the result of this probe is left out in this case.

Specified by:
displayFailure in class Probe
true If covering this probe failed.


public boolean coverageFailure()
Specified by:
coverageFailure in class Probe