Please enable JavaScript.
Coggle requires JavaScript to display documents.
Art of Unit Testing (K1 (Definitions (Legacy code (“source code that…
Art of Unit Testing
K1
Definitions
-
-
-
unit of work
is the sum of actions that take place between the invocation of a public method in the system and a single noticeable end result by a test of that system.
-
a unit
can span as little as a single method and up to multiple classes and functions to achieve its purpose.
unit test
a piece of code that invokes a unit of work and checks one specific end result of that unit of work.
-
-
accidental bugging
Code changes regularly during the life of an application, and if you can’t (or won’t) run tests for all the previously working features after changing your code, you just might break it without knowing
-
regression
-
Few things are scarier than not knowing whether the application still works, especially when you didn’t write that code. If you knew you weren’t breaking
anything, you’d be much less afraid of taking on code you’re less familiar with, because you have that safety net of unit tests.
Legacy code
“source code that relates to a no-longer supported or manufactured operating system or other computer technology,”
It often refers to code that’s hard to work with, hard to test, and usually even hard to read.
-
-
Control flow code
any piece of code that has some sort of logic in it, small as it may be
-
-
-
Integration tests
-
old definition
integration testing is “an orderly progression of testing in which software and/or hardware elements are combined and tested until the entire system has been integrated.”
Integration testing
a unit of work
without having full control over all of it and using one or more of its real dependencies
such as time, network, database, threads, random number generators, and so on.
unit tests
isolate the unit of work from its dependencies so that they’re easily consistent in their results and can easily control and simulate any aspect of the unit’s behavior
-
-
it takes time to prepare correctly and to implement, not just to execute
It takes time to figure out how to write it because of all the internal and sometimes external dependencies.
The harder it is to write a test, the less likely you are to write more tests or to focus on anything other than the “big
stuff”
big tests, the logic coverage that your tests have is smaller
-
-
-
books
The Complete Guide to Software Testing by Bill Hetzel (Wiley, 1993)