TestingTo 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 testsSoftware testing method conducted to determine if the requirements of a specification or contract are met. It may involve User Acceptance Testing (UAT), Operational Acceptance Testing (OAT), Acceptance testing in extreme programming, alpha and beta testing. You write acceptance tests to check if your code is passing the requirements of project. You should run these tests in integration-test phase.Naming param is *className*ATest.java. Unit testsSoftware testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.Unit testing is commonly automated, but may still be performed manually. The objective in unit testing is to isolate a unit and validate its correctness. You should write JUnit to check every function that you use in your code. JUnit must be fast, it should be matters of seconds to run that test. JUnit should test only define unit of system. Naming param is *className*JUTest.java. Command Line Use Case Tests SpecificationThis page contains documentation for CLI Use Case Tests in order of appearance in code. Test | Parser test - unrecognized argument |
---|
Description | This test checks GNU Parser for use of unrecognized argument. |
---|
Conditions | Argument must be one of given in tables above. |
---|
Test procedure | - Pass the argument to CLI "-l"
- Compare result with expected result
|
---|
Expected results | Output string: "Encountered exception while parsing using GnuParser:\nUnrecognized option: -l" |
---|
| Test | Analyze Fault Tree - no tree loaded |
---|
Description | This test checks correctness of Fault Tree Analysis. |
---|
Conditions | No tree loaded. |
---|
Test procedure | - Pass the argument to CLI "-a"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "There is no tree that I could analyze." |
---|
| Test | Check the Cohesion of Event Tree - no tree loaded |
---|
Description | This test checks cohesion of Event Tree. |
---|
Conditions | No tree loaded. |
---|
Test procedure | - Pass the argument to CLI "-c"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "There is no tree that I could analyze." |
---|
| Test | Get Fuzzy Importance Index of Fault Tree - no tree loaded |
---|
Description | This test gets fuzzy importance index of fault tree. |
---|
Conditions | No tree loaded. |
---|
Test procedure | - Pass the argument to CLI "-i"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "There is no tree that I could analyze." |
---|
|
| Test | Load Event Tree - wrong tree |
---|
Description | This test checks Event Tree loading from file. |
---|
Conditions | - |
---|
Test procedure | - Pass the argument to CLI "-e wrong.xml"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Event Tree file from: wrong.xml Fail" |
---|
| Test | Load Fault Tree - wrong tree |
---|
Description | This test checks Fault Tree loading from file. |
---|
Conditions | - |
---|
Test procedure | - Pass the argument to CLI "-f wrong.xml"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Fault Tree file from: wrong.xml Fail" |
---|
| Test | Load Event Tree - correct tree |
---|
Description | This test checks Event Tree loading from file. |
---|
Conditions | - |
---|
Test procedure | - Pass the argument to CLI "-e treeXmltest2.xml"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Event Tree file from: treeXmltest2.xml Success" |
---|
| Test | Check Cohesion of Event Tree |
---|
Description | This test checks cohesion of Event Tree. |
---|
Conditions | Sucesfully load Event Tree from file. |
---|
Test procedure | - Pass the argument to CLI "-e treeXmltest2.xml -c"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Event Tree file from: treeXmltest2.xml Success\n"Result of the analysis Events Tree: \nEvents tree is ok" |
---|
| Test | Check Report generation |
---|
Description | This test checks report generation. |
---|
Conditions | - |
---|
Test procedure | - Pass the argument to CLI "-r Report.odt"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nCreated file: Report.odt" |
---|
| Test | Load Fault Tree - correct tree |
---|
Description | This test checks Fault Tree loading from file. |
---|
Conditions | - |
---|
Test procedure | - Pass the argument to CLI "-f exampleFaultTree.xml"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Fault Tree file from: exampleFaultTree.xml Success" |
---|
| Test | Get Fuzzy Importance Index of Fault Tree |
---|
Description | This test gets fuzzy importance index of fault tree. |
---|
Conditions | Sucesfully loaded Fault Tree. |
---|
Test procedure | - Pass the argument to CLI "-f exampleFaultTree.xml -i"
- Call the method
- Compare result with expected result
|
---|
Expected results | Output string: "\nRead Fault Tree file from: exampleFaultTree.xml Success\nResult of the analysis Fault Tree: \nKey: root = Value: " |
---|
|