001/*-------------------------------------------------------------------------+ 002| | 003| Copyright (c) 2005-2018 The ConQAT Project | 004| | 005| Licensed under the Apache License, Version 2.0 (the "License"); | 006| you may not use this file except in compliance with the License. | 007| You may obtain a copy of the License at | 008| | 009| http://www.apache.org/licenses/LICENSE-2.0 | 010| | 011| Unless required by applicable law or agreed to in writing, software | 012| distributed under the License is distributed on an "AS IS" BASIS, | 013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 014| See the License for the specific language governing permissions and | 015| limitations under the License. | 016| | 017+-------------------------------------------------------------------------*/ 018package org.conqat.engine.sourcecode.coverage; 019 020import java.io.Serializable; 021 022import org.conqat.lib.commons.js_export.ExportToJavaScript; 023 024import com.fasterxml.jackson.annotation.JsonProperty; 025 026/** 027 * Base class for coverage probes. Probes are generic coverage "indicators" 028 * associated with a source line (the start line of the corresponding 029 * statement). Probes can be of different types. For example in case of branch 030 * coverage a probe may indicate for an if condition how many times it was 031 * evaluated to true and how often to false. 032 */ 033@ExportToJavaScript 034public abstract class CoverageProbeBase implements Serializable { 035 036 private static final long serialVersionUID = 1L; 037 038 /** 1-based line number of the associated statement */ 039 @JsonProperty("line") 040 private int line; 041 042 public CoverageProbeBase(int line) { 043 this.line = line; 044 } 045 046 public int getLine() { 047 return line; 048 } 049 050 public void setLine(int line) { 051 this.line = line; 052 } 053 054 /** Returns the number of coverable entities for this probe. */ 055 public abstract int getCoverableCount(); 056 057 /** Returns the number of covered entities for this probe. */ 058 public abstract int getCoveredCount(); 059 060}