sketchup-stl icon indicating copy to clipboard operation
sketchup-stl copied to clipboard

Implement Unit Tests

Open thomthom opened this issue 12 years ago • 6 comments

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.

thomthom avatar Dec 05 '12 09:12 thomthom

What would be some useful tests? I'm not sure I completely understand what to test for.

jimfoltz avatar Dec 16 '12 14:12 jimfoltz

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.

scottlininger avatar Dec 17 '12 15:12 scottlininger

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

thomthom avatar Dec 17 '12 22:12 thomthom

Yes, please layout an example or pattern we can follow.

jimfoltz avatar Mar 09 '13 14:03 jimfoltz

K. I'll add it to my work list and try to post an example soon...

scottlininger avatar Mar 11 '13 15:03 scottlininger

Might move this to version 2.3 - depending on the progress of TestUp2.

thomthom avatar Feb 26 '14 17:02 thomthom