I was a contract employee at Microsoft, an SDET I. While I was there I learned quite a lot about testing, and I really believe it made me a much better programmer. Although my time there was short lived, I managed to retain some of my testing knowledge, and I hope to share that with you now. So I’ll quickly and briefly cover the basics of testing. I’m not talking about unit testing either. I’ll break down the types of tests you have into different categories. There may be more.
BVT (Base verification tests)
–Positive test cases
FVT (Functional verification tests)
–Positive Test CasesĀ (Tester tests for expected failures )
–Negative Test Cases (We catch unexpected failures during testing (hopefully) )
Just a reminder how const-ness works. If I remember correctly.
// These two lines are the same type
// const and int can be switched around and the result is the same.
const int i;
int const j;
// If the word "const" follows the "*", it affects the pointer
int* const k;
// Both the pointer and the int are const
const int* const m;
// Same as line above, it just looks weird
int const * const n;
// Does the const affect the pointer or the int? The int..
int const * p;
Once upon a time, there was a language that didn’t have 2 dimensional arrays. This greatly upset the programmer. Fortunately, the programmer was swift in the art of arithmetic and overcame this obstacle easily.
Lets say for example, we only have access to a 1 dimensional array data structure and it has 50 elements in it.
int data[50];
Lets break this array up into 10 rows and 5 columns to make a grid. So how do we get access to a position say data[4][3]?
There are two things I’m going to teach you now:
1) Retrieve the column & row numbers from a linear index counter.
2) Retrieve the index from a row & column numbers.
Sometimes aggregation is called composition when the difference doesn’t matter.
Note: In UML, aggregation is an unfilled diamond, whereas composition is a filled diamond.
I’m in the process of redoing my “testing” engine. I hope to make it robust, scalable, modular, while supporting a lot of other different technologies. This is the start of it using D3D9, but don’t worry, I’ll eventually port it over to d3d11. I’m going to skip 10 though. I have lots of things in the works for it too!
As you can see here, I have a few simple cubes and a triangle grid. Most likely the grid will turn into terrain. I haven’t decided what I wanted to name the engine yet. I’m leaning towards “Tornado.” I remember looking into a physics engine a while ago named “Cyclone” and I thought the name was interesting.
I think I’m going to start posting about general C++ stuff too and since C++ is my favorite language (aside from assembly) I thought it would be interesting to post obscure C++ things that I find. Today I’m going to talk about a blog post that I found a while ago regarding constructors.
The fellow (I forgot where I saw it) mentioned that there was a significant difference the two lines of code.
Class *pClass = new Class;
Class *pClass = new Class();
The first line will NOT initialize intrinsic data types. So they will be filled with whatever when the object is instantiated.
The second line, on the other hand, WILL initialize all intrinsic data types to zero.
There are a couple of issues to be aware of though:
1) There must NOT be a default constructor available.
2) This is very well compiler/implementation dependent. I haven’t actually checked the standard though but I don’t see why the standard would define such a thing since it could (theoretically) impose a performance risk.
Looking back at point 1, lets use an example:
Class{
int foo;
};
Note: No default constructor or destructor. In this case, the compiler will provide them for your automatically. At least Microsoft’s compiler will. In that case, it will be kind enough to also initialize foo to zero if you specify
Periodically I’ll stumble across a small but useful piece of code. I have a small list right now, but as I stumble across them, I’ll post them here. Note: I do not take credit for any of this code.
Pausing your application
__asm int 3;
or
__debugbreak();
Convert any data type to a std::string object
#include <sstream>
template <typename T>
std::string toString( const T &arg )
{
std::stringstream ss;
ss << arg;
return ss.str();
}
Test if a float is zero or near zero
inline bool IsZero( float val )
{
return( fabs( val ) < EPSILON);
}
EPSILON is a #define that is something small, like 0.002f
Note, I will repost, I just realized that serendipity can’t handle angle brackets…
Description: A fast-paced comic book style 3D isometric based action/adventure game where the player must battle hordes of minions in order to save the galaxy.
Gameplay video footage of Sundown Cerose.
Position: Technical Director
Date: 2008 – 2009
Accomplishments:
Designed and coded the input, using DirectInput, scene management system, using TinyXML, physics, collision detection, and the engine framework to allow for dynamic object interactivity.
Implemented all of the required features by utilizing C/C++, the Win32 API, DirectX, C/C++ Standard Libraries, and the STL to ensure a robust framework on the Windows PC platform.
Worked closely with the designer and the producer to successfully implement the game’s required features before the preceded milestones.
Engineered a component based design using Object Oriented Programming principles to allow for versatility in the engine framework.
Assisted in the core design of “Sundown Cerose” in order to plan the development of a dynamic and robust engine architecture that would meet the designs requirements.
Designed and Implemented the level editor
Platform: PC
Requirements: Windows XP, DirectX 9 compatible graphics card, 512 MB RAM, 1.6 GHz Processor, Vertex/Pixel shaders 2.0 or greater.