-
Notifications
You must be signed in to change notification settings - Fork 4
Unit Tests
To test new functionalities and refactorings of the Neural-Network-Translator, some unit tests have been implemented.
To execute all available unit tests for this project, the following command can be executed (from the root directory of the repository): python -m test.complete_test_suite
This module will call all test cases from all available unit test suites.
The names of all unit tests are oriented to the following naming scheme:
[test_MethodName_StateUnderTest_ExpectedBehavior]
This should facilitate the interpretation of the unit test methods by their name.
The unit tests for the GCC backend include one test at the moment.
Examplary unit tests:
- test_buildMarkers_validIntermediateFormat_validMarkerDict
This tests can also be executed seperately with the following command (executed from the root directory of the repository):
python -m test.gcc_backend_test
The unit tests for the backend_utils class include 26 tests at the moment.
Examplary unit tests:
- test_replaceMarkers_stringWithSingleMarker_correctReplacedMarker
- test_replaceMarkers_stringWithNotExistentMarker_noReplacementDone
- test_convertArrayToString_onlyIntegerValues_correctStringRepresenationOfIntegerValues
- test_getNumberOfLayers_3DenseLayerInput_correctNumberOfLayers
- test_getLayerTypesString_2DenseLayerInput_correctLayerTypesString
- test_getOutputDimensions_poolingLayerInput_correctHeightWidthDepthDimensions
- test_getWeightInformation_MixedLayerSomeUsingWeightsTrueInput_correctWeightsValueStringWeightsIndicesString
This tests can also be executed separately with the following command (executed from the root directory of the repository):
python -m test.backend_utils_test