-
-
Notifications
You must be signed in to change notification settings - Fork 68
[EXPERIMENTAL] Generated unit tests #878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[EXPERIMENTAL] Generated unit tests #878
Conversation
|
Interesting project. Once you get the code coverage numbers up and the tests passing, how will you measure effective asserts that guard against regressions? Also, are the tests that you generated produced with the existing tests in mind or was the generator blind to the existing tests? |
|
Good questions
|
| /// </summary> | ||
| public class NilTests | ||
| { | ||
| private readonly Nil _nilInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Nil type, and some other types these new files are testing, are not actually part of Nerdbank.Streams' public API. We link it in from a git submodule and it compiles as internal. This test ought to not even compile. And in this case our policy is to assume the code in the submodule is already well tested in its own repo, such that we focus our testing on the code that is novel here.
|
|
||
| public override int Read(Span<byte> buffer) | ||
| { | ||
| Thread.Sleep(delayMilliseconds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is peculiar. I don't usually care for Thread.Sleep in tests because it makes tests run slowly.
In this case, this private class isn't even referenced by anything. So why was it generated?
Context
Generated with very early preview of unit tests generation tool. Trying to evaluate if there is any hope of that being useful and what would need to be worked on to achieve usefulness.
Technical data
Baseline (main):
Target (generated):
(The after seem to have lest test as I removed net472 targetting. otherwise 198 tests were generated)
More comments