I’ve probably worked on 100+ software and hardware products for consumers, military and industry
.0001% of that software had formal verification, bitwise memory management, 100% test coverage, clean documentation and specifications, a clear roadmap, long term sustainability plan and sustainable economics
Technology is like a good meal: only possible for a moment and only a moment.
too early and it’s inedible too late and it’s spoiled.
I think he is talking about talking to users BEFORE coding
At least that is true for my software coding processes; I always found getting the actual coders talking directly to the actual users — not the managers talking to the managers — vastly improved the software delivered along all three axes of schedule, budget, and quality, and dramatically reduced test/redo cycles. Just having the coders in direct contact, they hear about the real used cases, edge cases, and frustrations, and so can make good judgements about many decisions, rather than blind judgements.
If I have a function add_nums that takes 2 numbers and adds them, there are like infinite inputs that can be tested.
If I have a function shape_color that can take circle, triangle, square for the shapes and red, blue, for the colors, then there are 6 different states. But what if my function just returns if it is a circle or triangle. It only cares about 2 different color paths when it is a square. Do I test all 6 states or do I test only the 3 code paths?
I think code coverage like many things is a “it depends”.
I think 100% code coverage usually means that for every branch, there is some test that results in it going down that branch? Like, there’s no line of code (outside of potential exception handling code?) that isn’t “tested” by any test (where “tested” means “it gets run during the test”).
>> If I have a function add_nums that takes 2 numbers and adds them, there are like infinite inputs that can be tested.
That's what formal verification is for: you generate math statements from the code, and then prove them.
Testing is for covering the most common scenarios and likely edge cases. 100% coverage means every line of code in the app is executed when your test suite runs. It is useful as a bare minimum, but by itself does not guarantee that there are no bugs.
It really depends on the shape of the tests and the shape of the language. Eg: Untyped languages often have tests that effectively implement a type system as software grows and the developer count grows. That seems like a waste…
Writing a good test or good set of tests does take effort but enforcing 100% coverage often pushes some folks to just run the code in any way possible within the test subsystem.
> Untyped languages often have tests that effectively implement a type system as software grows and the developer count grows. That seems like a waste…
Nicely put. A very verbose type system that is also placed too far away from the definitions indeed
It’s a question of the degree to which you want a self audit to be native to your structure or not
if you are confident that the complexity of what you have built can be fully tracked in your head then either you are some sort of God or you’re not used to building complicated enough things with critical failures attached to them
func below_ten()
if 10 < x
println(“true”)
else
println(“false”)
end
end
Now what would a test for these two paths test? It would basically be writing down the same - easy to understand logic - in a less generalized way. Good perhaps to ensure that this function doesn’t accidentally change over time but apart from that it wouldn’t add much value.
Exactly. If the function is already verified to be correct, then the unit and integration tests will determine if the function is appropriate for the context.
.0001% of that software had formal verification, bitwise memory management, 100% test coverage, clean documentation and specifications, a clear roadmap, long term sustainability plan and sustainable economics
Technology is like a good meal: only possible for a moment and only a moment.
too early and it’s inedible too late and it’s spoiled.