Rails: October 2006 Archives

Heckle: Another Rubyconf Hack

| | Comments (4)

Jester is a java test tool that finds code that is not covered by tests. It does this via bytecode mutation to modify code paths of the class under test. First it runs your tests and they should all pass (ass usual). Then it will modify conditionals for branching, change literals, and generally wreck havok, making one change at a time. By rerunning the tests per change, if they don't fail, then you've missed a test case. All in all this is pretty damn cool.

It turns out that getting a simple prototype up and running with 'if' node flipping takes about 100 lines of code. The meat of it is:

def process_defn(exp)
  self.method = exp.shift
  result = [:defn, method]

  result << process(exp.shift) until exp.empty?

  heckle(result) if should_heckle?

  return result
end

def process_if(exp)
  cond = process(exp.shift)
  t = process(exp.shift)
  f = process(exp.shift)

  if should_heckle? then
    [:if, cond, f, t]
  else
    [:if, cond, t, f]
  end
end

I've named it heckle and released it on rubyforge and Kevin Clark went insane last night and poured through it, ruby2ruby, and ParseTree to dig deeper. I haven't seen him this morning yet so I don't know if he's succeeded extending it yet. We'll see. There will be a more official release soon.

hoe 1.1.2 Released

| | Comments (0)

hoe version 1.1.2 has been released!

http://rubyforge.org/projects/seattlerb/

Hoe is a simple rake/rubygems helper for project Rakefiles. It generates all the usual tasks for projects including rdoc generation, testing, packaging, and deployment.

sudo gem install hoe

Tasks Provided:

  • announce - Generate email announcement file and post to rubyforge.
  • audit - Run ZenTest against the package
  • check_manifest - Verify the manifest
  • clean - Clean up all the extras
  • debug_gem - Show information about the gem.
  • default - Run the default tasks
  • docs - Build the docs HTML Files
  • email - Generate email announcement file.
  • install - Install the package. Uses PREFIX and RUBYLIB
  • multi - Run the test suite using multiruby
  • package - Build all the packages
  • post_news - Post announcement to rubyforge.
  • publish_docs - Publish RDoc to RubyForge
  • release - Package and upload the release to rubyforge.
  • ridocs - Generate ri locally for testing
  • test - Run the test suite. Use FILTER to add to the command line.
  • uninstall - Uninstall the package.

See class rdoc for help. Hint: ri Hoe

Changes:

1.1.2

  • Added -d and -t flags to sow to make dev or trunk subdirs for p4 and svn projects.
  • Added install_gem to further test gem builds.
  • Added test_globs to customize your test file list.
  • Removed demo.rb from clean_globs. I'm torn on this one.
  • Fixed bug in install rule.

ZenTest 3.4.1 Released

| | Comments (2)

ZenTest version 3.4.1 has been released!

ZenTest provides 4 different tools and 1 library: zentest, unit_diff, autotest, multiruby, and Test::Rails.

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.

unit_diff is a command-line filter to diff expected results from actual results and allow you to quickly see exactly what is wrong.

autotest is a continous testing facility meant to be used during development. As soon as you save a file, autotest will run the corresponding dependent tests.

multiruby runs anything you want on multiple versions of ruby. Great for compatibility checking!

Test::Rails helps you build industrial-strength Rails code.

% sudo gem update zentest

Changes:

3.4.1 / 2006-10-13

  • 3 minor enhancements:
    • FUNDAMENTALLY changed the way failures map back to tests. This requires users of autotest to ensure that their tests and impls map 1:1 at every scoping level. I'll blog more details soon.
    • Hoe'd rakefile
    • Added support for render :collection to RenderTree.
  • 7 bug fixes:
    • Fixed autotest tests for custom ruby names.
    • Fixed some documentation errors in ControllerTestCase.
    • Fixed setup in FunctionalTestCase.
    • Allowed @assignsignored to contain either Symbols or Strings, bug 5233.
    • Using Object.path2class to look up classes in helper test cases, bug 5493.
    • Added asserttextarea, bug 5452.
    • Renamed assertselect to assertselecttag. Stupid rails. We were here first.

About this Archive

This page is a archive of entries in the Rails category from October 2006.

Rails: September 2006 is the previous archive.

Rails: November 2006 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1