mirror of
https://sharelatex.tu-darmstadt.de/git/681e0e7a3a9c7c9c6b8bb298
synced 2025-12-08 05:27:59 +00:00
Update on Overleaf.
This commit is contained in:
@@ -509,7 +509,7 @@ Hypothesis is a property-based testing framework, which allows developers to def
|
||||
|
||||
Hypothesis integrates seamlessly with \texttt{pytest} and uses the \texttt{@given} decorator to specify input generation strategies. For example, given the \gls{asn1} structure defined in the \gls{sgp22} specification for the \texttt{GetProfileInfo} function:
|
||||
|
||||
\begin{verbatim}
|
||||
\begin{lstlisting}[caption={ASN.1 definition of the ProfileInfoListRequest}]
|
||||
ProfileInfoListRequest ::= [45] SEQUENCE {
|
||||
searchCriteria [0] CHOICE {
|
||||
isdpAid [APPLICATION 15] OctetTo16,
|
||||
@@ -518,11 +518,11 @@ ProfileInfoListRequest ::= [45] SEQUENCE {
|
||||
} OPTIONAL,
|
||||
tagList [APPLICATION 28] OCTET STRING OPTIONAL
|
||||
}
|
||||
\end{verbatim}
|
||||
\end{lstlisting}
|
||||
|
||||
We define the following Hypothesis test for the Python implementation of \texttt{GetProfileInfo}:
|
||||
|
||||
\begin{lstlisting}[language=Python, caption={Hypothesis-based fuzzing of \texttt{GetProfileInfo}}]
|
||||
\begin{lstlisting}[language=Python, caption={Hypothesis-based fuzzing of \texttt{GetProfileInfo} function which sends a \texttt{ProfileInfoListRequest}.}]
|
||||
@given(
|
||||
use_iccid=st.booleans(),
|
||||
profile_class=st.one_of(st.integers(min_value=-20, max_value=20), st.none()),
|
||||
|
||||
Reference in New Issue
Block a user