Monday, July 28, 2014

Testing

I was starting to get a bit scrambled with all the code I was writing, and I knew that there were probably a thousand bugs in the code that I had already written, so I decided to take a break and test what I had written so far.  I made a simple interface, and started diving into the bugs.  I'm very glad I decided to do this early on because I found even more differences between SQLite and MySQL, which required some rewriting.

I am only testing the general idea types at the moment.  I haven't tested the actual idea instances yet.  In fact, I haven't even started testing the idea types' columns yet.  I'm just touching the surface.  There's a surprising amount of testing to be done on every level.  However, I'm almost ready to start testing the columns.  I only have one more thing to test, and it has to do with inheritance.  Alot of work went into the code behind switching an idea type's inherited type.

There are three different scenarios I have to account for.  First, when the new inherited type is completely unrelated to the former inherited type.  Second, when the old and new inherited types share a common ancestor (I have to make sure all data that the two share is preserved).  Third, when the new inherited type is the type's descendant (which basically means that the type will inherit itself).  The first two are done for now, but the third has yet to be tested.  Originally, I wasn't going to allow the user to do the third one because it sounded like a mistake.  However, I found a way to make it work.

If you think of inheritance like a hierarchy, I'll remove the type from its old spot and fill the gap by tying its descendants to its ancestors.  After that, I'll stick it in its new spot.  That way, there won't be any circular inheritance.  This was a bit tricky to implement.  My brain was a bit fried for a few days, so it took me a while to pin down the best method, but it's written.  All I need to do now is test it.

I'm excited to finish testing this last step because that means I can move on to the columns.  Once they're mostly done, I'll likely move on to writing the link data that I mentioned in my last post.  It's a bit daunting, but I can't wait until it's done and working.  I've put alot of hours into this iteration of Idea and I'm ready for the gears to start turning.

In case you're curious, this is what my little test form looks like so far:


No, this is most definitely not what Idea will look like in the end!  This is strictly for testing.  Idea is only a library of code right now, and this form lets me play with the library.  After I feel that the library is complete enough, I'll start coding the real interface...hopefully.  I still have to figure out the best way to do it.  That's where I'm still a bit stumped.  Heck, I might go through multiple iterations of it before it's done, and that's fine.  It will be alot easier with the foundation already completed.

Thanks for reading!
clevceo

No comments: