Skip to content

Commit

Permalink
simplify analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Sep 15, 2021
1 parent 761b1c3 commit 36d4463
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 120 deletions.
21 changes: 5 additions & 16 deletions RACK-Ontology/ontology/ANALYSIS.sadl
Expand Up @@ -30,8 +30,11 @@ ANALYSIS
runBy (note "Agent responsible for running the analysis.") describes ANALYSIS with values of type AGENT.
runBy is a type of wasAssociatedWith.

analyzedWith (note "Agent responsible for producing the output.") describes ANALYSIS with values of type AGENT.
analyzedWith is a type of wasAssociatedWith.
analyzedWith (note "Tool responsible for producing the output.") describes ANALYSIS with values of type ENTITY.
analyzedWith is a type of used.

analysisInput (note "Entities targetted by the analysis.") describes ANALYSIS with values of type ENTITY.
analysisInput is a type of used.

ANALYSIS_OUTPUT
(note "Output of an ANALYSIS")
Expand All @@ -40,17 +43,3 @@ ANALYSIS_OUTPUT
analyzes (note "ENTITY(s) under analysis") describes ANALYSIS_OUTPUT with values of type ENTITY.
analyzes is a type of wasImpactedBy.

producedBy (note "ACTIVITY(s) (e.g. ANALYSIS) producing this output") describes ANALYSIS_OUTPUT with values of type ACTIVITY.
producedBy is a type of wasGeneratedBy.

// results (note "Which analysis report this annotation comes from.") describes ANALYSIS_RESULT with a single value of type ANALYSIS_OUTPUT.

ANALYSIS_RESULT
(note "A result of the analysis that is linked to some specific part of the system.")
is a type of ENTITY.
fromOutput (note "Which analysis report this annotation comes from.") describes ANALYSIS_RESULT with a single value of type ANALYSIS_OUTPUT.
finding (note "Individual elements of the result.") describes ANALYSIS_RESULT with values of type ANALYSIS_FINDING.

ANALYSIS_FINDING
(note "An open/extensible set of analysis findings.")
is a type of THING.
92 changes: 41 additions & 51 deletions sadl-examples/RequirementAnalysisExample.sadl
Expand Up @@ -16,19 +16,20 @@ RAE_MODEL is a type of MODEL.
RAE is a type of ANALYSIS.

RAE_OUTPUT is a type of ANALYSIS_OUTPUT
described by shellCheckExitCode with a single value of type integer.
described by cvr with values of type CONTROLLED_VARIABLE_RESULT.

CONTROLLED_VARIABLE_RESULT is a type of ANALYSIS_RESULT
described by result with a single value of type RAE_RESULT.
CONTROLLED_VARIABLE_RESULT is a class
described by cvrCheck with a single value of type RAE_CHECK
described by cvrResult with a single value of type RAE_RESULT.

RAE_RESULT is a class must be one of {Passed, Failed, Indeterminate}.

RAE_CHECK is a type of ANALYSIS_FINDING.
RAE_CHECK is a type of THING.



/* This goes in the data */
ASSERT-RAE is a TOOL.
ASSERT-RAE is a ENTITY.
russell-d-e is a PERSON.
/***********************************************
* REQUIREMENTS and DATA_DICTIONARY
Expand Down Expand Up @@ -90,55 +91,44 @@ SYSTEM_analysis is a RAE
***********************************************/
output_1_SYSTEM_output is a RAE_OUTPUT
analyzes output_1_SYSTEM
An:producedBy SYSTEM_analysis.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_1_SYSTEM_output
with result Passed
with finding InnerContingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_1_SYSTEM_output
with result Passed
with finding Contingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_1_SYSTEM_output
with result Passed
with finding GlobalContingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_1_SYSTEM_output
with result Passed
with finding PairConflict.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_1_SYSTEM_output
with result Failed
with finding Completeness.
wasGeneratedBy SYSTEM_analysis
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck InnerContingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck Contingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck GlobalContingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck PairConflict)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Failed
cvrCheck Completeness).

output_2_SYSTEM_output is a RAE_OUTPUT
analyzes output_2_SYSTEM
An:producedBy SYSTEM_analysis.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding InnerContingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding Contingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding GlobalContingency.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding PairConflict.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding Completeness.
a CONTROLLED_VARIABLE_RESULT
with fromOutput output_2_SYSTEM_output
with result Passed
with finding Surjectivity.
wasGeneratedBy SYSTEM_analysis
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck InnerContingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck Contingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck GlobalContingency)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck PairConflict)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck Completeness)
cvr (a CONTROLLED_VARIABLE_RESULT
cvrResult Passed
cvrCheck Surjectivity).

/***********************************************
* RAE Check Definitions
Expand Down
108 changes: 55 additions & 53 deletions sadl-examples/ShellCheckAnalysisExample.sadl
Expand Up @@ -7,39 +7,50 @@ import "http://arcos.rack/AGENTS".

/* This goes in an overlay */

SHELLCHECK_OUTPUT is a type of ANALYSIS_OUTPUT
described by shellCheckExitCode with a single value of type integer.
SHELLCHECK_OUTPUT
is a type of ANALYSIS_OUTPUT
described by shellCheckExitCode with a single value of type integer
described by scResult with values of type LINE_RESULT.

LINE_RESULT is a type of ANALYSIS_RESULT
LINE_RESULT
is a class
described by resultTargetFile with a single value of type FILE
described by resultTargetLine with a single value of type integer.

SHELLCHECK_SEVERITY is a class
described by resultTargetLine with a single value of type integer
described by finding with a single value of type SHELLCHECK_FINDING.

SHELLCHECK_SEVERITY
is a class
must be one of {WARNING, ERROR, INFO, STYLE}.

SHELLCHECK_FINDING is a type of ANALYSIS_FINDING
SHELLCHECK_FINDING
is a type of THING
described by referenceUrl with a single value of type string
described by severity with a single value of type SHELLCHECK_SEVERITY.

SHELLCHECK_INVOCATION
is a type of ANALYSIS
described by scCheckSourced with a single value of type boolean
described by scInclude with values of type string
described by scExclude with values of type string
described by scFormat with values of type string.

/* This goes in the data */

ShellScript is a FORMAT.
MachO_Executable_x86_64 is a FORMAT.

EricMertens is a PERSON
EricMertens
is a PERSON
title "Eric Mertens".

ShellCheckExecutable is a FILE
ShellCheckExecutable
is a FILE
fileFormat MachO_Executable_x86_64
filename "~/.cabal/bin/shellcheck"
fileHash (a FILE_HASH
hashType SHA1
hashValue "1d5bb912481c4510e3e0a3896a4896d64b55d983").

ShellCheck is a TOOL
toolVersion "0.7.2"
definedIn ShellCheckExecutable.

/* Shell check defines many checks, these are a few
* https://gist.github.com/eggplants/9fbe03453c3f3fd03295e88def6a1324#file-_shellcheck-csv
*/
Expand Down Expand Up @@ -97,9 +108,12 @@ ExampleSh (note "A shell script available at https://github.com/koalaman/shellch
hashType SHA2_256
hashValue "1bd91469cac8d65228ab28b393d2f3b35de6f8ed40ee9364ba2a00d430479b80").

RunShellCheckOnExampleSh is an ANALYSIS
analyzedWith ShellCheck
runBy EricMertens
RunShellCheckOnExampleSh
is an SHELLCHECK_INVOCATION
scCheckSourced true
analyzedWith ShellCheckExecutable
analysisInput ExampleSh
wasAssociatedWith EricMertens
startedAtTime "2021-08-17T23:00:00Z"
endedAtTime "2021-08-17T23:00:01Z".

Expand Down Expand Up @@ -130,40 +144,28 @@ if [[ "$$(uname)" == "Linux" ]]
ExampleShShellCheckReport is an SHELLCHECK_OUTPUT
analyzes ExampleSh
wasGeneratedBy RunShellCheckOnExampleSh
shellCheckExitCode 1.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 6
finding SC2213.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 6
finding SC2220.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 8
finding SC2214.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 13
finding SC2221.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 15
finding SC2222.

a LINE_RESULT
fromOutput ExampleShShellCheckReport
resultTargetFile ExampleSh
resultTargetLine 19
finding SC2193.
shellCheckExitCode 1
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 6
finding SC2213)
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 6
finding SC2220)
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 8
finding SC2214)
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 13
finding SC2221)
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 15
finding SC2222)
scResult (a LINE_RESULT
resultTargetFile ExampleSh
resultTargetLine 19
finding SC2193).

0 comments on commit 36d4463

Please sign in to comment.