The key to a good test is to try like hell to break the code. That means a few tests of the "normal" functionality and a lot of tests of abnormal functionality. With that, I'd try:
Some normal tests:
- Multiply positive and negative sized numbers that are 2-100 bits. Do this in a nested loop so it multiplies all combinations of sizes.
- Try multiplying numbers of size 0 and 1. These should both be illegal.
- Try multiplying when z isn't big enough to hold the result, when z is exactly the right size,
and when z is bigger than the result. Do this with positive and negative results.
But is there any bibliography which speaks about this kind of testing?
Documentation etc... i've tried in the web to find something but except slide of software engineer i haven't found anything else.
I'm not aware of any such documents or reference. You could search for testing of various processors, but that's all I can think of. Two's complement multiplication isn't very difficult except when the sizes vary, as my tests suggest.