c# - Does Unit Testing make Debug.Assert() unnecessary? -
This was a time when I prepared for the McNonell. Now I read it again in Hunt and Embedded; Thomas '': Use the claim! Note: Not a unit test assertion, I mean debug. Espress () .
The following questions and arguments are useful for the development, because "impossible" situations can be found very fast and it seems that they are usually used. As far as I understand, in C # they are often used to check the input variables for "impossible" values.
In order to keep unit tests as brief and isolated, I use empty s and "impossible" dummy input (such as an empty string) in the feed squares and methods.
Such tests are clearly documented, that they do not rely on certain inputs. Note: I am practicing that Meshearos is describing as "XYNET Test Pattern".
And this is the point: if I claim to protect these inputs, then they will blow my unit test.
I like the idea of artistic programming, but on the other hand I do not have to implement it. Currently, I can not think of any use for debugs. Eserat () . Maybe I'm missing something? Do you have any suggestions, where can they be actually useful? Maybe I just value the usefulness of the claims? Or maybe it can be reviewed again to test me?
EDIT: Very similar, but it does not answer the question that bothers me: should I care about the debug. > In C # if I have tested like I have described? If so, in what situation are they actually useful? There will be unnecessary
Another point: If you really think, this is a duplicate question, just post something comment.
In theory, you are right - the whole test becomes redundant in theory. In Parctice, they are still useful to debug your tests and catch future developers' efforts, who can not try to use the interface according to their desired words. In short, they serve only for a different purpose. Unit tests are there to catch the mistakes, which can not be done by the nature of the unit while writing the test.
I would advise them to keep them, because they provide another level of security with programmers mistakes.
They also have a local error protection mechanism, while the unit is tested out of the test code.
Comments
Post a Comment