Live data from Hacker News

Testing is better than data structures and algorithms

nedbatchelder.com

121–130 of 178 posts

Re: Testing is better than data structures and algorithms

#121

Earlier quoted context omitted.

The Art of Software Testing. New York: Wiley, 1979 The Art of Software Testing, Second Edition. with Tom Badgett and Todd M. Thomas, New York: Wiley, 2004. It is by Glenford Myers (and others). https://en.m.wikipedia.org/wiki/Glenford_Myers From the top of that page: [ Glenford Myers (born December 12, 1946) is an American computer scientist, entrepreneur, and author. He founded two successful high-tech companies (Ra…

As I recall this was a book that included the orthodoxy at the time that random testing was the worst kind of testing, to be avoided if possible. That turned out to be bullshit. Today, with computers many orders of magnitude faster, using randomly generated tests is a very cost effective away of testing, compared to carefully handcrafted tests. Use extremely cheap machine cycles to save increasingly expensive human t…

Interesting. Don't remember that from the book, but then, I read it long ago.

I agree that random testing can be useful. For example, one kind of fuzzing is using tons of randomly generated test data against a program to try to find unexpected bugs.

But I think both kinds have their place.

Also, I think the author might have mean that random testing is bad when used with a small amount of test data, in which case I'd agree with him, because in that case, an equally small amount of carefully crafted test data would be the better option, e.g. using some test data in each equivalence class of the input.

Re: Testing is better than data structures and algorithms

#122

Earlier quoted context omitted.

Testing, especially vstest.console.exe in Visual Studio has carried my business really far. I have accumulated thousands of tests on my codebase usually based on customer requirements or on past bugs which I have been trying to replicate. I think that a lot of people dislike testing because a lot of tests can run for hours. In my case it is almost 6 hours from start to finish. However as a software developer I have a…

I have not done it, myself, but I think that Xcode, for Apple stuff, can parallelize tests, across multiple machines (maybe VMs?). I would assume that Microsoft systems could do the same.

A lot of tests are sharing one resource (USB device) which can't be accessed in parallel. So that's my constraint which I need to live with and the main reason why I can't parallelize or offload testing to cloud.

Otherwise yes, you can run tests in parallel in vstest. That's completely possible.

Re: Testing is better than data structures and algorithms

#123
post #81

Earlier quoted context omitted.

A common story with JIT languages is to go back and forth between having a bytecode interpreter and not. The paradox is that when the interpreter is fast enough then you delay JIT because it takes longer for the amortized cost to be justified. But that also means the reasons for that high amortization cost don’t get prioritized because they don’t really show up as a priority. Eventually the evidence piles so high nob…

I wanted to preserve the "code is just lists" property of lisps. Compiling the lists away means that property is lost: the code becomes bytecode or native code instead, sacrificing lisp's soul in exchange for performance. I want to implement a partial evaluator one day. That should go a long way to improving performance by precomputing and inlining things as much as possible.

Sometimes people avoid that by making a stupidly cheap code generator that goes straight from the input file format to unoptimized machine code. Because you only have to reach a fraction of what the optimized code would achieve for throughput.

Re: Testing is better than data structures and algorithms

#124
post #61

Earlier quoted context omitted.

Mediocre testing can also lead to a situation where there is friction for improvement because the tests are brittle and coupled (with each other and the misfeature you’re interested in fixing). I like a more uniform distribution in my testing efforts. Start earlier, end later than most, and it’s experiences like this that inform that preference. And also production bugs in code with supposed 100% test coverage.

> Mediocre testing can also lead to a situation where there is friction for improvement because the tests are brittle and coupled This is very very common among inexperienced devs and in immature organizations that think that more tests necessarily means better.

And devs who think they are experienced by disappear when the testing gets tough.

Re: Testing is better than data structures and algorithms

#125

Earlier quoted context omitted.

it is not edgy whatsoever. it reflects the actual reality on the ground. nobody goes to school to learn how to use git or how to write unit tests. it's not something that needs to be actively "learned", you'll just absorb it eventually because you can't escape it. The more interesting and important things you will never "just absorb", you actually have to make a conscious effort to engage with them.

I'm replying to statements like this > "testing" is not fundamental. and > there is no real skill to be learned there one of the biggest problems that has plagued software is failed projects. There have been a lot of them, and its probably costs hundreds of billions of dollars. I can guarantee not one of those projects failed because somebody had to take the time to look up the best data structure. But I'll bet a lot…

Citation needed.

I've seen projects fail for a multitude of reasons, by far the most common are boring political ones, like the leadership not understanding what it is that they want to build.

Hiring people who think bloom filters are "exotic" to work on a distributed system could certainly doom that project to failure regardless of how diligently tested it is.

I assure you that if you have enough competence to actually go through with designing and building a thing, you certainly have more than enough competence to test it. It is not a fundamental discipline that needs to be studied, much less at the expense of fundamental knowledge.

Edit: to reframe it a bit differently: you can always add more tests. you can't fix the problems you don't even know you have due to lack of thorough understanding of the problem domain.

Re: Testing is better than data structures and algorithms

#126

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

In the end it doesn't really matter.

In software development hiring, everyone tests for DSA whether it is useful or not in the actual job description.

Re: Testing is better than data structures and algorithms

#127

We wrote a conferencing app and server (years before Zoom). Tested the server by having automated headless apps run in gangs, a hundred at a time, hopping from conversation to conversation, turning mic and camera on and off, logging out and logging back in. Used it for years, the Bot Army we called it. Responsible for our rock-solid quality reputation. Not API design or test classes or constraints or anything. Just,…

How much work was it to go from 1 hour to 1 week? How many issues have you discovered, what were they? Genuinely interested.

Re: Testing is better than data structures and algorithms

#129
I have always thought of DSA as a proxy for a subset of general software development skills: the ability to translate a problem into computer science or programming terms, implement it in code, and argue that the implementation is correct and efficient. Skill in solving DSA problems can signal both an aptitude for absorbing computer science knowledge in general and a capacity for solving problems through programming. It's not the whole thing, but it's certainly an important component.

It’s not unlike a research mathematician being expected to solve quadratic equations. He may not need them in his day-to-day work, but with a little preparation he should be able to handle them. If he struggles with quadratic equations in an interview where such knowledge is expected, that would raise a red flag about his training.

Re: Testing is better than data structures and algorithms

#130

I think the author is mislead Let's grab a simple use case: some basic CRUD http API. Easy, you say, no need to know fancy stuff ! Just test it and that's all. You do your test, all good, you can roll in production ! But sadly, in production, you have multiple users (what an idea ..). Suddenly, your CRUD api has become a concurrent system. Suddenly, you have data corruption, because you never thought about anything a…

Macro Pierre White says "perfection is lots of little things done well." Which is something I've always agreed with, so, I never understand articles that seek to eschew an important part of releasing software because they believe their approach elsewhere is enough to overcome these intentionally suboptimal choices.

Almost all of professional software should be intentionally suboptimal.

This is what we mean when we say that premature optimisation is the root of all evil.

Post reply on HN