Skip to content

Coverage analysis report and suggested actions

Coverage analysis 12/03/21, based on 33065104

  • Initial coverage: 93% classes, 74% methods, 75% lines.
  • Current coverage: 94% classes, 80% methods, 83% lines.

Test cases

  • Imprimir todos los grafos
  • catch with a union type.
  • Create new object in try
  • Call super()/this() in try
  • Call without scope and define a variable within. (See IDF#handleActualAction).
  • Call with scope or arguments that may define multiple objects. For example, f(a ? b : c).
  • Call with scope or arguments that are defined within the method and that contain:
    • Array access
    • Cast
    • Conditional
    • Parenthesis
    • Field access
  • Directly or indirectly recursive methods?
  • Have a method return an unknown type?
  • Create a class that has a user-written as a field.
  • Declare multiple variables together (int x = 10, y = 20).
  • Nested assignment (a = b = c)
  • Static field as assigned expression (return, RHS of assignment, etc).
  • Multi-field field (a.b.c)
  • Constructor that throws exceptions (explicit in its headers).
  • Field expression outside an assignment with:
    • Multi-level field
    • Parenthesis
    • Cast
    • Scope that is not a name or this.
  • Field expression inside an assignment with:
    • Multi-level field
    • Parenthesis
    • Cast
  • Increment or decrement an array access
  • A structure that requires CC1 transitive traversal to complete.
  • Test with multiple compilation units.
  • Set slicing criteria with variables.
  • Set a slicing criterion with variable that requires the this. prefix.
  • A for statement whose initializer is required, but nothing else is.
  • An if that results in an empty body (when true).
  • A non-initialized object field.
  • A non-initialized boolean field.
  • A non-static class initializer.
  • Use an external library (source included).

Missing features

  • Interfaces
  • Ternary expressions inside field accesses (both anywhere and in an assignment).
  • Unqualified field assignment.

Code changes

Incorporated to !58 (merged).

  • Assume that every declaration in the call graph is represented by a CFG. This means removing the null check in IAF#initialValue and the optional check in CallConnector#connectCall.
  • Code repetition in CFGBuilder#visitCallableDeclaration
  • Remove IAF#obtainScope, and both #obtainedAliasedFieldName, unused
  • change if-return to assert !if in I[DU]F#handleActualAction.
  • Remove #visit(ExpressionStmt,Set<Expression>) from OutNodeVariableVisitor.
  • Consider uniting the SummaryArcAnalyzers, from sdg and jsysdg.
  • ExpressionObjectTreeFinder#locateAndMarkTransferenceToRoot(Expression, int) could change if to ternary.
  • Inline Graph#findNodeById(long)
  • ActualIONode#resolvedASTNode() repeats a method in ASTUtils. (applied)
  • Delete NodeType (really old left-over).
  • Delete GraphNode#addActionsAfterCall, #locateCallForVariableAction, and possibly #addActionsForCall.
  • Make ObjectTree#memberNode final.
  • Remove ObjectTree#isLeaf() and its corresponding one in VariableAction.
  • Remove VA#isObjectTreeEmpty() and ObjectTree#isEmpty().
  • Replace '-root-' by ROOT_NAME
  • Inline VariableVisitor#getLastDefinition().
  • VariableVisitor#getFieldsForReturn could be replaced by ASTUtils methods.
  • Rewrite or remove Slice#contains(Node).
  • Remove any printing that is not done through Logger.

Delayed:

  • Unit test GraphNode#addVAAfterLastMatchingRealNode
  • Update Javaparser when JavaParserSymbolDeclaration#isVariable() returns true (already fixed, waiting for release). Used in VariableAction.DeclarationType#valueOf(...). Assigned to issue #60 (closed).

Weird spots to investigate

  • #isPredicate(GraphNode<?>): always results in false
  • Why does CCDBuilder#hasCDPath always return true?
  • Review ESCallConnector#connectRemainingExceptionSources()
  • #findNextVarActionsFor is never executed, #findNextObjectDefinitionsFor always finds the corresponding member in its tree.
  • Discover what means the closing bracket of a for.
Edited by Carlos Galindo