~/talk

Am I Testing the Right Way? - Two Unit-Testing Approaches Explained!

links:none on file
slides:none on file

A small Java calculator with expression-tree handlers is implemented and tested with JUnit 5; the concrete claim is that two practical unit-testing scopes work: fine-grained (class-level) mocks tests each handler by mocking nested expressions and the calculator, including a division-by-zero assertion, while coarse-grained via public API exercises the real handlers through Calculator.calculate. Tests run green; tradeoffs: fine-grained forces API openings (unsealing) and many small mocks, coarse-grained keeps internals hidden but can mask poor internal design.

AI-written summary · about

  1. 0:00Introduction and testing overview
  2. 3:57Defining unit testing approaches
  3. 14:18Fine grain testing style
  4. 23:22Coarse grain testing style
  5. 31:55Comparing both testing styles
  6. 36:12Choosing the right approach
  7. 37:17Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.