-- Leo's gemini proxy

-- Connecting to gemini.ctrl-c.club:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Re: What is a unit test


=>gemini://gemini.conman.org/boston/2022/10/08.1


Sean Conner poses this question.


The answer is actually more sensible in C than it was in Smalltalk: a unit is a compilation unit. In C, it is a file.


Any changes to source will require changes to a file. Once a source file is altered, it may screw something up in the resultant binary. Therefore, there should be a unit test to check that the altered unit behaves as expected.


Now, if it's a header, it may alter the behavior of many source units...


The easiest way to think of it in C is: assume make's view of the system.


Makefiles, if constructed as intended, identify units clearly, and all the headers they depend on (unless some coersive tool is used to hide this valuable information in exchange for convenience).


In better languages which allow compiling functions independently, a unit is more of whatever you want it to be...


I've never been able to keep the discipline of unit testing, and think it's kind of a bad idea, especially in more fluid interactive environments early in the project when things are changing.


=>. index

=>.. home

-- Response ended

-- Page fetched on Sat Jun 1 06:11:14 2024