Message board for the users of flat assembler.
> Projects and Ideas > Automatic unit tests for FASM projects.
JohnFound 08 Jan 2013, 19:47
It is not an existing project (sorry if the subject misled you). I think sometimes about a system that to allow easy testing of assembly written libraries that contains tens or even hundred procedures.
IMO, the test code must be defined directly in the source code of the library, near the procedure that is to be tested.
This approach will provide high consistency between the test code and the code under test - i.e. if I change the procedure, I can directly change the test as well.
So, then, the application code that will provide the test itself, should be automatically created without manually referring the particular procedures.
All these thoughts are only very sketchy. I even blurry imagine the possible syntax. The implementation is even less clear. (more, I vaguely imagine what "unit test" actually means. Usually this therm is used in relation with OOP.)
So, with this topic I would like to appeal for some discussion that to clean the problem and to outline some ways for possible implementation.
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
|08 Jan 2013, 19:47||
AsmGuru62 08 Jan 2013, 23:45
Very cool idea!
I would define a procedure as something, which has input and output.
Without these terms - we can't test the procedure. Even if procedure
somehow changes the state of global variables - it is still an output.
However, how to test the functions, which supposed to draw something
on screen. Say, I have a function called "Line":
stdcall Line, 100, 100, 389, 14
How to write a unit test which would prove that line was indeed drawn from
point (100,100) to point (389,14) and not to (388,14)? Pretty hard.
However, most of the code can be considered testable.
Also, unit test code should be included into some kind of conditional
assembly, to be switched ON/OFF as desired.
But the idea is very cool.
|08 Jan 2013, 23:45||
JohnFound 09 Jan 2013, 00:01
The graphics procedures and all other memory processing procedures can be easy tested, comparing the result memory block with some reference memory block produced by some other way.
|09 Jan 2013, 00:01||
TmX 10 Jan 2013, 02:59
Yes, unit testing is used nowadays in application development (some programming languages even has built-in unit testing mechanism), and it would be cool if such thing also available for assembly.
Actually it's not related to OOP. There is CUnit (unit testing for C), for example:
|10 Jan 2013, 02:59||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.