Dev Trick #001 - Testing (Patreon)
Content
Hello there!
Yes, I know, the title spoil all the content but hey...
So, today, we'll talk about something very passionating and very important when you're developping (and not especially VN, it's true for any kind of dev) : The test.
There is at least 2 kinds of tests, and 2 things to test for each :
- Technical test : You're testing the things only with a technical sight : is it returning what i want (for exemple if I test "aa == bb" I want to see if it return True or False, but I don't care if it return True or it return False). It's only technical. Usually, a big part of this is made when compiling the code.
- Fonctional test : You're the things but only with a "customer" view : Is my function return me all the things I wanted, regardless the format of it? Is my button red or yellow, etc...
And for each :
- Unit test : you're testing only one line, one function, one things only, and in an environment unlink to anything else. Usually, it say you if your code line is good written or not. It's a quick test, but necessary.
- integrated test : You're testing one line, one function, one things only, but in the global environment. So you'll know, after this test, if what you've wrote is working WITH the other things. It's usually longer (because you have to setup the environment) and it's a test to do after unit test.
Exemple in the VN world :
Technical test : It's usually the compiling and the fact to speed run all the VN and see if something go wrong (a splash screen with an error, a crash, etc...)
Fonctional test :
-- unit test : If Amy ask me if I want a coffee or a tea, and I answer a tea, did I get the render with the tea?
-- integrated test : If, in the previous chapter, Amy ask me if I prefer action movie or romantic movie, and I said Action movie, she will have rent the last Avenger and not Bridget Jones. (integrated : in all the environment, so the past story)
And some could add in the integrated test the coherence test as well : Is all the story is coherent with the past?
And so, who will test? Usually, the developer do the unit test, but it's others people who have to do the integrated test. Why? Because the developer is biased and so he will orient the test and the environment...
Here are for the testing.
Tell me if you like or not this, and what would you see for the next post of dev trick! :)
MoonLight