DEV Community

Discussion on: The reasons I don't use Typescript

Collapse
peerreynders profile image
peerreynders • Edited on

"Code inspection is up to 20 times more efficient than testing" Experience with Inspection in Ultralarge-Scale Developments (1991) scan

Code reviews are probably the most informal form of code inspection. In the 2008 The Flawed Theory Behind Unit Testing Michael Feathers writes:

"In Clean Room [Software Development], you had to write a logical predicate for every little piece of your code and you had to demonstrate, during a review, that your code did no more or less than the predicate described. It was a very serious approach, and it was a bit more radical than what I just described: another tenet of Clean Room was that there was to be no unit testing. None. Zilch. When you wrote your code it was assumed correct after it was reviewed.

Amazingly, Clean Room worked. Clean Room teams demonstrated very high quality numbers."

So Clean Room Engineering uses a more formalized version of code inspection.


In this context Michael Feathers blog is interesting as he states.

Unit testing does not improve quality just by catching errors at the unit level. And, integration testing does not improve quality just by catching errors at the integration level. The truth is more subtle than that. Quality is a function of thought and reflection - precise thought and reflection.

Given TypeScript's popularity due to VS Code IntelliSense and Charles Petzhold's observation:

"So I don’t think IntelliSense is helping us become better programmers. The real objective is for us to become faster programmers, which also means that it’s cheapening our labor."

i.e. rushing through coding for the sake of productivity translates to less thought and reflection on the code. So while the code may type check, quality can still suffer unless that saved time is invested in unit testing and code reviews.

Collapse
staticglitch profile image
staticglitch

Thanks for this. A very interesting read through and through.

In an age where we prefer dehumanised contact, it seems, it's only natural we want our editors to say our work is good with none of that gross human criticism. It's almost like a self-approval mechanism.

In contrast, if I'm writing code that is literally going to be scrutinised for defects by my peers (and not just quickly glanced over)... I'm already forced to write in a clear way and not cut corners.