Confessions of a researchaholic

March 7, 2017

Testing and debugging code

Filed under: Real — liyiwei @ 5:55 pm
Tags:

This post is meant for newbies.

Basically, your code should be highly modular, consisting of well-designed classes and functions. Then, unit test each module. This is much easier than trying to debug a large system, or a monolithic piece of code.

I debug almost entirely based on intuition, and never relied on any low level tools like tracers, even when I was a beginner.

For the ray tracing exercise, if you start with the Shirley series, the code should already be modular and incremental. After you finish that, you should have better foundation to design modular code for the ray tracing book by Glassner et al.

Feel free to ask specific questions (e.g. via the comments field of this post), and I will answer by updating and improving this post.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Theme: Rubric. Get a free blog at WordPress.com