Unit testing, what do you think about it?
#1

Hey,

So, i have recently started creating a library that includes utility methods for working with dates and times.
I have had a couple of errors that i didn't notice because i didn't test the code properly (or i did it poorly), so i am now here to ask, do you test your code, if yes, how do you do it?
As for me, i now started to create my own assertion / test library containing some in my opinion useful macros and methods, if you want to, you can look at it here:

https://github.com/Bios-Marcel/Devel...r/DevTools.inc

Thias is how using it looks like:

https://github.com/Bios-Marcel/Date-.../unitTests.pwn

You can skip a whole test suite by using SKIP_TEST

Tell me what you think about it (it is about functionallity, not about performance!)

And no, i don't provide any guarantee that the code works perfect, if anyone intends to use it

greetings Marcel
Reply
#2

That's just not enough to be called a suite. Where are your random value tests?
Reply
#3

Tests always are a good idea. Though I dont see that many applications for them in gamemodes, as most functions dont return stuff, but do something ingame. Testing ingame stuff often is overkill, and most of the returning functions are too simple to justify writing a test for them.
For me, testing in samp would probably be limited to just a handful of funcitons deep down at the low level of "mechanical" functions.
Reply
#4

Quote:
Originally Posted by KingHual
Посмотреть сообщение
That's just not enough to be called a suite. Where are your random value tests?
You are right, i didnt write much yet, i am a little lazy ^^

And yeah, i dont use random testing yet, but looks like a good idea, but i am not quite sure how to make it, sonce if i use random values i'd again have two write logic to check its output, right?
Reply
#5

Quote:
Originally Posted by KingHual
Посмотреть сообщение
That's just not enough to be called a suite. Where are your random value tests?
Hey again,

I'd like to get some examples for what i could test using random data, cause i don't really see much to random test.
Maybe its the way i am thinking about it
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)