Test-Driven Writing

09 April 2015 Unknown 0 Comments

image by perforce.com


I had a funny idea the other day. I was thinking about about my new process for my latest book and I made a connection between that and the programming I was doing at the time.

I call it "Test-driven writing" and most of you won't know what that refers to, but I'm going to fill you in. In programming there is this idea or method of how you write programs by starting with the tests that should pass when you're done.

Here's an example from the Ruby language using a tool called Rspec:

 it "should update the user name when edited" do  
  # your test code goes here  
 end  
   
 it "should display the awesome content on page load" do  
  # your test code goes here  
 end  
   
 it "should not fail when the user double clicks the submit button" do  
  # your test code goes here  
 end  

I think it's fairly easy to understand what it's trying to test. So you write these tests beforehand and then write the code to make the program work. Next, you run the tests and they should all pass before you move on.

The tests inform the programmer what the program is expected to do. Usually there are thousands of tests that have to pass and they are very detailed and for every small piece of the program.

So I bet you can guess what Test-Driven Writing is all about.

You write tests before you write a scene and then at the end of the scene you go through your tests and make sure the scene passes those tests.
 it should: advance Brad's relationship with Karen  
   
 it should: end in a cliffhanger  
   
 it should: set up the next scene with xyz  
   
 it should: hit the following emotional beats: humor, drama, suspense  

I'm not sure how serious I am about this. It's an interesting idea and it could maybe possibly be useful, but I don't know if it's worth the time it would take and I'm not sure if it work as well as I'm thinking in my head.

It was really just a funny connection between two of my passions and I thought I should write it down. If you do end up using it, tell me how it worked out for you and whether or not you'd use it again.

0 comments :

Hey there, thanks for leaving a comment. You're a good person