News for hackers. Stuff that matters.
Re:Best practices for writing code comments by codedokode on Friday December 24, 2021 @04:43PM (#29678027)
Tests are not a replacement for comments or documentation. Tests check that A() returns x but don't explain what is A, x and why it should return it.
Re:Best practices for writing code comments by treis on Friday December 24, 2021 @06:28PM (#29678796)
That goes in the test name. You'll have something like

Feature A

"It should return X in [some edge case]"

That's where any link to a use case should be.