Hacker News new | past | comments | ask | show | jobs | submit login

Not to mention most unit tests are utterly useless in reality and test things we know to be true (1 + 1 -level nonsense), not real edge cases.

The logic that usually gets ignored in unit tests is the ones that actually needs to be tested, but skipped because it is too difficult and might involve a few trips to the database which makes it tricky (in some scenarios you need valid data to get a valid test result, but you cannot just go grab a copy of production data to run some test).

And then there is the problem of testing related code, packages and artifacts being deployed to production which is really gross in my mind and bloats everything further.

A team I've worked on has resorted to building actual endpoints to trigger test code that live alongside other normal code (basically not a testing framework), so that they could trigger test and "prove the system works" by testing against production data at runtime.




Your message is just a collection of ad-hoc points with no structure, context or justification for any of them.


The "message" is a response to the last paragraph.

>The reason a lot of Java or C# code is written with all these abstractions is because it aids unit testing.

That is the justification for talking about testing. Code is being ripped apart to make it easier to test, while the tests that are used as a justification for ripping apart the code are low quality as 99% of the work in unit testing is thinking of and setting up the test case, not the actual test code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: