private void updateBehavioralAnnotation(BehavioralAnnotation behavioralAnnotation) { if (behavioralAnnotation.getSymbolicExecution()) { this.symbolicExecutionLabel.setText("Yes"); if (behavioralAnnotation.interpretSymbolicTracePaths() == BehavioralAnnotation.TRUE_POSITIVE) { this.symbolicExecutionInterpretationLabel.setText("True Positive"); this.symbolicExecutionInterpretationImage.setImage( BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_ACCEPTED)); } else { this.symbolicExecutionInterpretationLabel.setText("False Positive"); this.symbolicExecutionInterpretationImage.setImage( BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_REJECTED)); } } else { this.symbolicExecutionLabel.setText("No"); this.symbolicExecutionInterpretationLabel.setText("-"); this.symbolicExecutionInterpretationImage.setImage( BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_REJECTED)); } this.tracesLabel.setText(Integer.toString(behavioralAnnotation.sizeOfTraces())); this.notAcceptedLabel.setText(Integer.toString(behavioralAnnotation.getNotAcceptedTraces())); this.acceptedLabel.setText(Integer.toString(behavioralAnnotation.getAcceptedTraces())); this.rejectedLabel.setText(Integer.toString(behavioralAnnotation.getRejectedTraces())); this.passedAcceptingStateTracesLabel.setText( Integer.toString(behavioralAnnotation.getPassedAcceptingStateTraces())); this.avgLengthLabel.setText(Float.toString(behavioralAnnotation.getAvgLengthAcceptedTraces())); updateTracesCombo(behavioralAnnotation); }
private void createSymbolicExecutionPart(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText("Symbolic Execution: "); this.symbolicExecutionLabel = new Label(parent, SWT.NONE); this.symbolicExecutionLabel.setText("No"); this.symbolicExecutionLabel.setLayoutData( GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create()); label = new Label(parent, SWT.NONE); label.setText("Interpretation: "); this.symbolicExecutionInterpretationLabel = new Label(parent, SWT.NONE); this.symbolicExecutionInterpretationLabel.setText("-"); this.symbolicExecutionInterpretationLabel.setLayoutData( GridDataFactory.fillDefaults().grab(true, false).create()); this.symbolicExecutionInterpretationImage = new Label(parent, SWT.NONE); this.symbolicExecutionInterpretationImage.setImage( BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_NOT_ACCEPTED)); this.symbolicExecutionInterpretationImage.setLayoutData( GridDataFactory.fillDefaults().grab(true, false).create()); Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); separator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(3, 1).create()); }
private void updateTrace(Trace trace) { Image image; StringBuffer buffer = new StringBuffer(); if (trace.getResult() == Trace.NOT_ACCEPTED) { image = BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_NOT_ACCEPTED); buffer.append("Method call sequence was not accepted"); if (trace.getPassedAcceptingState() == 1) { buffer.append(", passed 1 accepting state," + " length of accepted subsequence: "); buffer.append(trace.getLengthOfAcceptedTrace()); } else if (trace.getPassedAcceptingState() > 1) { buffer.append(", passed "); buffer.append(trace.getPassedAcceptingState()); buffer.append(" accepting states, length of accepted subsequence: "); buffer.append(trace.getLengthOfAcceptedTrace()); } } else if (trace.getResult() == Trace.ACCEPTED) { image = BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_ACCEPTED); buffer.append("Method call sequence was accepted, length of sequence: "); buffer.append(trace.getLengthOfAcceptedTrace()); } else { image = BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_REJECTED); buffer.append("Method call sequence was rejected"); if (trace.getPassedAcceptingState() == 1) { buffer.append(", passed 1 accepting state," + " length of accepted subsequence: "); buffer.append(trace.getLengthOfAcceptedTrace()); } else if (trace.getPassedAcceptingState() > 1) { buffer.append(", passed "); buffer.append(trace.getPassedAcceptingState()); buffer.append(" accepting states, length of accepted subsequence: "); buffer.append(trace.getLengthOfAcceptedTrace()); } } this.resultImageLabel.setImage(image); this.resultLabel.setText(buffer.toString()); this.boundObjectsTableViewer.setInput(trace); updateSequenceDiagram(trace); }
private void createBehavioralAnnotationPart(Composite parent) { GridLayout gridLayout = new GridLayout(); gridLayout.marginHeight = 0; gridLayout.numColumns = 3; Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(gridLayout); GridData gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.verticalAlignment = SWT.FILL; gridData.grabExcessVerticalSpace = true; composite.setLayoutData(gridData); this.createSymbolicExecutionPart(composite); Label label = new Label(composite, SWT.NONE); label.setText("Method call sequences:"); label.setToolTipText("Number of monitored method call sequences."); this.tracesLabel = new Label(composite, SWT.NONE); this.tracesLabel.setToolTipText("Number of monitored method call sequences."); gridData = new GridData(); gridData.horizontalSpan = 2; gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; this.tracesLabel.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setImage(BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_ACCEPTED)); gridData = new GridData(); gridData.horizontalAlignment = SWT.CENTER; label.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setText("accepted:"); label.setToolTipText("Number of accepted method call sequences."); this.acceptedLabel = new Label(composite, SWT.NONE); this.acceptedLabel.setToolTipText("Number of accepted method call sequences."); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 15; this.acceptedLabel.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setImage(BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_REJECTED)); gridData = new GridData(); gridData.horizontalAlignment = SWT.CENTER; label.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setText("rejected:"); label.setToolTipText("Number of rejected method call sequences."); this.rejectedLabel = new Label(composite, SWT.NONE); this.rejectedLabel.setToolTipText("Number of rejected method call sequences."); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 15; this.rejectedLabel.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setImage(BehavioralInferenceImages.getImage(BehavioralInferenceImages.IMG_NOT_ACCEPTED)); gridData = new GridData(); gridData.horizontalAlignment = SWT.CENTER; label.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label.setText("not accepted:"); label.setToolTipText("Number of not accepted method call sequences."); this.notAcceptedLabel = new Label(composite, SWT.NONE); this.notAcceptedLabel.setToolTipText("Number of not accepted method call sequences."); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 15; this.notAcceptedLabel.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label = new Label(composite, SWT.NONE); label.setText("accepted subsequences:"); label.setToolTipText( "Number of rejected and not accepted " + "method call sequences that contain accepted subsequences."); this.passedAcceptingStateTracesLabel = new Label(composite, SWT.NONE); this.passedAcceptingStateTracesLabel.setToolTipText( "Number of rejected" + " and not accepted method call sequences that contain accepted subsequences."); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 15; this.passedAcceptingStateTracesLabel.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label = new Label(composite, SWT.NONE); label.setText("average length of"); label.setToolTipText("Average number of method calls of" + " accepted subsequences."); gridData = new GridData(); gridData.verticalIndent = 2; gridData.horizontalSpan = 2; label.setLayoutData(gridData); label = new Label(composite, SWT.NONE); label = new Label(composite, SWT.NONE); label.setText("accepted (sub-)sequences:"); label.setToolTipText("Average number of method calls of" + " accepted subsequences."); gridData = new GridData(); gridData.horizontalIndent = 5; gridData.verticalIndent = 0; label.setLayoutData(gridData); this.avgLengthLabel = new Label(composite, SWT.NONE); this.avgLengthLabel.setToolTipText( "Average number of method calls of" + " accepted subsequences."); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 20; this.avgLengthLabel.setLayoutData(gridData); }