Ruby: February 2007 Archives

(to try to make up for the previous rant)

I've been making big fundamental changes to ParseTree and consequently ruby2c's implementation and testing. As a result, I'm drowning in hundreds of failures (869 tests, 2217 assertions, 238 failures, 193 errors). Even though they run fairly fast, autotest isn't much help at this stage, so I resorted to (*gulp*) manual test runs, but with a small twist:

ruby test/test_type_checker.rb -n "/test_[a-b]/" | unit_diff

This lets me focus on one class, with only about 10 or so failures/errors at a time to keep the clutter down. As my favorite mgr used to say:

"Big alligators, Little alligators, Swamp."

With this technique, I work from the bottom up and slowly wade through and eventually drain the swamp.

burnout and the late night rant

| | Comments (9)

I've been thinking about this for a while now. The OSS burnout is a bit high right now. (Pardon my French.)

23:54  zenspider : ARGH!!! I'm so fucking close to giving up on open
                   source and telling all you fucks to bite me.
23:54       evan : zenspider: what happened now?
23:55       evan : people again?
23:55  zenspider : yes. as weinburg points out, it is ALWAYS a people
                   problem
00:02  zenspider : I'm just sick of the fucking leeches and their
                   incessant drain. take everything, offer nothing,
                   and bitch about the results.
00:02  zenspider : what they don't realize is that I didn't write ANY of
                   my code for them. I wrote it for me because I love
                   coding. I _happened_ to release it all simply because
                   I can and like to share, but I still didn't write it
                   for them.
00:03  zenspider : but lately I've been tempted to pull it all and walk
00:03       evan : zenspider: so just ignore them.
00:03  zenspider : it gets hard
00:04       evan : or make friends with someone that will take care of
                   that crap for ya
00:04  zenspider : it was easier back in the day, but the railz0rs come
                   in droves
00:04       evan : yep.
00:04       evan : it's all PHP's fault.
00:04       evan : really.
00:06  zenspider : honestly, I blame it not on technology, but greed.
                   it was the dot-com bubble that brought people to the
                   scene who weren't there for the love of code or the
                   love of creating, but for greed.
00:06  zenspider : and the greed of the suits made them lower the bar and
                   bring in less qualified people which forced us all to
                   compromise and slow down, release crap slower instead
                   of quality faster
00:06       evan : i agree 100%
00:07  zenspider : lower the standards so we kept them even when they
                   couldn't perform
00:07  zenspider : and now it is just happening again, web2 is simply
                   rebranded greed
00:08  zenspider : none of it has changed my love for coding
00:08  zenspider : but it has changed my desire to contribute

Heckle is a mutation tester. It modifies your code and runs your tests to make sure they fail. The idea is that if code can be changed and your tests don't notice, either that code isn't being covered or it doesn't do anything.

Changes:

  • 1 major enhancement:
    • Unified diffs for mutatated methods
  • 4 minor enhancements:
    • Now returns exit status 1 if failed.
    • Added a simple report at the end.
    • Runs are now sorted by method.
    • Autodetects rails and changes test_pattern accordingly.
  • 2 bug fixes:
    • Aborts when an unknown method is supplied.
    • Escapes slashes in random regexps.

ruby2ruby provides a means of generating pure ruby code easily from ParseTree's Sexps. This makes making dynamic language processors much easier in ruby than ever before.

Changes:

== 1.1.5 / 2007-02-13

  • 3 minor enhancements:
    • Can now heckle ActiveRecord::Base in full.
    • Cleaned up 1-liner generating code.
    • Made clean/simple rescues 1-liners.
  • 7 bug fixes:
    • Finally got the rest of blockpass working.
    • Fixed blockpass on procs in iters. UGH!
    • Fixed attrasgn in masgn.
    • Fixed splat in masgn.
    • Fixed unary/prefix methods.
    • Fixed attrasgn for []= where there were multiple args inside [].
    • Fixed a couple resbody bugs.

ParseTree is a C extension (using RubyInline) that extracts the parse tree for an entire class or a specific method and returns it as a s-expression (aka sexp) using ruby's arrays, strings, symbols, and integers.

Changes:

  • 2 major enhancements:
    • rewrite extracted and intended to be run before (or in front of) process.
    • rewrite is now recursive as well, so children rewritings should be done independently of their parents. This should make complex rewriting layers much cleaner and allow me to eventually collect and publish a single "standard" rewriting layer.
  • 1 minor enhancement:
    • Iters are now {} if short and one line. YAY!
  • 1 bug fix:
    • Added test cases brought out by ruby2ruby/heckle.

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.

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
  • config_hoe - Create a fresh ~/.hoerc file
  • 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
  • install_gem - Install the package as a gem
  • multi - Run the test suite using multiruby
  • package - Build all the packages
  • post_blog - Post announcement to blog.
  • 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.
  • test_deps - Show which test files fail when run alone.
  • uninstall - Uninstall the package.

See class rdoc for help. Hint: ri Hoe

Changes:

= 1.2.0 2007-02-13

  • Added more support for ext dirs.
  • Added a simple config file (yaml). Use 'rake config_hoe' to edit.
  • Added postblog task (thanks Aaron!), configured via confighoe.
  • Announce task now posts to your blogs and/or publishes API depending on config.

Notes on Heckle

| | Comments (1)

From an IM with Eric Hodel:

"I ran it on [insert scary class name here]
it finally ran into a [method in the r's] about 2 hours later
I think it found no errors
so heckle will tell you one of three things about your code:
its well tested,
its poorly tested,
and its so coupled that test failures must happen because its crap.
" (emphasis mine)

I have to agree. When I started heckle I was hoping for somehing better than rcov that would tell you that your code is poorly tested... But code so poorly engineered that changing anything as bound to make everything fall apart looks like well tested (read: heckle-proof) code in a sense. We both think that running just the unit tests that directly test the MUT (method under test) would help, but really it wouldn't help enough. I tend to think at that point that you don't have technology problems, you've got people problems. Technology can't help that very well.

Suggestions? How would you differentiate between "well tested" and "tightly coupled crap"?

About this Archive

This page is a archive of entries in the Ruby category from February 2007.

Ruby: January 2007 is the previous archive.

Ruby: March 2007 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