public class ProjectStaticData extends Object
Class used to contain all the static data/info of the target project (SUT), like number of classes, branches per class, etc.
A class under test (CUT) is any public class in the SUT, regardless of whether it is concrete, abstract or an interface, but as long as they have any code to test (eg, an abstract class with only abstract methods will not be a CUT). Anonymous and private classes are not CUTs. Protected and package level classes are bit tricky, and at least for the moment they are not considered as CUTs (might change in the future though).
Note: till Java 7, there would be no point in considering an interface as CUT. But, from Java 8 onward, interfaces might have code. Furthermore, when we build the CUT graph, we need to consider interfaces as well, regardless of whether they have any branch (ie code) or not.
| Modifier and Type | Class and Description |
|---|---|
static class |
ProjectStaticData.ClassInfo
Immutable class representing all the info data for a class
|
| Constructor and Description |
|---|
ProjectStaticData() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addNewClass(ProjectStaticData.ClassInfo info)
Add a new ClassInfo.
|
boolean |
containsClass(String c) |
ProjectStaticData.ClassInfo |
getClassInfo(String name)
Return the class info of the given class (with full qualifying name),
or
null if missing |
Collection<ProjectStaticData.ClassInfo> |
getClassInfos()
Return an unmodifiable copy of the current data info of the classes in the SUT
|
Collection<String> |
getClassNames()
Return an unmodifiable copy of the names of the classes in the SUT
|
ProjectGraph |
getProjectGraph()
Return a read-only view of the current project CUT graph
|
int |
getTotalNumberOfBranches() |
int |
getTotalNumberOfClasses()
Return the number of classes in the project, including non-testable ones
|
int |
getTotalNumberOfTestableCUTs()
If an abstract class or interface has no coded/implemented method, then
there would be no point in generating test cases for it
|
boolean |
hasChanged(String javaFileName)
Returns true if a class has been changed, false otherwise
|
void |
initializeLocalHistory() |
boolean |
isToTest(String className,
int n)
It checks whether EvoSuite was able to improve coverage,
test suite size, etc for 'className' in the last N
generations.
|
protected void |
setProject(Project project) |
public void initializeLocalHistory()
protected void addNewClass(ProjectStaticData.ClassInfo info)
info - public boolean containsClass(String c)
public ProjectStaticData.ClassInfo getClassInfo(String name)
null if missingname - public int getTotalNumberOfClasses()
public int getTotalNumberOfTestableCUTs()
public int getTotalNumberOfBranches()
public Collection<ProjectStaticData.ClassInfo> getClassInfos()
public Collection<String> getClassNames()
public boolean hasChanged(String javaFileName)
protected void setProject(Project project)
public boolean isToTest(String className, int n)
className - n - public ProjectGraph getProjectGraph()
Copyright © 2010–2016 EvoSuite. All rights reserved.