mwhit74 / mlob

Determinate structure moving load analysis
MIT License
8 stars 1 forks source link

Add unit testing #3

Closed mwhit74 closed 7 years ago

mwhit74 commented 7 years ago

Add unit testing for mlob.

mwhit74 commented 7 years ago

A more detailed look at what unit tests need to written.

user_input.py tests

output.py tests I'm not sure if this needs explicit testing. Will evaluate in the future. May happen after version 1.0

mlob.py tests

mwhit74 commented 7 years ago

Didn't take the time to figure out how to spoof the user input testing. For v1.0 we are going to rely on the user being able to input the information correctly. It appears to work with the examples I have run on it.

There are multiple tests for each of the mlob related tests. These are the "basic" tests. I tested the functions by creating an excel file to mimic each function and ran the same input in the program and in the excel. I started with an independent excel for each function and ended up linking them all together. It's no mlob but it works for testing and may be useful to the user to understand what is going on.

Finally I wrote the test to compare program results with AREMA Table values. This was not as hard as I thought it was going to be. It takes about 15 minutes to run on my laptop. I used a lot of the code from this test to implement a user verification function on the production so the user can quickly and easily verify the accuracy of the program for themselves.