SPARK Flussanalyse
Fokus: Variablen
Automatisch erkannte Probleme
- Fehlende Initialisierung
- Fehlerhafte Parametermodi
in und out inkorrekt verwendet - Statements ohne Effekt
Irrelevant für Output - Ungenutzte Variablen
Global Contracts
procedure P with
Global => (Input => (Y, Z), Output => X);
Depends Contracts
procedure Sum (A, B : in Integer; Result : out Integer) with
Depends => (Result => (A, B));
vom eigenen Ursprungswert abhängt
X, Y := 0;
procedure Set_X_To_X_Plus_Y with
Depends => (X =>+ Y);
unbeeinflussten Outputs
procedure Do_Nothing(X, Y) with
Depends => (null => Y);//Y beeinflusst keinen Output
procedure Set_X_To_Zero with
Depends => (X => null);//X hängt von keinem Input ab