4 ms·
this stuff about how unit tests aren't tests for units but rather tests that are units is nonsense. the term has been used to mean 'tests for units' for about a
by kragen 3y ago
this stuff about how unit tests aren't tests for units but rather tests that are units is nonsense. the term has been used to mean 'tests for units' for about a century
it is certainly true that the optimal amount and kind of testing depends on your development environment. if for some reason you find yourself writing 6809 assembly, here are some ways you can make testing cheaper
- don't write the tests in assembly. there are c compilers. forth is also a fine option. or you can test manually from a debugger or monitor program
- forth makes a decent monitor program and macro assembler and is scriptable for testing. it's maybe a lot better at that than it is at being a programming language. there are reportedly very good forths for the 6809
- don't do the development self-hosted. you can simulate a 6809 on a laptop or cellphone hundreds of times faster than real time, and the author is in fact doing that. if you have a big computer with either a 6809 simulator or a debugging umbilical to your 6809, you can run the test scripts on the big computer instead of the 6809, while running the code under test on the 6809, real or emulated. then you don't have to write your tests in c or forth; you can write them in tcl, python, js, lua, squirrel, or whatever you prefer. they can control the 6809 like a marionette, and you can use property testing frameworks like hypothesis, which would be very ambitious to implement on the 6809
- maybe non-time-critical parts of your logic can be written in a language that can be compiled to either the 6809 or the big computer, such as c, so you can test it compiled natively on the big computer. cross-compiled to the 6809, this will generate bloated code that uses more memory, so it depends on how tight you are on space, though the 6809 isn't quite as unfriendly to c as something like a 6502 or pdp-10
- the exception is that if you write the non-time-critical parts in an itc forth instead of c or something, it won't use an unreasonable amount of memory, but it will be a lot slower and more bug prone
disclaimer, I haven't programmed a 6809 since 01985, and then it was in basic, and my forth isn't all that hot either
- pimlottc 3y ago> the term has been used to mean 'tests for units' for about a century I assume you’re being hyperbolic here, unless there’s some pre-modern history to the term I’m not aware of?
- kragen 3y agono, i am speaking quite precisely. 01923 is hardly medieval, and that's when the term came into common use in engineering jargon, with pretty much its current meaning, plus or minus about ten years https://books.google.com/ngrams/graph?content=unit+tests&year_start=1800&year_end=2019&corpus=en-2019&smoothing=3 https://books.google.com/ngrams/graph?content=unit+tests&yea...
- eddtries 3y agoThis is a little off, unless you give “unit” a very different term than most use it. The term unit vs division tests are used in the military, so a unit test is to check combat readiness of a unit and division tests is the combat readiness of a division. The books that use that term mostly come from US Artillery documentation. I wonder if the etymology of modern unit testing does come from that; but if it did I’d assume the other terms would exist too.
- kragen 3y agointeresting, i appreciate the correction. for some reason the google books date range searches linked from the n-grams page weren't loading for me, and the corresponding internet archive searches are also broken there also seem to be some search hits from 'unit tests' for education, in which the 'unit' is presumably a course or subdivision thereof; https://www.google.com.ar/books/edition/The_Organization_of_Unit_Tests_for_Indus/ninFvgEACAAJ?hl=es-419 https://www.google.com.ar/books/edition/The_Organization_of_... is an example, though sadly google refuses to show me any excerpts, perhaps because i'm in a country they don't like https://www.google.com.ar/books/edition/Naval_Training_Bulletin/wpTuxJs9HBwC?hl=es-419&gbpv=1&dq=%22unit+tests%22&pg=RA10-PA17&printsec=frontcover https://www.google.com.ar/books/edition/Naval_Training_Bulle... does show an excerpt so i guess the engineering use might date from later, perhaps as late as the 01960s
- pimlottc 3y agoSorry, by "pre-modern" I just meant "before the computer era"
- varjag 3y agodon't do the development self-hosted If you do this as a recreational activity, absolutely feel free do it self-hosted, for an authentic 1980s home computer user experience. To me doing retro computing on modern platforms or using simulated FPGA based hardware defeats the purpose.
- kragen 3y agooh, yeah, by all means, if you're looking for ways to increase the challenge level or gain empathy with 80s hackers, that's definitely a good way to do it, and you will probably have a lot of fun my advice 'don't do the development self-hosted' was only intended as a way to reduce the cost of automated testing (and, well, the whole development project) rather than an abstract moral imperative
- dools 3y ago> this stuff about how unit tests aren't tests for units but rather tests that are units is nonsense. the term has been used to mean 'tests for units' for about a century Is that in the article? I've never heard this before. Unit tests are tests that test a "unit" as opposed to integration tests which test how "units" work together. Of course when it comes to code, what one might call a "unit" is more arbitrary than what one might call a "unit" in an electronics project, which is I think one of the points the author is making.
- kragen 3y agoyou are of course correct on all points, but the article links to his previous article https://boston.conman.org/2023/11/19.1 https://boston.conman.org/2023/11/19.1 which links to this dumb meme at https://linkedrecords.com/the-big-tdd-misunderstanding-8e22c2f1fc21 https://linkedrecords.com/the-big-tdd-misunderstanding-8e22c... originally saying > Originally, the term “unit” in “unit test” referred not to the system under test but to the test itself. This implies that the test can be executed as one unit and does not rely on other tests running upfront which is historically incoherent. the author has weakened their post to now say > Rumors have it that the term “unit” in “unit test” originally referred to test itself, not to a unit of the system under test. (...) which is still reckless disregard for historical accuracy but now at least it's deniable