Skip to content

DIWithers/JBRainsTDD_SeriesTwo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JBRainsTDD_SeriesTwo

Notes

Triangulation: Adding special case tests with new inputs in order to justify generalizing the algorithm one step at a time, instead of jumping to what we believe to be "the general case".

Moving Duplicate Details From the Production Code into the Tests: If you see hardcoded data duplicated between the production code and the tests, change the production code to accept that data as parameters.

**Test List - ** product found, product not found, empty barcode, null barcode

**Refactoring List - ** duplicate test setup, introduce lookup table

Speaker Comments

"Up The Call Stack". I visualize the call stack with the client above the server, so "up" means "toward the entry point."

"Trusted Zone". I call this the Bouncer pattern: have one big, strong person at the front door keeping bad data out, and continually expand the "trusted zone" inside your code, where the occasional mistake appears as an unexpected exception.

"Temporal Duplication" : Same or similar steps happening more than once over time.

"Four Elements of Simple Design" :

  1. Pass the tests.
  2. Reduce duplication.
  3. Improve clarity.
  4. Consolidate design elements.

"Three steps for changing an algorithm" :

  1. Add the new code.
  2. Migrate the clients.
  3. Remove the old code.

To remove an "if" statement, make every branch do the same thing, so that branching is no longer needed. Naming a lookup table: Values By Key.

"Refused Bequest" : Making it look like you'll do something without doing it.

MAP(model) -----> SALE(controller) -----> DISPLAY(view)

The two most FUNDAMENTAL rules of TDD:

  1. Don't write code without a failing test.
  2. Remove duplication.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published