The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Reworked semi-automagic test generator and code annotator

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
Reworked semi-automagic test generator and code annotator Posted: Jul 15, 2006 9:34 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: Reworked semi-automagic test generator and code annotator
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

I cleanup up my semi-automagic test generator and xmp filter for Ruby, and added some code to make it win32-friendly*1.

If you missed it the first times I wrote about it: xmpfilter.rb is basically a source code filter than generate assertions for your tests, and annotate the code to show intermediate results. This picture illustrates the former:

screenshot.png

The code on the right of the above picture was generated by

 xmpfilter.rb -u code.rb

This can save quite some typing when you're adding regression tests, or when you're developing the code and the tests in parallel. It can (and should) be used incrementally: you expand the assertions once and then keep editing the generated code (not the original one!), repeating this as many times as needed while you're writing the tests --- think of it as an intelligent kind of macro expansion. It should only take about 1 keypress under a sane editor (I show how to do it with vim below).

Intermediate result annotations


Read more...

Read: Reworked semi-automagic test generator and code annotator

Topic: GDrive Finally Showing Some Love for Linux? Previous Topic   Next Topic Topic: Rails - validates_unlike: plugin para validar que una atributo no cumpla un RegExp

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use