This is why you should always seek to get to 100% test coverage, even if you are quite sure your current code is safe and well-written. In a project with hundreds of developers, you can't know what that code will look like in 3 years.
-
-
Show this thread
-
There is no such thing as a superfluous test. You are testing against unknown unknowns. Against the far future. Against other people. Etc. You should never make any assumptions about what needs testing and what doesn't.
Show this thread -
The return-on-investment of a unit test only goes up as a function of time elapsed and number of changes made. For a long-running project, it's the most valuable code you will ever write.
Show this thread
End of conversation
New conversation -
-
-
Any best practices examples for such unit tests?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Hi Francois, I (and I'm sure many others) would be super interested to see if you have any particular recommendations on reading material for how to write good unit tests.
-
Read Kent Beck's TDD book if you haven't already. There's also Growing Object-Oriented Software Guided by Tests, which goes into strategies for Integration Testing. Definitely look up the Testing Pyramid.
End of conversation
New conversation -
-
-
Thoughts on property-based testing? Unit-tests for models?
-
I’ve written model integrity tests for a ASP NET Core Web API. I just used reflection to check the number of properties in the class, the name of the properties and what attributes they were decorated with. With fluent assertions + XUnit, the syntax was really clean too.
End of conversation
New conversation -
-
-
This becomes even more important when you are developing code around models, where the uncertainty about model output is significantly greater simply by retraining it. We had to develop a complete toolkit for this. Do you have any insight on how you would approach this problem?
-
I wouldn't consider testing a model "unit testing", but I'm really curious how you did this. Do you have a blog post about the toolkit or something?
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.