top of page
visual inspection

Visual Inspection

When implementing an algorithm, thorough testing is a must, especially for geometric algorithms. To ensure its effectiveness, assertions should be incorporated into the code for all operations, verifying that these operations perform as expected. It is essential to include an error back-propagation process, swiftly identifying and communicating significant errors to the user. These errors could stem from user misuse, data inaccuracies, or implementation flaws. While it is undesirable to have such errors, their prompt detection is crucial.

​

Furthermore, integrating a unit test framework is vital, subjecting all fundamental algorithm operations to testing with simple and predictable data. Each operation should exhibit the expected behavior. Benchmarks must also be applied to confirm that the algorithm maintains performance and memory integrity on large input sets.

​

Despite these rigorous testing methods, there is still no guarantee that a geometric algorithm will function perfectly. Even if numerical values appear accurate, the final result may still be incorrect. Another type of debugging a geometric algorithm is still and old-fashion way by simply looking at the intermediate and final results of the algorithm. You may see that numerically the algorithm is correct but visually performs differently from what you need.

​

That is why in addition to the mentioned testing techniques, I always implement an internal framework for visual inspection. This may range from a simple version exporting algorithm steps in a readable visualization format for open-source software, to deeper integrations with a company's internal visual tools. I usually add a way to visually inspect almost any geometric primitive and any step of the geometric algorithm that I implement.

bottom of page