Closed xMestas closed 5 years ago
Related to #26
@xMestas if the program is given an unexpected input, rather than leading to a test failure, shouldn't the program handle that (e.g., by reporting a message and closing)?
(if the test failures are just temporary, and could be resolved by such an approach later, then that's ok)
In most cases in does that. The problem is that it may check for this at some point in the program, and assume it is correct in the future. For example, if a graph edge is greater than 1, it will print an error and exit when building the graph. Because of this, the functions that use the graph don't test if the edges are greater than 1 or not because it could never happen. However, if you test that function with a graph that has edges greater than 1, this will cause the test to fail because the function isn't checking, it is just assuming its input is good.
Initial pytest testing suite consisting of 84 test cases. 61 of them pass, and 23 of them are marked as expected to fail. The reason that many of the tests fail is due to giving them invalid or unexpected inputs. These don't really show that the program isn't working correctly, but they do suggest that in the case that a unit was given invalid input, it would fail. These situations are unlikely to occur and low priority to fix I believe. This should be a good starting point for creating a larger test suite and ensuring that future changes do not impact the functionality of the program.