Thursday, December 19, 2019

TDD and mocking a Google Application Script with GAST

What is TDD

Motivation for writing this: teach the TDD workflow with GAST.  

Why do TDD?  Expected outcomes. Reference GAST.  Mention other tools.  W

TDD Workflow

Look at the code or do some white boarding/thinking about what code change you want to make. Once you identify your opening move--change existing code or create something brand new, start the TDD flow.


Step 0, Setup GAS Project

Step 1, Define the next simplest step in functionality

Describe what is meant by simplest.  And not necessarily complete.  Just a step.

Step 2, Work on Test until it has a fully functioning FAILURE

The test should and what it's testing should compile but not comprise of the product code yet.  Said another way, the test should be completely formed (meaning no errors or exceptions occurring in the test code) and successfully calling your product code (which is simply a stub at the beginning).

Step 3, Add functionality to get the test to PASS

Step 4, Refactor

Step 5, Go Back to Step 1 or Check in if Finished

By the way: learn more about TDD and micro testing

Check out the Agile Thoughts podcast.  This podcast gets the Confessions Of An Agile Coach's endorsement (naturally, since the same people produce it) of quality materials for developers and teams trying to get coding done in a way that avoids dealing with legacy issues such as bugs and hard to maintain code.  Agile Thoughts has a lot of great TDD conceptual content along with a radio drama about the difficulties to getting a TDD initiative started.  Click the podcast cover below or here for more information.

Agile Thoughts podcast

No comments:

Post a Comment