Tests: Like a photo-negative of the code?


Mech Retriever Dev Blog


One interesting thing I’ve observed among people who are otherwise eager to code in an Object-Oriented style, because of its many advantages, is that they are surprisingly eager to go back to writing highly-procedural code while testing.  Yet, the more I refine the tests for the Mech Retriever code base, the more I’ve found that to be a mistake.

One interesting example I’ve been dealing with recently is the fact that my tests are tending to look like a photo-negative of my code.  Instead of just writing one big blog of tests, I have “Tester” classes that help test certain parts and tend to be inherited–and I’ve even found it to be effective to make an interface that different testers implement to be used by other tests.  What it means to test certain things, like “MechWasReportedAt” is different for, say, an AIView vs a GraphicalView.

It’s been a very enlightening process to go through and find new ways of doing testing.

May you build the ultimate giant robot.

Like, Share, Subscribe, or Tweet us!

Check us out on Youtube or Deviantart!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s