Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 10 Next »

Testing

To ensure reliability and stability of Safety Analysis a variety of tests are performed. We are using JUnit, Pi-test and other Java extensons connected with tests.

During execution of all tests bugs and issues are found. Analysis of tests results is available here.

Acceptance tests

Unit tests

Command Line Use Case Tests Specification

This page contains documentation for CLI Use Case Tests in order of appearance in code.

TestParser test - unrecognized argument
DescriptionThis test checks GNU Parser for use of unrecognized argument.
ConditionsArgument must be one of given in tables above.
Test procedure
      1. Pass the argument to CLI "-l"
      2. Compare result with expected result
Expected resultsOutput string: "Encountered exception while parsing using GnuParser:\nUnrecognized option: -l"

TestAnalyze Fault Tree - no tree loaded
DescriptionThis test checks correctness of Fault Tree Analysis.
ConditionsNo tree loaded.
Test procedure
      1. Pass the argument to CLI "-a"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "There is no tree that I could analyze."

TestCheck the Cohesion of Event Tree - no tree loaded
DescriptionThis test checks cohesion of Event Tree.
ConditionsNo tree loaded.
Test procedure
      1. Pass the argument to CLI "-c"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "There is no tree that I could analyze."

TestGet Fuzzy Importance Index of Fault Tree - no tree loaded
DescriptionThis test gets fuzzy importance index of fault tree.
ConditionsNo tree loaded.
Test procedure
      1. Pass the argument to CLI "-i"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "There is no tree that I could analyze."


TestLoad Event Tree - wrong tree
DescriptionThis test checks Event Tree loading from file.
Conditions-
Test procedure
      1. Pass the argument to CLI "-e wrong.xml"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Event Tree file from: wrong.xml Fail"

TestLoad Fault Tree - wrong tree
DescriptionThis test checks Fault Tree loading from file.
Conditions-
Test procedure
      1. Pass the argument to CLI "-f wrong.xml"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Fault Tree file from: wrong.xml Fail"

TestLoad Event Tree - correct tree
DescriptionThis test checks Event Tree loading from file.
Conditions-
Test procedure
      1. Pass the argument to CLI "-e treeXmltest2.xml"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Event Tree file from: treeXmltest2.xml Success"

TestCheck Cohesion of Event Tree
DescriptionThis test checks cohesion of Event Tree.
ConditionsSucesfully load Event Tree from file.
Test procedure
      1. Pass the argument to CLI "-e treeXmltest2.xml -c"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Event Tree file from: treeXmltest2.xml Success\n"Result of the analysis Events Tree: \nEvents tree is ok"

TestCheck Report generation
DescriptionThis test checks report generation.
Conditions-
Test procedure
      1. Pass the argument to CLI "-r Report.odt"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nCreated file: Report.odt"

TestLoad Fault Tree - correct tree
DescriptionThis test checks Fault Tree loading from file.
Conditions-
Test procedure
      1. Pass the argument to CLI "-f exampleFaultTree.xml"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Fault Tree file from: exampleFaultTree.xml Success"

TestGet Fuzzy Importance Index of Fault Tree
DescriptionThis test gets fuzzy importance index of fault tree.
ConditionsSucesfully loaded Fault Tree.
Test procedure
      1. Pass the argument to CLI "-f exampleFaultTree.xml -i"
      2. Call the method
      3. Compare result with expected result
Expected resultsOutput string: "\nRead Fault Tree file from: exampleFaultTree.xml Success\nResult of the analysis Fault Tree: \nKey: root = Value: "

  • No labels