by YZF · 2y ago · 0 comments
You need to find a balance point.
I think we know that (some) automated tests (unit, integration, end to end) can help build quality software. We also know good tests aren't always easy to write, bad tests make for harder refactoring and flaky tests can suck a lot of time on large projects. At the same time it's always interesting to try different things and find out what works, especially for you if you're a solo developers.
As the author of many of Linux’s x86 tests: many of those tests would fail on old kernels, and a decent number of those failures are related to very severe bugs. Linux has worked well for many years, but working well didn’t mean it wasn’t buggy.
Working is something ;) Lots of software barely does that and there is certainly plenty of software with tests that doesn't meet the no-test Linux quality bar.
That said, tests certainly have their place in the world of software quality, so thanks for your work!
Same thing for the kernel, plus some versions are fully certified for various contexts so you can be sure fully formalised tests suites exists. And that’s on top of all the testing tools which are provided (Kunit, tests from user spaces, an array of dynamic and static testing tools).
But I would like to thank all the people here who think testing is useless for their attitude. You make my job easier while hiring.
That's fine.
I've never written a test in my life. Have my programs ever had bugs? Sure. But I sleep very well at night knowing that I spent all my brain power and time writing actual code that Does Useful Work rather than have wasted significant lengths of my time on this planet on writing test code to test the code that does the Useful Work.
You speak of attitude and smugly "thank" those who don't write tests as that acts as your hire-or-not filter. With an attitude like that, I'd 100% not work for anyone with that attitude anyway.
And that’s why I never want to have to work with you on anything shipping to a user ever.
Don’t get me wrong, the field is riddled with people who think testing is beside them and wash their hand with the quality of what they ship and what they put their users through. That’s an issue to fix not a situation we should tolerate.
See, this is my point. It's not that testing is beside me, it's that my stuff gets tested anyway.
Here's the test: Does it fucking work or not?
You do that by running the thing. If it explodes, find out why and fix it. Job done. No thought or line of code was wasted in writing tests, all brain power was used to initially write a piece of code - which initially had a bug of course - and then said bug was fixed.
My code gets tested. By people using it. Or by me testing it as I write it ("does it fucking work").
There is really only one test.
You can choose to expend your brainpower and time on this planet writing code that will never actually be run by an end-user, or you can just write the fucking code that the end-user will run. That's how I work. Write it and run it. That's the test.
Test code written to test Useful Working Code is time wasted. It's like putting stabiliser wheels on bicycles - you're either gonna be stuck forever riding a bike with stabilisers, or you grow up and rip them off and have a few falls on the bike then become confident and competent enough to ride that bike without them. And have more freedom and time to experiment and go places you couldn't when they were put on.
So yeah. I definitely wouldn't work with people who like wasting my and their time on this Earth.
Write it. Run it. It either does what it's supposed to or not. If it doesn't, find out why and fix it. Or discover that your function/code abstraction/thought was shit in the first place then write it differently - oh and that's the worst part about writing code that tests the Code That Does The Work; say you discover that the function you're writing was a load of bollocks and needs to be highlighted and simply erased - there goes all that test code you spent brainpower and time, with it, too. And now you have to spend even more time writing new test code to test the Code That Actually Does Useful Work.
No thanks. And goodbye.
Let's look at the source code for Doom: https://github.com/id-Software/DOOM
How many _test files do you see? Millions of people played Doom for endless hours and the quality beats a lot of modern software with tests.
Again, tests certainly have their place in modern software development, but the kind of thinking that if you have tests that means your quality is good is wrong and actually leads to worse software quality. Tests are just a part of an overall approach to quality software.
EDIT: Re hiring. I would be looking for people that understand the nuances and the why vs. people that approach things through a religious lens. I.e. they understand the tradeoffs. If you're writing tests then your tests are code. Should you write tests for your tests? If not why not? How do you know that your tests are correct? If your religion says 100% unit test coverage for all code then it's pretty clear this is a religious belief not subject to reason (because otherwise you'd be also asking for 100% coverage for your unit test code by other unit tests).
There are situations where unit tests have a ton of leverage. There are situations where they have less. Testing happens in other disciplines, e.g. mechanical engineering, where certain things get tested (including with automation) and others do not. The decisions depend on the function of the component, the impact of failure, preexisting knowledge about the technologies, etc. software engineering can learn something from some of those other engineering disciplines...
When I asked him about TDD he said they did practically the same thing. Forgot how it was called though.
One recent gem was when he shared a video where they explained the recent crowdstrike debacle: „Look they’re making the same mistakes as 40 years ago. I remember when we dynamically patched a kernel and it exploded haha…“.
In any case, writing tests before writing the implementation was a thing during the 80‘s as well for certain projects.
Tests are there to detect logical correctness of the unit under test, very few type systems can catch errors like using - instead of + in a mathematical formula, for instance. You either need to go into dependently typed languages or languages that otherwise permit embedding proofs (SPARK/Ada).
hnQuestion
| list max |
list := #(1 8 4 5 3).
! Syntax Error: Nothing more expected
1 to: list size do: [:i |
max < (list at: i)
? Uses ifTrue:/ifFalse: instead of min: or max:
ifTrue: [max := (list at: i)].
ifFalse: [max := max].
].
They can also run way more often during development, down to the function/expression level.
In better run organisations they had test protocols, that is, long lists of tests that had to be run by manual testers before any new version could be released. Your manager had to make sure these testers were scheduled well in advance before the bi-annual release date of your latest version of the software.
So that listing old software and claim that they didn't have much tests is misleading, to say the least.
> automated unit/integrations tests
Since that's what the blog is talking about. Formalized manual testing is a different topic, that also didn't universally exist in the 70's and 80's.