Not quite exact. The precise and important difference is that in almost all 
video games somebody else has written the unit and coverage tests for you. 
Writing the tests and coverage yourself would be akin to setting your own 
goals which is rare in video games. 

If the goal is to make programming more video game like you may have 
exposed a worthy programming pattern: write tests, but not for yourself; 
and write code, but not to pass tests you've written. This could be done in 
pairs or in a larger group. In fact I can see how this could also make 
writing tests for existing code more fun as there would be a challenge in 
finding holes in other people's code.

On Saturday, January 18, 2020 at 7:07:38 AM UTC-5, Edward K. Ream wrote:
>
> The recent Aha's re the connection between unit testing and coverage 
> testing have turned computer programming into an utterly absorbing 
> adventure. Computer programming now feels like playing a video game!
>
> The analogy is exact!
>
> In a video game, you have more or less clearly defined goals. (In some 
> games the goal is to figure out what the goal is.) To attain those goals, 
> there is a well defined set of actions you must take. In well-crafted 
> games, those actions are pleasurable in themselves, or at least not utterly 
> tedious. There are also a set of obstacles, which make attaining the goals 
> non-trivial. There is also usually a score that measures progress. All 
> these combine to make a computer game it's own little universe.
>
> Likewise with computer programming. You have more or less clearly defined 
> goals. There are also actions, obstacles, and now, with coverage testing, a 
> score. Programming is now it's own *structured* universe. The goal gets 
> translated to unit tests, which all must pass with 100% coverage.
>
> *Summary*
>
> Unit tests translate a possibly ill-defined goal into something concrete, 
> specific and well defined. The task is, by definition, complete when all 
> unit tests pass with complete coverage.
>
> Coverage testing allows uncovered code to be discarded when all relevant 
> tests pass. This was a completely unexpected, and most welcome, development.
>
> The entwined tasks of creating unit tests and ensuring complete coverage 
> almost completely structures the task of programming. As a result, 
> programming is *more* engaging and compelling than ever before.
>
> Folks, this is a big deal.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6c2df975-00b4-4ac9-859f-73a77393b8cb%40googlegroups.com.

Reply via email to