invariant using the dumpNumericalInvariant. So,
we tried to set
onlyPolyhedra to true and run the
analysis. We got the same error message that we
obtained when we try the injection checker. In
summary, Julia helps us with a specific case study,
but we faced an issue on a complicated case study.
Julia can also use both bounded differences
(bugseng, 2017) and polyhedra together, falling back
to bounded differences when polyhedra are not
needed. This option is unavailable online due to
internal issues related to the company that owns
Julia. One possibility would be to use polyhedra and
bounded differences for the application under
analysis and bounded differences only for the
libraries used by the software developer such as Java
swing library. However, while Julia authors suggest
this, they also they confirm that the Julia team has
never tested the polyhedra.
The fact that polyhedra does not scale up in some
cases is due to the amount of code that Julia must
check. Since static analysis tries to analyze the code
statically, it does so through approximations. If the
code uses a lot of libraries, such as any decent Java
program, then there is simply too much code (and
especially code that is not necessarily accessible to
the static analyzer, e.g., in Java libraries) for the
analyzer to finish in a decent amount of time (if at
all).
We searched for ways to proceed in such
circumstances (limitations) to help the static
analyzer. In other words, to reduce the computations
that the static analyzer need to do. For instance, some
steps can be done to help the analyzer, so that the
analyzer has fewer computations/assumptions to
make. If the code we analyze uses a function from a
library that we (humans) know returns an integer
between 1 and 10, then, we can inform the analyzer
of such a situation. Hopefully, such step could help
the analyzer. We thought of different ways to help
Julia finds relationships between variables defined in
the code. Specifically, we believe we could ourselves
look at the code and identify information that could
simplify Julia’s analysis. We wondered whether
other kinds of annotations could be of any help to us,
including: (1) Annotations to specify bounded ranges
of values for different types of variables (other than
numerical variables); (2) Annotations to specify
specific values for variables. These values could be
enumerated or continuous; (3) Annotations to specify
exceptional / illegal values. These values could be
indicated easily as we already do that for handling
invalid input. Hence, using annotation, Julia could
excludes such values from the set of possible values
of a variable. If we have an option, then, we can
express bounded ranges, using specific annotations;
(4) Annotations to tell Julia to ignore some calls
which we know are irrelevant to the analysis we ask
Julia to perform; (5) Annotations to tell Julia to
ignore some variables; (6) Annotations to tell Julia
that some calls / variables that we (humans) can tell
would not affect results. Hence, again Julia can
exclude them from computations. For instance, one
possibility might be to tell Julia to ignore a specific
call (e.g., a call to display the UI) in the analysis.
We did not find annotations in Julia to do the
listed items above. That might be related to the
analysis based on bounded difference: there are
bounded differences that Julia can automatically infer
from the code, and there are situations where Julia
needs help to do so. We found annotations for a
specific example; they are however not interesting to
us. The example is related to a checker called
GuardedBy checker. As for the termination checker
which is totally different from the
GuardedBy, we
did not find if there is a way to use those annotations.
We only found annotations that Julia understands for
code synchronization issues.
4.3 Writing the Invariant as Java Code
Our objective is to know whether a mathematical
function does represent the code related to the input-
output relation. Instead of asking Julia to obtain the
invariant, we can ask Julia to tell us whether our
predicted invariant is correct. We believe that we
reduce the computations that Julia needs to do when
we write the invariant and ask Julia to verify it
instead of asking Julia to find it. The validation of an
invariant is easier than finding that invariant. Hence,
the answer of Julia will be yes or no. Yes: means the
invariant (mathematical function/condition) is a valid
one. No: means the invariant is invalid. Since our
invariant is a predicted one, it may be a subset of the
real invariant. This could be a limitation of this
solution.
In this section, we present a way through which
we write the invariant as a Java code. Recall that the
invariant is a condition that should always be
satisfied regardless of the input of the software.
We write an if-statement in the Java code that has
the invariant as a condition. If the condition is
satisfied, then the if-statement will call an infinite
loop that we write inside the body of that if-
statement. We ask Julia to analyze the code for a
possible non-termination of the software. When the
program goes into an infinite loop, it does not
terminate. Julia should warn about such a possible
scenario. The non-termination usually happens due to