sketchup-stl
sketchup-stl copied to clipboard
Implement Unit Tests
Once we've implemented an API for automating import and export, refactored the blocking messageboxes out of the code, #47, we should add some unit tests to this project.
What would be some useful tests? I'm not sure I completely understand what to test for.
What level to unit test a piece of working software is always a matter of pro and con. The religious would say that every method (and every code path inside that method) should be unit tested, and if that's hard to do then you should refactor.
The mildly practical would say "don't fix what's not broken," which throws out refactoring but still leaves unit testing every method as a good path.
In my opinion, the first step is to document a simple and standard way of running unit tests, even if we don't choose to attempt 100% code coverage. Then any bugs can be "proven to exist" then "proven to be fixed" by writing the unit test that demonstrates the problem.
Seeing that the SketchUp team is more experienced than the rest of the collaborators here, maybe you lot can start up with a couple of tests so we can use as an guide?
Monkey see, monkey do. oook
Yes, please layout an example or pattern we can follow.
K. I'll add it to my work list and try to post an example soon...
Might move this to version 2.3 - depending on the progress of TestUp2.