Description
I wanted to start a singular thread for all contributors to weigh in on our testing approach. I've been reading up on pytest, and remembered hypothesis(corrected, thank you Spectre!) as an additional library we could use. I apologize if none of this is really necessary, I just had thoughts and I wanted to write them down to try and help out. 😃
Firstly, it would benefit us to discuss timing. With #42 currently in progress (and looking good) it would likely mean a major version increment in sectionproperties. Do you want to wait until shapely is fully incorporated to begin developing tests? If we don't wait, do we progressively roll out testing, or lump it all in one release?
I'm completely inexperienced with software testing, so please weigh in if you know better! I don't even really know how a user could easily run our tests, after they're pushed with a release (or how to setup TravisCI to do it). However, I envision a two-fold approach to sectionproperties testing:
-
Functionality - The library needs to work for at least a majority of cases in which it could be used. If edge cases exist that cause unexpected behavior, they should be known. This is where hypothesis seems valuable, and from my reading this approach seems to be typically what people mean when they're talking about software testing.
-
Accuracy - Since this library performs engineering calculations, it should have some manner of proving its accuracy. Obviously each analyst who uses it is responsible for their own projects and calculations, but having a high level of confidence that the software can produce correct results, given the correct inputs, will be a boon to all users. This I see as setting up tests on known problems from academia, experimental results, and publications. It doesn't necessarily fall into an edge case that might break the code. We don't need to test and validate every step of the FE process, that would be frivolous, but comparing to examples in a textbook seems feasible (I don't have a copy of Pilkey, I'll have to pick one up eventually).
Full disclosure: I want to use this more at work and recruit others to start using this as well, so having that complete testing suite running really helps make the "sale" to tech fellows and managers. 😄