News for hackers. Stuff that matters.
Re:You are never taught how to build quality software by KeplerBoy on Friday December 08, 2023 @01:43PM (#38572596)
> It will be necessary to deliver software without bugs in time.

Seems like a pretty bad premise to start an article on quality software. If you believe you can ship bug free code, it's time to switch careers.

Re:You are never taught how to build quality software by codegeek on Friday December 08, 2023 @03:41PM (#38574034)
Yep. If you have written production grade software at real companies, you know that the moment you make that new commit (even if 1 liner change), you are now ready to accept that it could break something. yes you can do your unit tests, integration test, User Acceptance Tests and what not. But every code change = new possible bug that you may not be able to catch until it occurs to a customer.

Whenever I hear a developer say "I never ship buggy code", I am always cautious to dig in more and understand what they mean by that.

Re:You are never taught how to build quality software by Gare on Friday December 08, 2023 @04:06PM (#38574403)
How about a formal proof? :)

I jest, but that should be the gold standard for anything life-critical and good to have for mission-critical software. Alas, we're not there yet.

Re:You are never taught how to build quality software by cochne on Friday December 08, 2023 @04:30PM (#38574728)
I never really got how proofs are supposed to solve this issue. I think that would just move the bugs from the code into the proof definition. Your code may do what the proof says, but how do you know what the proof says is what you actually want to happen?
Re:You are never taught how to build quality software by MaxBarraclough on Friday December 08, 2023 @05:26PM (#38575486)
A formal spec isn't just ordinary source-code by another name, it's at a quite different level of abstraction, and (hopefully) it will be proven that its invariants always hold. (This is a separate step from proving that the model corresponds to the ultimate deliverable of the formal development process, be that source-code or binary.)

Bugs in the formal spec aren't impossible, but use of formal methods doesn't prevent you from doing acceptance testing as well. In practice, there's a whole methodology at work, not just blind trust in the formal spec.

Software developed using formal methods is generally assured to be free of runtime errors at the level of the target language (divide-by-zero, dereferencing NULL, out-of-bounds array access, etc). This is a pretty significant advantage, and applies even if there's a bug in the spec.

Disclaimer: I'm very much not an expert.

Interesting reading:

* An interesting case-study, albeit from a non-impartial source [PDF] https://www.adacore.com/uploads/downloads/Tokeneer_Report.pd...

* An introduction to the Event-B formal modelling method [PDF] https://www.southampton.ac.uk/~tsh2n14/publications/chapters...

Re:You are never taught how to build quality software by xmprt on Friday December 08, 2023 @05:45PM (#38575699)
I think the reason that formal proofs haven't really caught on is because it's just adding more complexity and stuff to maintain. The list of things that need to be maintained just keeps growing: code, tests, deployment tooling, configs, environments, etc. And now add a formal proof onto that. If the user changes their requirements then the proof needs to change. A lot of code changes will probably necessitate a proof change as well. And it doesn't even eliminate bugs because the formal proof could include a bug too. I suppose it could help in trivial cases like sanity checking that a value isn't null or that a lock is only held by a single thread but it seems like a lot of those checks are already integrated in build tooling in one way or another.
Re:You are never taught how to build quality software by MaxBarraclough on Friday December 08, 2023 @06:07PM (#38575979)
> more complexity and stuff to maintain

Yes, with the current state of the art, adopting formal methods means adopting a radically different approach to software development. For 'rapid application development' work, it isn't going to be a good choice. It's only a real consideration if you're serious about developing ultra-low-defect software (to use a term from the AdaCore folks).

> it doesn't even eliminate bugs because the formal proof could include a bug too

This is rather dismissive. Formal methods have been successfully used in various life-critical software systems, such as medical equipment and avionics.

As I said above, formal methods can eliminate all 'runtime errors' (like out-of-bounds array access), and there's a lot of power in formally guaranteeing that the model's invariants are never broken.

> I suppose it could help in trivial cases like sanity checking that a value isn't null or that a lock is only held by a single thread

No, this doesn't accurately reflect how formal methods work. I suggest taking a look at the PDFs I linked above. For one thing, formal modelling is not done using a programming language.

Re:You are never taught how to build quality software by valand on Saturday December 09, 2023 @09:55AM (#38582381)
You mix up development problem with computational problem.

If you can't use formal proof just because the user can't be arsed to wait where it is supposed to be necessary, then the software project conception is simply not well designed.

Re:You are never taught how to build quality software by hnfong on Sunday December 10, 2023 @11:25AM (#38592631)
> A formal spec isn't just ordinary source-code by another name, it's at a quite different level of abstraction

This is the fallacy people have when thinking they can "prove" anything useful with formal systems. Code is _already_ a kind formal specification of program behavior. For example `printf("Hello world");` is a specification of a program that prints hello world. And we already have an abundance of tooling for applying all kind of abstractions imaginable to code. Any success at "proving" correctness using formal methods can probably be transformed into a way to write programs that ensure correctness. For example, Rust has pretty much done so for a large class of bugs prevalent in C/C++.

The mathematician's wet dream of applying "mathematical proof" on computer code will not work. That said, the approach of inventing better abstractions and making it hard if not impossible for the programmer to write the wrong thing (as in Rust) is likely the way forward. I'd argue the Rust approach is in a very real way equivalent to a formal specification of program behavior that ensures the program does not have the various bugs that plagues C/C++.

Of course, as long as the programming language is Turing Complete you can't make it impossible for the programmer to mistakenly write something they didn't intend. No amount of formalism can prevent a programmer from writing `printf("hello word")` when they intended "hello world". Computers _already_ "do what I say", and "do what I mean" is impossible unless people invent a way for minds to telepathically transmit their intentions (by this point you'd have to wonder whether the intention is the conscious one or the subconscious ones).

Re:You are never taught how to build quality software by MaxBarraclough on Monday December 11, 2023 @05:03PM (#38606126)
> thinking they can "prove" anything useful with formal systems

As I already said in my reply to xmprt, formal methods have been used successfully in developing life-critical code, although it remains a tiny niche. (It's a lot of work, so it's only worth it for that kind of code.) Google should turn up some examples.

> Code is _already_ a kind formal specification of program behavior.

Not really. Few languages even have an unambiguous language-definition spec. The behaviour of C code may vary between different standards-compliant compilers/platforms, for example.

It's possible to reason formally about C, but it's not an ideal match. https://www.eschertech.com/products/ecv.php

The SPARK Ada language, on the other hand, is unambiguous and is amenable to formal reasoning. That's by careful design, and it's pretty unique. It's also an extremely minimal language.

> `printf("Hello world");` is a specification of a program that prints hello world

There's more to the story even here. Reasoning precisely about printf isn't as trivial as it appears. It will attempt to print Hello world in a character-encoding determined by the compiler/platform, not by the C standard. It will fail if the stdout pipe is closed or if it runs into other trouble. Even a printf call has plenty of complexity we tend to just ignore in day to day programming, see https://www.gnu.org/ghm/2011/paris/slides/jim-meyering-goodb...

> Any success at "proving" correctness using formal methods can probably be transformed into a way to write programs that ensure correctness

You've roughly described SPARK Ada's higher 'assurance levels', where each function and procedure has not only an ordinary body, written in SPARK Ada, but also a formal specification.

SPARK is pretty challenging to use, and there can be practical limitations on what properties can be proved with today's provers, but still, it is already a reality.

> Rust has pretty much done so for a large class of bugs prevalent in C/C++

Most modern languages improve upon the appalling lack of safety in C and C++. You're right that Rust (in particular the Safe Rust subset) does a much better job than most, and is showing a lot of success in its safety features. Programs written in Safe Rust don't have memory safety bugs, which is a tremendous improvement on C and C++, and it manages this without a garbage collector. Rust doesn't really lend itself to formal reasoning though, it doesn't even have a proper language spec.

> The mathematician's wet dream of applying "mathematical proof" on computer code will not work

Again, formal methods aren't hypothetical.

> I'd argue the Rust approach is in a very real way equivalent to a formal specification of program behavior that ensures the program does not have the various bugs that plagues C/C++.

It is not. Safe languages offer rock-solid guarantees that certain kinds of bugs can't occur, yes, and that's very powerful, but is not equivalent to full formal verification.

It's great to eliminate whole classes of bugs relating to initialization, concurrency, types, and object lifetime. That doesn't verify the specific behaviour of the program, though.

> No amount of formalism can prevent a programmer from writing `printf("hello word")` when they intended "hello world"

That comes down to the question of how do you get the model right? See the first PDF I linked above. The software development process won't blindly trust the model. Bugs in the model are possible but it seems like in practice it's uncommon for them to go unnoticed for long, and they are not a showstopper for using formal methods to develop ultra-low-defect software in practice.

> "do what I mean" is impossible unless people invent a way for minds to telepathically transmit their intention

It's not clear what your point is here. No software development methodology can operate without a team that understands the requirements, and has the necessary contact with the requirements-setting customer, and domain experts, etc.

I suggest taking a look at both the PDFs I linked above, by way of an introduction to what formal methods are and how they can be used. (The Formal methods article on Wikipedia is regrettably rather dry.)

Re:You are never taught how to build quality software by dgacmu on Friday December 08, 2023 @05:01PM (#38575163)
Not really. Imagine the proof says: "in this protocol, when there are more than 0 participants, exactly one participant holds the lock at any time"

It might be wrong, but it's pretty easy to inspect and has a much higher chance of being right than your code does.

You then use proof refinement to eventually link this very high level statement down to the code implementing it.

That's the vision, at least, and it's sometimes possible to achieve it. See, for example, Ironfleet: https://www.microsoft.com/en-us/research/publication/ironfle...

Re:You are never taught how to build quality software by roenxi on Friday December 08, 2023 @04:42PM (#38574898)
As always, the branding of formal methods sucks. As other commentators point out, it isn't technically possible to provide a formal proof that software is correct. And that is fine, because formal software methods don't do that.

But right from the outset the approach is doomed to fail because its proponents write like they don't know what they are talking about and think they can write bug-free software.

It really should be "write software with a formal spec". Once people start talking about "proof" in practice it sounds dishonest. It isn't possible to prove software and the focus really needs to be on the spec.

Re:You are never taught how to build quality software by hnfong on Sunday December 10, 2023 @11:38AM (#38592744)
> It really should be "write software with a formal spec".

The code is already a formal spec.

Unless there are bugs in the language/compiler/interpreter, what the code is essentially formally well defined.

As programming languages get better at enabling programmers to communicate intention as opposed to being a way to generate computer instructions, there's really no need for a separate "spec". Any so called "spec" that is not a programming language is likely not "formal" in the sense that the behavior is unambiguously well defined.

Of course, you might be able to write the "spec" using a formal language that cannot be transformed into machine code, but assuming that the "spec" is actually well defined, then it's just that "compiling" the spec into machine code is too expensive in some way (eg. nobody has written a compiler, it's too computationally hard to deduce the actual intention even though it's well defined, etc.). But in essence it is still a "programming language", just one without a compiler/interpreter.

Re:You are never taught how to build quality software by akhosravian on Friday December 08, 2023 @04:30PM (#38574727)
I’m not a CS academic or a mathematician, but don’t Godel’s incompleteness theorems preclude a formal proof of correctness?
Re:You are never taught how to build quality software by Verdex on Friday December 08, 2023 @04:53PM (#38575055)
No.

Godel means that we can't have an algorithmic box that we put a program into and out comes a true/false statement of halting.

Nothing is stopping you from writing the proof manually for each program that you want to prove properties for.

ALSO, you can write sub-turing complete programs. Those are allowed to have automated halting proofs (see idris et al).

Re:You are never taught how to build quality software by kevindamm on Friday December 08, 2023 @05:21PM (#38575425)
What you're talking about is actually the Church-Turing thesis and the halting problem.

While, yes, computability and provability are very closely related, it's important to get attribution correct.

More details on what Gödel's Incompleteness Theorem really said are in a sibling comment so I won't repeat them here.

Re:You are never taught how to build quality software by Verdex on Friday December 08, 2023 @06:07PM (#38575973)
> it's important to get attribution correct.

Really? Says who?

Or perhaps you'll prove it from first principles. Although if turns out to be difficult, that's okay. Somebody mentioned something about systems being either complete or consistent but never both. Some things can be true but not proveably so. Can't quite remember who it was though.

Re:You are never taught how to build quality software by kevindamm on Friday December 08, 2023 @06:24PM (#38576187)
Fair enough, I was being annoyingly pedantic.

[I believe that] it's important to get attribution correct.

Re:You are never taught how to build quality software by Verdex on Friday December 08, 2023 @06:44PM (#38576451)
To be fair, annoyingly pedantic is the best kind of pedantic.

- Futurama (kind of)

Re:You are never taught how to build quality software by kevindamm on Saturday December 09, 2023 @07:30AM (#38581421)
sounds technically correct

Gödel really was a rather unique mind, and the story of his death is kind of sad.. but I wonder if it takes such a severe kind of paranoia to look for how math can break itself, especially during that time when all the greatest mathematicians were in pursuit of formalizing a complete and consistent mathematics.

Re:You are never taught how to build quality software by Veserv on Friday December 08, 2023 @04:46PM (#38574941)
No. It merely prevents you from confirming every arbitrarily complex proof. Incompleteness is more like: I give you a convoluted mess of spaghetti code and claim it computes prime numbers and I demand you try to prove me wrong.
Re:You are never taught how to build quality software by topaz0 on Friday December 08, 2023 @04:45PM (#38574937)
No. There are plenty of things that can be proved, it's just that there exist true statements that cannot be proved.
Re:You are never taught how to build quality software by kevindamm on Friday December 08, 2023 @05:01PM (#38575166)
That's closer, but still not quite right.

There are well-formed statements that can be proved but which assert that its godelized value represents a non-provable theorem.

Therefore, you must accept that it and its contradiction are both provable (leading to an inconsistent system), or not accept it and now there are provable theorems that cannot be expressed in the system.

Furthermore, that this can be constructed from anything with base arithmetic and induction over first-order logic (Gödel's original paper included how broadly it could be applied to basically every logical system).

Re:You are never taught how to build quality software by kevindamm on Friday December 08, 2023 @05:16PM (#38575364)
The important thing to note is that it doesn't have anything to do with truth or truth-values of propositions. It breaks the fundamental operation of the provability of a statement.

And, since many proofs are done by assuming a statement's inverse and trying to prove a contradiction, having a known contradiction in the set of provable statements can effectively allow any statement to be proven. Keeping the contradiction is not actually an option.

Re:You are never taught how to build quality software by AnimalMuppet on Friday December 08, 2023 @04:50PM (#38575014)
Formal proof of what? That it has no bugs? Ha!

You can formally prove that it doesn't have certain kinds of bugs. And that's good! But it also is an enormous amount of work. And so, even for life-critical software, the vast majority is not formally proven, because we want more software than we can afford to formally prove.

Re:You are never taught how to build quality software by Verdex on Friday December 08, 2023 @04:56PM (#38575107)
This is an interesting point that I think a lot of programming can miss.

Proving that the program has no bugs is akin to proving that the program won't make you feel sad. Like ... I'm not sure we have the math.

One of the more important jobs of the software engineer is to look deep into your customer's dreams and determine how those dreams will ultimately make your customer sad unless there's some sort of intervention before you finish the implementation.

Re:You are never taught how to build quality software by BoiledCabbage on Friday December 08, 2023 @06:37PM (#38576363)
Exactly, it's fundamentally impossible. Formal proofs can help with parts of the process, but it can guarantee no bugs in the product. These are the steps of software, and their transitions. It's fundamentally a game of telephone with errors at each step along the way.

What actually would solve the customer's problem -> What the customer thinks they want -> What they communicate that they want -> What the requirements collector hears -> What the requirements collector documents -> How the implementor interprets the requirements -> What the implementor designs/plans -> What the implementor implements.

Formal proofs can help with the last 3 steps. But again that's assuming the implementor can formalize every requirement they interpreted. And that's impossible as well, there will always be implicit assumptions about the running environment, performance, scale, the behavior of dependent processes/APIs.

It helps with a small set of possible problems. If those problems are mission-critical then absolutely tackle them, but there will never be a situation where it can help with the first 5 steps of the problem, or with the implicit items in the 6th step above.

Re:You are never taught how to build quality software by makapuf on Friday December 08, 2023 @05:00PM (#38575159)
Yeah, if you can have a formally proven compiler from slides, poorly written user stories and clarification phone calls to x86_64 binary then alright.
Re:You are never taught how to build quality software by underlipton on Friday December 08, 2023 @04:29PM (#38574720)
Re:You are never taught how to build quality software by bluGill on Friday December 08, 2023 @04:58PM (#38575126)
Even formally proved code can have bugs. If your requirement is wrong is the obvious thing. I don't work with formal proofs (I want to, I just don't know how), but I'm given to understand they have other real world limits that make them sometimes have other bugs.
Re:You are never taught how to build quality software by radicalcentrist on Friday December 08, 2023 @06:20PM (#38576130)
To quote Donald Knuth, "Beware of bugs in the above code; I have only proved it correct, not tried it."
Re:You are never taught how to build quality software by kaba0 on Saturday December 09, 2023 @03:29AM (#38579887)
Well, if your product is on the hello world complexity, you might make it bug-free by just yourself simply through chance.

Formal proving doesn’t really scale much further, definitely not to “enterprise” product scale.

Re:You are never taught how to build quality software by wvenable on Friday December 08, 2023 @05:20PM (#38575415)
It's always amazing when I get a bug report from a product that's been running bug free in production for years with minimal changes but some user did some combination of things that had never been done and it blows up.

Usually it's something extremely simple to fix too.

Re:You are never taught how to build quality software by codegeek on Friday December 08, 2023 @06:25PM (#38576201)
This happens a lot more than one may think especially with products that have lot of features. Some features are used sparingly and the moment a customer uses that feature a bit more in depth, boom. Something is broken.
Re:You are never taught how to build quality software by tylerchurch on Saturday December 09, 2023 @03:06PM (#38585437)
> especially with products that have lot of features

No kidding. I'm 2 or 3 years into working on a SaaS app started in ~2013 and I still get bug reports from users that make me say "what!? we have that feature!?"

Re:You are never taught how to build quality software by reactordev on Friday December 08, 2023 @01:59PM (#38572778)
This kind of wisdom only comes from experience I think. Either that or higher order think. Like the article says, most of the time testing/tdd/qa is bolt on after-the-fact. Or a big push at the end with "QA Sprints" (are you sprinting or are you examining? what exactly is a QA sprint? I know what it is).

Once you get beyond "I wrote a function" and "I tested a function" and even still "I tested a function that was called by a function over the wire", you will come to a realization that no matter how edgy your edge cases, no matter how thorough your QA, there will always - ALWAYS be 0-day "undefined behavior" in certain configurations. On certain hardware. On certain kernels. It's an assurance that I guarantee that I'm almost positive it's bug free, since it passed tests, it passed human eyes, and it passed review - fingers crossed.

Re:You are never taught how to build quality software by FalconSensei on Friday December 08, 2023 @01:49PM (#38572681)
> If you believe you can ship bug free code, it's time to switch careers.

Unfortunately, you are correct. Shipping in time and bug free are inversely proportional, and in a world were usually it's hard to argue with PMs for more time to have better testing, or paying tech debt... it's just a reality

Re:You are never taught how to build quality software by colinmorelli on Friday December 08, 2023 @01:58PM (#38572765)
An infinite amount of time would not necessarily yield zero bugs.

But more importantly, once you've fixed the "show-stopping bugs," putting the software in front of customers is probably the best next step, as even if it's bug-free, that doesn't mean it solves the problem well.

Re:You are never taught how to build quality software by reactordev on Friday December 08, 2023 @02:01PM (#38572795)
there is no such thing as zero bugs. There is only a marker in time for a suite of tests that show no bugs. Doesn't mean larva aren't living under the wood. You can't control all the bits (unless you built your own hardware/software stack).
Re:You are never taught how to build quality software by colinmorelli on Friday December 08, 2023 @02:04PM (#38572820)
I think we're saying the same thing? That was my point. You're never going to achieve zero bugs no matter how much time you give yourself. Focus on getting the critical path right and creating a good experience, and then get it to customers for feedback on where to go next.

[The above does not necessarily apply in highly regulated industries or where lives are on the line]

Re:You are never taught how to build quality software by BobaFloutist on Friday December 08, 2023 @02:40PM (#38573216)
I like to think of "zero bugs" as the asymptote. As you spend more time, you discover increasingly fewer (and less significant) bugs per unit of time. POSSIBLY at the limit of infinite time you hit 0 bugs, but even if you could, would it be worth it? Doubtful.

I can think of far better ways to spend infinite time.

Re:You are never taught how to build quality software by zamalek on Saturday December 09, 2023 @03:43PM (#38585866)
0 bugs is actually impossible. A cosmic ray can flip a bit and change the behavior of your software. We live in a fundamentally unreliable universe.

We aren't taught how to write reliable software because very few people know how to write reliable software. It doesn't help that academia has a hard crush on OOP, which is a bag of accidental complexity - and complexity is a breeding ground for unreliability.

Re:You are never taught how to build quality software by BobaFloutist on Sunday December 10, 2023 @04:11PM (#38595095)
I think if a cosmic ray flips the bit and changes the behavior of your software, you can still reasonably brag that you wrote 0-bug code. It's not your fault that happened, you didn't do that. The code you wrote had 0 bugs.
Re:You are never taught how to build quality software by ElectricalUnion on Friday December 08, 2023 @02:35PM (#38573163)
I would say that also applies on highly regulated industries or where lives are on the line.

On those you're of course expected to do safety and testing up to the limit of the "value of a statistical life"s within the expected project impacts, but it still has time and budget limits.

Re:You are never taught how to build quality software by colinmorelli on Sunday December 10, 2023 @05:00PM (#38595519)
The part I was suggesting does not apply is the statement "Focus on getting the critical path right and creating a good experience, and then get it to customers for feedback on where to go next."

Most software engineering is about making sure the happy path works well. When lives are on the line, you need to also plan to minimize the possible damage that can happen when things go wrong.

Re:You are never taught how to build quality software by reactordev on Friday December 08, 2023 @03:01PM (#38573465)
Yup, I also like how you call out "get it in-front of customers" as a step in the whole chain. Often sorely missed. Sometimes a bug to you, is a feature to them (gasp!)... so either make it a first class thing or train them on the correct path (while you fix the "bug").
Re:You are never taught how to build quality software by nonethewiser on Friday December 08, 2023 @04:13PM (#38574493)
> there is no such thing as zero bugs.

Ok, I think we’ve gone too far. There absolutely is such thing as 0 bugs and sometimes code changes don’t have bugs. That is not to say it can be garunteed.

Re:You are never taught how to build quality software by FalconSensei on Friday December 08, 2023 @07:08PM (#38576699)
> An infinite amount of time would not necessarily yield zero bugs.

Never said that, just that quick turnaround for deliveries will usually mean more bugs, and having some extra time usually means less bugs

Re:You are never taught how to build quality software by quickthrower2 on Friday December 08, 2023 @08:03PM (#38577139)
We need to define bug but if bug is anything a customer (internal or external) is not happy with that passes triage and you can’t throw it back in their face. Then zero bugs would be impossible with even infinite time.
Re:You are never taught how to build quality software by nradov on Friday December 08, 2023 @02:04PM (#38572819)
That's only true up to a point. There are some quality assurance and control activities that are essentially "free" in that they actually allow for shipping faster by preventing rework. But that requires a high level of team maturity and process discipline, so some teams are simply incapable of doing it. And even in ideal circumstances it's impossible to ship defect free software (plus the endless discussions over whether particular issues are bugs or enhancement requests).
Re:You are never taught how to build quality software by johnnyanmac on Friday December 08, 2023 @04:38PM (#38574845)
yeah, it's a spectrum. Clearly no one is expecting an app to be truly bug free if the underlying compiler itself has bugs. But how often do users truly run into compiler level bugs?

I think when the author says "bug free", it's from the user perspective. where bugs either need to go out of your way to trigger or are so esoteric it's impossible to think about hitting without that user themself knowing the code inside out. Games is definitely an industry where the quality of code has always dipped to a point where users can easily hit issues in normal use, and only gets worse as games get more complex. That's where it gets truly intolerable

Re:You are never taught how to build quality software by FalconSensei on Friday December 08, 2023 @07:10PM (#38576718)
There are tools that help, but you still need time to integrate those tools, learn how to use them, etc. If you are doing unit and integration tests, you need time to not only write those, but also actually plan your tests, and learn how to write tests. Which... needs time
Re:You are never taught how to build quality software by d0gsg0w00f on Friday December 08, 2023 @06:41PM (#38576409)
Like the age old builder trope.

"Cheap. Fast. Good. Pick two."

Re:You are never taught how to build quality software by NegativeK on Friday December 08, 2023 @07:21PM (#38576795)
That's the optimistic viewpoint.

The pessimistic viewpoint is that you get to pick up to one.

Re:You are never taught how to build quality software by datadeft on Friday December 08, 2023 @03:42PM (#38574042)
Spicy take on engineering. Why do we accept this for software when do not accept the same in other engineering domains?
Re:You are never taught how to build quality software by benwilson-512 on Friday December 08, 2023 @03:52PM (#38574194)
My wife works as an acoustical consultant at a global construction firm. The things you hear about factories, offices, and even hospitals is wild. Don’t get me wrong the construction world works very hard to avoid issues but I think we in software tend to hold other engineering disciplines up on a pedestal that doesn’t quite match the messiness of reality.
Re:You are never taught how to build quality software by jimt1234 on Friday December 08, 2023 @04:24PM (#38574646)
Thanks for saying this. I think we in software engineering tend to think too binary: either the product is perfect (100% bug-free) or it's shit. There's always room for improvement, but compared to other engineering, overall, I think we're doing pretty good. As an example similar to your wife's, my friend used to work for one of the major car manufacturers doing almost the exact same job as Edward Norton's character in Fight Club. The cars had "bugs", they knew about it, but they didn't publicly acknowledge it until they were forced to.
Re:You are never taught how to build quality software by Gud on Friday December 08, 2023 @03:49PM (#38574152)
Trust me when I say this: even "other" engineering domains have to do patches.

The difference is that software can be used before it is fully ready, and it makes sense to do so. No one can really use a 90% finished power plant, but software at 95% capacity is still usually "good enough"

Re:You are never taught how to build quality software by daotoad on Friday December 08, 2023 @04:13PM (#38574496)
I think you're 90% there. There is also the cost to apply a patch.

If you want to patch a bridge, it's gonna cost you. Even if you only need to close down a single lane of traffic for a few hours you are looking at massive expenses for traffic control, coordination with transportation agencies, etc.

For most software it's pretty inexpensive to ship updates. If you're a SaaS company regular updates are just part of your business model. So the software is never actually done. We just keep patching and patching.

In some contexts, it is much more expensive to push out updates. For example, in the 00s, I worked on a project that had weather sensors installed in remote locations in various countries and the only way to get new software to them was via dial-up. And we were luck that that was even an option. Making international long distance calls to upload software patches over a 9600 baud connection is expensive. So we tested our code religiously before even considering an update, and we only pushed out the most direly needed patches.

Working on SaaS these days and the approach is "roll forward through bugs". It just makes more economic sense with the cost structures in this business.

Re:You are never taught how to build quality software by Gud on Friday December 08, 2023 @04:24PM (#38574635)
Indeed. We calculate a $1 dollar fix in the factory costs $100 to fix on site.
Re:You are never taught how to build quality software by omginternets on Friday December 08, 2023 @04:12PM (#38574464)
e.g. product recalls?
Re:You are never taught how to build quality software by Gud on Friday December 08, 2023 @04:19PM (#38574578)
I install high voltage switchgear on site. A common problem is all the changes that has been added during the design stage, circuits that have been removed or altered, work that has kind of mostly been done to the schemes by the overworked secondary engineer. Sometimes, the schemes have been changed after all the wiring is completed and shipped to site, making it my pain in the ass when it's time to do the commissioning.

The end result is never 100% perfect, but somewhere in between "not too bad" and "good enough".

Re:You are never taught how to build quality software by rocqua on Saturday December 09, 2023 @01:00AM (#38579071)
Thanks for this insight! It has pretty strong explanatory power. It also explains why rushed development can stall. It explains 'move fast and break things'.

There's even an added factor of learning more about what is really needed by putting a 95% done product into use.

Heck, it explains (stretching it here) space-x's success with an iterative approach to rocket design.

Re:You are never taught how to build quality software by ska on Friday December 08, 2023 @04:01PM (#38574328)
There are a few aspects. One is that we don't understand the fundamentals of software as well as the underpinnings of other engineering disciplines.

More importantly though, for the most part we choose not to do engineering. By which I mean this - we know how to do this better, and we apply those techniques in areas where the consequences of failure are high. Aerospace, medical devices, etc.

It differs a bit industry to industry, but overall the lessons are the same. On the whole it a) looks a lot more like "typical" engineering than most software development and b) it is more expensive and slower.

Overall, we seem to have collectively decided we are fine with flakier software that delivers new and more complex things faster, except where errors tend to kill people or expensive machines without intending to.

The other contributing thing is it's typically vastly cheaper to fix software errors after the fact than, say, bridges.

Re:You are never taught how to build quality software by omginternets on Friday December 08, 2023 @04:11PM (#38574459)
The modern car contains within it a perfect example the dichotomy:

1. The ECU ("hard" engineering)

2. The infotainment system ("soft" engineering)

Now, an interesting thing I have noticed is that "soft" software engineering pays more. Often substantially more.

Re:You are never taught how to build quality software by ska on Friday December 08, 2023 @04:13PM (#38574504)
I think your salary observation is more of a firmware vs. hardware, rather then "soft" vs "hard" engineering.

Further to that, it's often informative to figure out what makes a company money. The highest paid software development roles tend to be doing things that are closer to revenue, on average. If you are a software developer at a hardware company (or an insurance company, or whatever), you aren't that close. Even worse if you are viewed as a cost center.

Re:You are never taught how to build quality software by johnnyanmac on Friday December 08, 2023 @04:52PM (#38575037)
>Further to that, it's often informative to figure out what makes a company money. The highest paid software development roles tend to be doing things that are closer to revenue, on average.

yeah. Who are those trillion dollar businesses and what do they rely on?

- Apple: Probably the better example here since they focus a lot on user-facing value. But I'm sure they have their own deals, B2B market in certain industries, R&D, and ads to take into account

- Microsoft: a dominant software house in nearly every aspect of the industry. But I wager most of their money comes not from users but other businesses. Virtually every other companies uses Windows, Word, and those that don't may still use Azure for servers.

- Alphabet: ads. Need I say more? Users aren't the audience, they are the selling point to other companies.

- Amazon: a big user facing market, but again similar to Microsoft. The real money is b2b servers.

- Nvidia: Again, user facing products but the real selling point is to companies that need their hardware. In this case, a good 80% of general computing manufacturers.

- Meta: Ads ans selling user data once again

- Tesla: CEO politics aside, it's probably the 2nd best example. Split bewteen a user facing product that disrupted an industry and becoming a standard for fuel in the industry they disrupted. There's also some tangential products that shouldn't be underestimated, but overall a lot of value seems to come from serving the user.

General lesson here is that b2b and ads are the real money makers. if you're one level removed that financial value drops immensely (but not necessarily to infeasible levels, far from it).

Re:You are never taught how to build quality software by KeplerBoy on Friday December 08, 2023 @05:40PM (#38575645)
> One is that we don't understand the fundamentals of software as well as the underpinnings of other engineering disciplines.

That sounds like an awfully bold claim. I have the feeling we understand software a lot better than we understand mechanical engineering (and by extension material sciences) or fluid dynamics. By a big margin.

I worked with finite element software and with CFD solvers, you wouldn't believe how hard it is to simulate a proper airflow over a simple airfoil and get the same results as in the wind tunnel.

Re:You are never taught how to build quality software by ska on Friday December 08, 2023 @06:00PM (#38575888)
> That sounds like an awfully bold claim.

To the contrary, it's nearly canonical. Most of the problems pointed out in the 70s (mythical man month) have still not been resolved, 50 years later.

>you wouldn't believe how hard it

Oh, I'd believe it (I've designed and built similar things, and had colleagues in CFD).

But you are definitely cherry picking here. The problem with CFD is we don't understand the fluid dynamics part very well; turbulence is a big unsolved problem still, though we have been generating better techniques. This is so true that in an undergraduate physics degree, there is usually a point where they say something like: "now that you think you know how lots of things work, let's introduce turbulence"

But a lot of mechanical engineering and the underlying physics and materials science is actually pretty well understood, to the degree that we can be much more predictive about the trade offs than typically is possible in software. Same goes for electrical, civil, and chem. Each of them have areas of fuzziness, but also a pretty solid core.

Re:You are never taught how to build quality software by imetatroll on Friday December 08, 2023 @07:05PM (#38576672)
The article is about delivering a complete, working project "on time". I have a neighbor whose home is being renovated and it is already 2x the time the contractor originally quoted.

Of course it is easier for a developer to walk away from something incomplete than an architect and the contractors involved in a physical project, but still, I hardly think that there is really much difference in terms of timelines.

Re:You are never taught how to build quality software by ska on Friday December 08, 2023 @07:21PM (#38576794)
FWIW in my experience delays in e.g. home renos (or for that matter larger scale projects) are mostly for reasons unrelated to the engineering. In software projects, it's probably the #1 reason (i.e. we didn't know how to do it when we started).

Software is still absolutely king for number of large scale projects that just never ship, or ship but never work.

Re:You are never taught how to build quality software by kaba0 on Saturday December 09, 2023 @03:48AM (#38579989)
> To the contrary, it's nearly canonical. Most of the problems pointed out in the 70s (mythical man month) have still not been resolved, 50 years later.

Even with all of those applied, we wouldn’t be magically better. Complexity is simply unbounded. It’s almost impossible to reason about parallel code with shared mutable state.

Re:You are never taught how to build quality software by alexchamberlain on Friday December 08, 2023 @03:48PM (#38574137)
Most engineering domains expect failure; the fail safes, checklists etc prevent it causing real damage.
Re:You are never taught how to build quality software by BeefyMcGhee on Friday December 08, 2023 @04:19PM (#38574576)
Because other engineering domains are "actual" engineering domains. They didn't just co-opt the word to have fancier sounding job titles.
Re:You are never taught how to build quality software by pixl97 on Friday December 08, 2023 @03:59PM (#38574310)
>when do not accept the same in other engineering domains?

No, you just complain that your taxes are being used to build expensive roads and bridges. Or you think airplanes are far too expensive. Or that new cars are insanely expensive.

There are cost trade offs. In general, better quality more expense.

Also in software there is not an excessive amount of software engineers in relation to demand for software. So SWEs can get paid a lot to go build crappy software.

Re:You are never taught how to build quality software by rockemsockem on Friday December 08, 2023 @04:46PM (#38574951)
We accept this in all fields of engineering. Everything is "good enough" and the seems to work reasonably well. You should remember this next time you hear about car recalls, maintenance work on bridges, or when some component in your laptop flakes out.
Re:You are never taught how to build quality software by digging on Friday December 08, 2023 @04:53PM (#38575048)
In addition to the other answers, there is the perennial and depressing one: Software bugs haven't killed enough people in a suitably visible/dramatic way to be regulated that heavily.
Re:You are never taught how to build quality software by ponector on Friday December 08, 2023 @05:20PM (#38575412)
Imagine same approache in other domains:

Team are flying the airplane, the se time rebuild it to the zeppelin, testing new engines inflight.

Or construction. Let's build apartment block, but for few apartments we will test new materials, new layout, etc. Once there are walls of the first apartments we will let people live there. We will build how we can, according to the napkin plan. In the end we will put all tenants in and stress test strength of the structures. Or one day people return home and their apartments have totally different design and layout because someone from the HOA decided so to get a promotion.

Re:You are never taught how to build quality software by rocqua on Saturday December 09, 2023 @12:52AM (#38579035)
I mean, bridges collapse. That hasn't meant we gave up on engineering bridges. Point being, we have some risk tolerance, even for civil engineering.

Now we don't accept an engineer saying, "this bridge will probably collapse without warning", which we do accept with software. So there is a difference.

Re:You are never taught how to build quality software by kaba0 on Saturday December 09, 2023 @03:41AM (#38579958)
Because complexity is boundless and in software it has no cost.

Building a house will have a restrictive initial budget for complexity, you don’t have enough in that budget for rotating floors, or an elevator that is catapulted to the correct floor, etc. These would cost both at engineering time and implementation time a huge amount. Less complexity is easier to analyze.

In case of software, complexity has negligible cost, relative to physical systems. You can increase it ad infinity — but proving it (the whole stack - from the hardware-OS-userspace software) correct is likely impossible with even the whole of mathematics, in certain cases.

Re:You are never taught how to build quality software by jasondigitized on Friday December 08, 2023 @02:17PM (#38572950)
It's perfectly acceptable to let bugs escape into production if those "cost" of fixing that bug higher than the "cost" to the user experience / job to be done. A bug that takes a week to fix that will only be encountered by a small amount of users in a small number of obscure scenarios may not need to be fixed.
Re:You are never taught how to build quality software by billti on Friday December 08, 2023 @03:59PM (#38574300)
I think a common error is taking this view in isolation on each bug.

Fact is, if you ship enough 'low probability' bugs in your product, your probabilities still add up to a point where many customers are going to hit several of them.

I've used plenty of products that suffer from 'death by a thousands cuts'. Are the bugs I hit "ship blockers"? No. Do I hit enough of them that the product sucks and I don't want to use it? Absolutely.

Re:You are never taught how to build quality software by pixl97 on Friday December 08, 2023 @04:01PM (#38574336)
Software is commonly built on non-fungible components and monopolies.

Right, you don't want to use Microsoft Word, or SalesForce, or Apple vs Android, or X Whatever. It's highly unlikely you'll have a choice if you use it though.

Re:You are never taught how to build quality software by owlbite on Friday December 08, 2023 @08:37PM (#38577431)
Very much this, and low risk bugs compound at scale.

If you're in a very large FANNG type company, and say you have 1000 components that each ship 1 bug each day that has a 0.1% chance of breaking something critical, that translates to a less than 50% chance you ship a working OS on any given day. And that may mean the entire company's productivity is impacted for the day depending on how broken it is.

Re:You are never taught how to build quality software by AlotOfReading on Friday December 08, 2023 @02:28PM (#38573091)
This presupposes that you know what/where bugs will be found and how they'll impact future users. In my experience knowing either of these is very rare at the point where you're "building quality".
Re:You are never taught how to build quality software by xkekjrktllss on Friday December 08, 2023 @03:11PM (#38573620)
>how they'll impact future users

Most people in this thread understand that users' interests only matter insofar as they impact business profit.

I just think you're having a different conversation.

Re:You are never taught how to build quality software by fivre on Friday December 08, 2023 @04:16PM (#38574530)
it will be necessary to deliver software without bugs that could have reasonably been avoided in time

ive had this sentiment thrown at me too often by peak move fast and break things types. it's too often a cudgel to dispense with all QA in favor of more new feature development. shipping shit that has the same pattern of flaws youve encountered in the past when youve been shown ways to catch them early but couldnt be bothered isnt accepting that you cant catch everything, it's creating a negative externality.

you usually can make it someone else's problem and abscond with the profits despite, but that doesn't mean you should

Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @02:16PM (#38572939)
It is sad that people on here would believe this and that for whole platforms it is actually true, however, it absolutely is not universally true and the proof is all around us.
Re:You are never taught how to build quality software by sanderjd on Friday December 08, 2023 @03:43PM (#38574062)
What proof is all around us?
Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @04:13PM (#38574489)
The amount of software in everyday objects which runs without exhibiting bugs to such a degree we do not notice most of it even exists.
Re:You are never taught how to build quality software by sanderjd on Friday December 08, 2023 @04:18PM (#38574549)
Yes, but that software is not bug-free. The claim was not "it's impossible to make software that does not exhibit bugs too a casually noticeable degree".

People who know how the sausage is made will always know of a bunch of bugs that haven't been fixed exactly because they aren't impactful enough to be worth the effort required to fix them.

Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @04:34PM (#38574778)
If it works within specs it is bug free. It doesn’t matter how it is made if it works within specs, which is one of the real unfortunate truths of software.

The other is working out the correct specification is far harder than coding is.

For example it is trivial to write a bug free program that multiplies an integer between 3 and 45 by two.

Re:You are never taught how to build quality software by bluGill on Friday December 08, 2023 @05:06PM (#38575231)
Most devices work within the spec 99.9% of the time, but that last .1% it is outside the spec. The exact % is different for different projects of course, but the idea is still there: no software operates according to spec 100% of the time.
Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @05:31PM (#38575548)
It does though. My example of adding two ints within a known finite range would operate to spec 100% of the time.

You would have to introduce things like tolerance to hardware failure, but that is outside the spec of the software as stated.

Re:You are never taught how to build quality software by sanderjd on Saturday December 09, 2023 @01:11PM (#38584163)
Yes, but that's not real software.
Re:You are never taught how to build quality software by fidotron on Saturday December 09, 2023 @01:45PM (#38584488)
Re:You are never taught how to build quality software by sanderjd on Sunday December 10, 2023 @12:33AM (#38589390)
Some people obviously aren't true Scotsman... I'm from the US and have no attachment to Scotland; if I claimed to be a Scotsman and you pointed out that I'm not, and I said "well that's just the no true Scotsman fallacy!", then I would be totally full of it.

In the same way I am not a real Scotsman, your toy example of an easily specified snippet of a function that doesn't do anything useful is not real software.

Re:You are never taught how to build quality software by bluGill on Saturday December 09, 2023 @08:25PM (#38588102)
Sure, but adding two ints is trivial. Hello world probably operates to spec all the time too. Almost all software is vastly more compelx and isn't perfect.
Re:You are never taught how to build quality software by philipwhiuk on Sunday December 10, 2023 @11:32AM (#38592703)
> You would have to introduce things like tolerance to hardware failure, but that is outside the spec of the software as stated.

No-one in the real world gives a damn about your 'spec of the software as stated'

Re:You are never taught how to build quality software by ponector on Friday December 08, 2023 @05:38PM (#38575623)
You know, there could be bugs in spec. And you can have a software written with bugs but according to spec.

When testing should start? BEFORE the first line of code is written.

Re:You are never taught how to build quality software by digging on Friday December 08, 2023 @04:54PM (#38575065)
> If it works within specs it is bug free.

No, it's functional. If it has bugs, it's not bug-free. By definition.

Re:You are never taught how to build quality software by tonyarkles on Friday December 08, 2023 @05:48PM (#38575742)
Not to get too meta here but… what is your definition of a bug? One plausible definition is “system deviates from its specification”.
Re:You are never taught how to build quality software by digging on Monday December 11, 2023 @11:14AM (#38601860)
Fair enough. I considered a bug to be any behavior the engineers didn't plan in the code. They have their own specification, in their heads, that is more technical/exact than the business specification. Your definition is also reasonable but it's not what people mean when they say "there's no such thing as bug-free code", because bugs of my definition are almost unavoidable.
Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @05:10PM (#38575266)
What would it mean to be bug free then?

To quote a former marketing guy “it should work out what the user intends to do and do it”?

Re:You are never taught how to build quality software by ponector on Friday December 08, 2023 @05:41PM (#38575651)
Bug free software means developers would not disclose any information about present bugs in the software they ship to customers.

Really bug free commercial software does not exist. And can't exist. There are always bugs which are known but would not be fixed.

Re:You are never taught how to build quality software by digging on Friday December 08, 2023 @05:27PM (#38575500)
To have no bugs, which is extremely unlikely for a program of any real complexity. Having bugs, and being functional, are fairly self-explanatory and independent of each other. No need to try to conflate them.

Not sure what your quote is supposed to mean. That's a textbook example of someone who doesn't understand software at all making laughable requests of their engineers.

Re:You are never taught how to build quality software by fidotron on Friday December 08, 2023 @05:50PM (#38575777)
To be bug free we must be able to define what a bug is. So, what is a bug?

The reason for that quote is from what you have said a bug would be anything you didn't expect, even if it is consistent or not with the specification as that merely affects if we classify it as functional or not (a classification I profoundly disagree with, obviously). It is simply a negative rephrasing of what the marketing guy said and laughable in the same way.

Re:You are never taught how to build quality software by digging on Monday December 11, 2023 @11:12AM (#38601834)
As another commenter pointed out,

> One plausible definition is “system deviates from its specification”

And that's quite reasonable. So I actually retract my argument.

For my own definition, I was considering a bug to be any behavior that the software engineers weren't expecting. Because those can exist invisibly for a long time until they become so bad they become visible. They can also exist for decades without causing any problems to functionality at all.

Re:You are never taught how to build quality software by sanderjd on Saturday December 09, 2023 @11:49AM (#38583386)
As you alluded, in practice no specs fully specify a truly bug free implementation. If you want to consider bugs that are within the specification as being bugs in the spec rather than bugs in the implementation, fine, but in my view that is a distinction without a difference.

(Personally, I think code is itself more analogous to the specification artifacts of other professions - eg. blueprints - and the process of creating the machine code of what is analogous to construction / manufacturing something to those specs.)

And even having said that, even the vast majority "bug free" software that nearly always appears to be operating "within spec" will have corner cases that are expressed in very rare situations.

But none of this is an argument for nihilism about quality! It is just not the right expectation going into a career in software that you'll be able to make things that are truly perfect. I have seen many people struggle with that expectation mismatch and get lost down rabbit holes of analysis paralysis and overengineering because of it.

Re:You are never taught how to build quality software by fidotron on Saturday December 09, 2023 @02:03PM (#38584720)
> in practice no specs fully specify a truly bug free implementation.

Except for ones that do, obviously.

The key reason to make the distinction is because the fuzzy business of translating intention into specification needs to be fully accepted as an ongoing negotiation process of defining exactly what the specification is, and integrated into repeated deterministic verification that that is what has been delivered. Failing to do that is mainly a great way for certain software management structures to manipulate people by ensuring everything is negotiable all the time, and has the side effect that no one can even say if something is a bug or not. (And this pattern is very clear in the discussion in this thread - there is a definite unwillingness to define what a bug is).

IME the process of automated fuzzing radically improves all round quality simply because it shakes out so many of the implicit assumptions and forces you specify the exact expected results. The simple truth is most people are too lazy and/or lack the discipline needed to do it.

Re:You are never taught how to build quality software by sanderjd on Sunday December 10, 2023 @12:28AM (#38589373)
Those don't exist. There are too many free variables. Some get much closer than others (for instance via formal verification), but all specs are by necessity a model of reality, not the full reality itself.

Nobody actually has any trouble knowing what a bug is. Like, this is just a non-issue, I've never in my career spent a non-negligible amount of time debating with anybody whether something is or isn't a bug. We discuss whether fixing bugs have worthwhile return on investment, and we discuss the relative priority between fixing bugs and doing other things, but this meta-debate about "well technically it complies with this spec so is it even a bug, really?" just never comes up. We all know what bugs are.

Re:You are never taught how to build quality software by avgDev on Friday December 08, 2023 @05:08PM (#38575245)
There are people PUTTING out fires nonstop in many apps we all use.

I have been writing code for almost a decade now, and still make errors. I don't believe anyone is capable of producing bug free software.

I have also seen plenty of bugs in apps and games. I don't think I have ever witnessed a major game patch that was bug free.

Re:You are never taught how to build quality software by ponector on Friday December 08, 2023 @05:32PM (#38575552)
I encounter bugs everywhere all time. List goes very long.

Microwave has random errors from time to time.

Robo vacuum freezes.

Parking meter malfunction.

Public transport ticket machine don't want to give me a ticket.

Online banking failing to make a transfer because I use UI with other language.

Mobile banking failing to make a transfer because I use not native currency.

Car has issues as well, incorrect fuel amount is injected by computer.

Online pages have tons of bugs, many are barely usable.

Re:You are never taught how to build quality software by OnlyMortal on Friday December 08, 2023 @01:50PM (#38572686)
Correct. As I like to tell my team, if I’ve typed something I’ve caused a bug. It’s all about risk.

I assume I’m not infallible.

Writing some unit tests, C++ and mocking in my case, give both the team and myself some confidence I’ve not made things worse.

I’m the most experienced dev in the department.

Re:You are never taught how to build quality software by chopsuey5540 on Friday December 08, 2023 @02:00PM (#38572790)
You might be correct today but that’s a pretty sad state of affairs, don’t you think we can do better? Most other engineering domains can deliver projects without bugs, with various definitions of “bug” of course
Re:You are never taught how to build quality software by KeplerBoy on Friday December 08, 2023 @02:09PM (#38572861)
I'm not sure about that. Which engineering domain do you have in mind?

Maybe show-stopping bugs are somewhat unique to software engineering, but all somewhat-complex products are flawed to some extent imho.

It might be an unergonomic handle on a frying pan, furniture that visibly warps under the slightest load (looking at ikea shelfing) or the lettering coming off the frequently used buttons on a coffee machine.

Re:You are never taught how to build quality software by bee_rider on Friday December 08, 2023 @03:50PM (#38574159)
But there do exist shelves that don’t warp, when used within some reasonable bounds.

I’d also quibble about the buttons on the coffee machine. They might be properly designed, just subject to the normal wear-and-tear that is inevitable in the real world. This is not a defect, physical devices have finite lifespans.

As far as computers go… if we got to the point where the main thing that killed our programs was the hard drives falling apart and capacitors drying out, that would be quite impressive and I think everyone would be a little bit less critical of the field.

Re:You are never taught how to build quality software by saled on Friday December 08, 2023 @04:18PM (#38574558)
Formally verified, bug free software exists. It just costs a LOT to produce, and typically isn't worth it, except for things like cryptographic libraries and life or death systems.

As the discipline has evolved, the high integrity tools are slowly being incorporated into typical languages and IDEs to generally improve quality cheaper. Compare C++ to rust for example, whole classes of bugs are impossible (or much harder to make) in rust.

Re:You are never taught how to build quality software by kaba0 on Saturday December 09, 2023 @04:40AM (#38580269)
A shelve is a dumb primitive static object though. Even a simple hello world goes over a huge amount of lines of code before it is displayed on a screen, ANY one of which being faulty could result in a bug visible to the enduser. And most of that is not even controlled by the programmer — they might call into libc, which calls into the OS, which calls into drawing/font rendering libraries, that calls into video card drivers that “calls” into the screen’s firmware.

And this is almost the simplest possible program.

Re:You are never taught how to build quality software by bee_rider on Saturday December 09, 2023 @10:33AM (#38582696)
I think “hello world” is not really the simplest program in this context, in the sense that printing, as you note, involves touching all that complicated OS stuff. In terms of, like, actual logic complexity implemented by the programmer compared to mess carried along by the stack, it is really bad.

But I mean, I basically agree that the ecosystem is too complicated.

Re:You are never taught how to build quality software by ponector on Friday December 08, 2023 @05:48PM (#38575757)
There are many examples of catastrophic bugs in real life.

New bridges collapses, dams overflow s, planes crashes, vaccines kills, food kills, leaning towers and skyscrapers, capsized ships - catastrophic flaws are everywhere.

Re:You are never taught how to build quality software by ElectricalUnion on Friday December 08, 2023 @02:44PM (#38573254)
To be an engineer is to know the expected system requirements and build a product that is extremely optimized for the system requirements.

There's a saying that I think fits very well here: "Any idiot can build a bridge that stands, but it takes an engineer to build a bridge that barely stands."

You don't want a bridge to cost 50 years and quadrillions of dollars to build, you want a cheap bridge safe for the next 50 years done in 2 years.

I would not call the resulting bridge "bug free", of course.

Re:You are never taught how to build quality software by sanderjd on Friday December 08, 2023 @03:44PM (#38574078)
Their stuff has bugs too.
Re:You are never taught how to build quality software by imiric on Friday December 08, 2023 @05:22PM (#38575438)
We can certainly do better, but it takes a _lot_ of time, effort, care and discipline; something most teams don't have, and most projects can't afford.

Bugs arise from the inherent complexity introduced by writing code, and our inability to foresee all the logical paths a machine can take. If we're disciplined, we write more code to test the scenarios we can think of, which is an extremely arduous process, that even with the most thorough testing practices (e.g. SQLite) still can't produce failproof software. This is partly because, while we can control our own software to a certain degree, we have no control over the inputs it receives and all of its combinations, nor over the environment it runs in, which is also built by other humans, and has its own set of bugs. The fact modern computing works at all is nothing short of remarkable.

But I'm optimistic about AI doing much better. Not the general pattern matching models we use today, though these are still helpful with chore tasks, as a reference tool, and will continue to improve in ways that help us write less bugs, with less effort. But eventually, AI will be able to evaluate all possible branches of execution, and arrive at the solution with the least probability of failing. Once it also controls the environment the software runs in and its inputs, it will be able to modify all of these variables to produce the desired outcome. There won't be a large demand for human-written software once this happens. We might even ban software by humans from being used in critical environments, just like we'll ban humans from driving cars on public roads. We'll probably find the lower quality and bugs amusing and charming, so there will be some demand for this type of software, but it will be written by hobbyists and enjoyed by a niche audience.

Re:You are never taught how to build quality software by Dalewyn on Friday December 08, 2023 @02:33PM (#38573146)
A saying that I once heard and appreciate goes like this:

"A programmer who releases buggy software and fixes them is better than a programmer who always releases perfect software in one shot, because the latter doesn't know how to fix bugs."

Perhaps similar to the saying that a good driver will miss a turn, but a bad driver never misses one.

Re:You are never taught how to build quality software by MaxBarraclough on Friday December 08, 2023 @04:15PM (#38574520)
That's backward. A successful software development methodology will tend to catch bugs early in the development pipeline.

The doesn't know how to fix bugs idea seems pretty silly.

Re:You are never taught how to build quality software by Dalewyn on Friday December 08, 2023 @06:56PM (#38576589)
I think you misunderstand, I'm talking about a programmer who makes perfect, bug-free code in one shot. There are no bugs to catch and fix, because this "perfect" programmer never writes buggy code.

The moral of the sayings is, that "perfect" programmer is actually a bad programmer because he wouldn't know how to fix bugs by virtue of never needing to deal with them.

To reuse the driver analogy, the driver who never misses a turn is a bad driver because he doesn't know what to do when he does miss a turn.

Re:You are never taught how to build quality software by MaxBarraclough on Saturday December 09, 2023 @05:44AM (#38580670)
I don't see that I misunderstood anything.

If a software developer consistently delivers high-quality software on time and on budget, that means they're good at their job, pretty much by definition. It would make no sense to infer they're bad at fixing bugs.

It would make sense to infer instead that they're good at catching and fixing bugs prior to release, which is what we want from a software development process.

> the driver who never misses a turn is a bad driver because he doesn't know what to do when he does miss a turn

Missing a turn during a driving test will never improve your odds of passing.

The driver who never misses a turn presumably has excellent awareness and will be well equipped to deal with a mistake should they make one. They also probably got that way by missing plenty of turns when they were less experienced.

Re:You are never taught how to build quality software by Dalewyn on Saturday December 09, 2023 @10:38AM (#38582738)
Yeah, you're misunderstanding.

What we are discussing isn't a real programmer we might actually find. No, we are talking about a hypothetical "perfect" programmer. This "perfect" programmer never wrote a bug in his entire life right from the moment he was born, he never had a "when they were less experienced" phase.

Obviously, that means this "perfect" programmer also never debugged anything. For all the perfect code he writes, that makes him worse than a programmer who writes buggy code but also knows how to go about debugging them.

Re:You are never taught how to build quality software by HeyLaughingBoy on Friday December 08, 2023 @05:28PM (#38575509)
Nothing is bug free.

Not buildings, not bridges, not cars, not airplanes, not software. There are mistakes in every field of engineering and the best we can hope for is to minimize them as much as possible.

Engineering is knowing (among other things) how to categorize the potential mistakes, develop procedures to reduce the chance of them being made and in the case that some slip through (and they will), estimate their impact and decide when you're "good enough."

Software engineering is no different.

Re:You are never taught how to build quality software by rocqua on Saturday December 09, 2023 @12:48AM (#38579006)
I think with formal analysis, whole bug classes can be eliminated. Add to that a rigorous programming style, and 'bug-free' code is within reach. There will remain bugss that make it through, but they will be rare, and will need a chain of mistakes.

Currently ways of coding to this kind of standard exist. But they are stupid. It involves things like no dynamic memory allocation, only fixed length for-loops, and other very strict rules. These are used in aerospace, where bugs are rather costly and rare.

Re:You are never taught how to build quality software by kaba0 on Saturday December 09, 2023 @03:36AM (#38579925)
What seems to yield much better results is to have the program be built by two separate teams to a standard. Then both programs can be run simultaneously, checking each others output — I believe something like this is actually used in the aerospace industry.
Re:You are never taught how to build quality software by sublimefire on Saturday December 09, 2023 @07:58AM (#38581589)
Reminds me of a story about an engineer who was participating in a meeting with managers and partners. Manager was speaking of his team and how they will deliver software. Then, he asked the engineer to assure that the software will be bug-free. To this the engineer responded by saying he cannot guarantee there will be no bugs. The manager went nuts and started screaming.

Engineers cannot be responsible for all the vertical stack and the components which were built by others. If somebody claims it is bug free then they have not enough experience. Pretty much anything can fail, we just need to test as many possible cases as possible with a variety of available tools to reduce the chances of bugs.