bkochuna / ners570f23-SpMV

1 stars 0 forks source link

Add tests for the DEN matvec method #27

Open KyleVaughn opened 11 months ago

KyleVaughn commented 11 months ago

Description:

This will be a unit test added to the DEN matvec method. It will confirm that the vector output by the DEN matvec method is correct which is crucial to confirm the method functions accordingly.

Tasks:

Definition of done:

All of the assertions pass confirming the function produces the correct vector

Lazy-Beee commented 11 months ago

I would suggest using the function interface virtual fp_type* matvec(fp_type* vecin) and I'll add this to the SparseMatrix class.


Edit: change the api to avoid memory leak void matvec(fp_type* vecin, fp_type* vecout)

KyleVaughn commented 11 months ago

Review by @nzamb222

nzamb222 commented 11 months ago

Should also make tasks on the kind of error messages/codes that will be given if the test failed.

bkochuna commented 11 months ago

Or at least clarify what the expected failure is.

There’s a subtler question here on whether you do the error checking with simple assertions like in DBC (that is designed to catch programming errors) or a more complex error/exception handling system that is meant to catch input errors from a user.

Here, I do not think you want to the latter as it is substantially more complex, adds runtime overhead, and you don’t have a clear use case for it, so “lean” principles suggest defer this if you don’t have a clear requirement for it.

On the other hand, verifying asserts have passed/failed is tricky business.

On Fri, Oct 13, 2023 at 10:55 PM nzamb222 @.***> wrote:

Should also make tasks on the kind of error messages/codes that will be given if the test failed.

— Reply to this email directly, view it on GitHub https://github.com/bkochuna/ners570f23-SpMV/issues/27#issuecomment-1762515021, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHRN4OLPUE5LNBEILDB67DX7H5LFANCNFSM6AAAAAA56SG6XU . You are receiving this because you are subscribed to this thread.Message ID: @.***>