News for hackers. Stuff that matters.
Re:Where are we going from here? Software engineering needs ... by sidlls on Saturday July 03, 2021 @05:48PM (#27725204)
Depends on where you work. The cult of unit testing is pervasive in the Bay Area, at least. It doesn’t result in noticeably better software.
Re:Where are we going from here? Software engineering needs ... by FpUser on Saturday July 03, 2021 @06:00PM (#27725279)
I once had this fun contract to fix code in one giant application written in PHP. The org of decent size who wrote said code in a first place had code reviews, unit tests and what not.

The end result was that they had to hire outside person to fix what they have produced. I looked through the software and noticed whole bunch of iffy patterns. Ended up writing giant Python script that searched said patterns and fixed it where possible marking with appropriate comments and issued a warning comments where it could not.

Not sure if this is a regular occurrence in companies that write and maintain their internal software as this was the only time I did job like this.

Re:Where are we going from here? Software engineering needs ... by bhaak on Saturday July 03, 2021 @05:59PM (#27725276)
Does your opinion only apply to unit testing or to automatic testing in general?

I can't imagine the kind of software that wouldn't benefit from automatic testing (unless you would be writing the simplest of CRUD web apps or doing it completely wrong).

From personal experience I see both better code design from being forced to make the code testable and less bugs due to writing tests revealing bugs I wouldn't have found with manual testing before they go into production.

Re:Where are we going from here? Software engineering needs ... by astrange on Saturday July 03, 2021 @07:17PM (#27725811)
> Does your opinion only apply to unit testing or to automatic testing in general?

In my experience once people learn about tests, they want to see 1. tests per commit and 2. high code coverage. This leads to unit tests, which don't really test much of anything, and what they do test (the layers under you like the compiler) is by accident.

The most useful testing would be integration tests on the side, and then regression tests because they're guaranteed to have already found at least one bug.

Re:Where are we going from here? Software engineering needs ... by sidlls on Saturday July 03, 2021 @08:25PM (#27726213)
This, exactly.
Re:Where are we going from here? Software engineering needs ... by spc476 on Saturday July 03, 2021 @08:01PM (#27726066)
I agree, automatic testing would be nice. Unfortunately, I'm the one at work having to do write the said automatic testing of a component that makes parallel DNS requests [1] in an event driven server [2] and need to test that we cover the case where A returns, then B, and B returns, then A, A returns, B returns after our timeout [3], B returns, A returns after our timeout, A returns, B never does, B returns, A never does, while at the same time, making sure the ping tests (the components send a known query to each server to ensure each server is still available [4]) go through because if they don't that particular server will be taken out of rotation. God, I would love to have that automatically tested. What I don't like is having to automate such tests.

[1] To different servers that return different information for a given query. The protocol happens to be DNS.

[2] Based upon poll(), epoll() or kqueue(), depending upon the platform.

[3] We're under some pretty tight time constraints for our product.

[4] DNS, over UDP.

Re:Where are we going from here? Software engineering needs ... by j1elo on Saturday July 03, 2021 @05:57PM (#27725252)
Do you know of any formal study that talks about this?
Re:Where are we going from here? Software engineering needs ... by sidlls on Sunday July 04, 2021 @09:45AM (#27729569)
It's pretty easy to find various papers/studies about TDD, unit testing, and the like by searching online but I would not call any of them scientifically or empirically rigorous. Given the lack of any objective or agreeable standards regarding what "code quality" means, these papers can draw conclusions to support any view.