"...insecure, low-confidence, low-self-esteem code results in tentative systems that are not capable of the kind of robust operation we need..."

What is AffirmIt?

AffirmIt! is the supportive testing framework for Ruby.

Studies across the globe have confirmed that the archaic practice of using testing frameworks that dampen enthusiasm and break spirits are not only damaging to young minds, but are impactful on GDP. Enter AffirmIt! -- the only behavioral evaluation framework that always uplifts the spirit and makes you feel good about your code. Out with the failing tests of yesteryear's frameworks, in with the group hugs of AffirmIt!

Getting AffirmIt!

To get AffirmIt!, make sure you have RubyGems installed, then install the AffirmIt! gem:

gem install affirmit

If you'd rather check out the source code and build it for yourself, feel free to visit our Github project page.

What's different about AffirmIt?

In AffirmIt!, we tolerate all code, whether it exhibits behavioral challenges or not. Of course, we never use the words "test" or "failure", which would imply a value judgment, or "assertions," which would imply an absolute truth. Instead, we tread softly around our code (in fluffy bunny slippers) and espouse preferences, deferring success if necessary until that joyous moment when all our affirmations can be cherished in fullness.

In more concrete terms, here are some of the ways that AffirmIt! can make you feel better about yourself and your code:

  • AffirmIt! gets rid of all those archaic, harsh notions of "truth" and "failure."
  • AffirmIt! allows you to switch your frame of reference if your current one results in too many affirmations that are not fully cherished (what non-affirming frameworks might call "failed tests").
  • AffirmIt! has a nice extensible DSL-ish syntax for its preferences that gives meaningful error messages even for complex conditions. For example: prefer_that self.worth, is(greater_than(yours)) & responds_to(:group_hugs)
  • AffirmIt! lets you make up for un-cherished affirmations by getting bonus points! For example: maybe == 3
  • AffirmIt! lets you praise objects. This may not accomplish anything, but it sure feels good!
  • Only AffirmIt! gives you gold stars when you embrace your affirmations. And you can never get fewer than three!

Using AffirmIt!

Let's say you wish to affirm the following code. (The less sensitive programmer might wish to "test" this code; however, we prefer not to make value judgments about code that "works" or "doesn't work.")

class Dead < Exception; end

class Unicorn
  attr_reader :life_force, :locations

  def initialize
    @life_force = 10
    @locations = []

  def is_dead?
    @life_force <= 0

  def prance location
    @locations << location
    @life_force -= 3
    raise Dead if @life_force < 0 # return

To affirm your Unicorn, just write a class that extends AffirmIt::Affirmation, with methods that begin with affirm_ and contain preferences using the method prefer_that. Here's a simple example:

require 'affirmit'

class UnicornAffirmation < AffirmIt::Affirmation
  def build_up
    @unicorn =

  def affirm_life_force
    prefer_that @unicorn.life_force, is(10)

  def affirm_prance_adds_location
    prefer_that @unicorn.locations.empty?
    @unicorn.prance :fields
    @unicorn.prance :flowery_meadows
    prefer_that @unicorn.locations, (includes :fields) & (includes :flowery_meadows)

  def affirm_prance_too_much_can_be_fatal
    3.times { @unicorn.prance :fields }
    prefer_that @unicorn.life_force, greater_than(0)
    prefer_raise Dead do
      @unicorn.prance :killing_fields
    maybe @unicorn.is_dead?

In order to embrace this affirmation, simply run the file:

ruby unicorn.rb

You'll see some output like this:

Starting group hug unicorn.rb
There were:
  - 3 affirmations (3 cherished)
  - 5 preferences
  - 0 differing opinions
  - 0 elective success deferrals
  - 0 behavioral challenges
  - 0 issues
  - 1 bonus points

You got 5 out of 5 gold stars!  Great job!

For more examples, and to help us continue to develop the future of software behavioral evaluation, check out our development site.


AffirmIt! has changed my life! I have struggled for so long in the software development field. I was always sprinting towards failure and no matter how hard I tried, I always felt like a failure. AffirmIt! with their group hugs have made me feel so much better!

by Lois Elphisteam

AffirmIt! helped me to feel that I'm good enough, I'm smart enough, and doggonit, people like me! I used to develop software using those bad frameworks and every night when I'd come home from the office, I'd be laying there alone.. all those tapes rolling: "I'm a fraud.. tomorrow, I'm going to be exposed for what I am, a big impostor.. I just want to curl up and lay in bed all day and eat Fig Newtons." That's just stinking thinking. AffirmIt has helped me to know that ... "I'm good enough, I'm smart enough, and doggonit, people like me!"

by Stuart Smalley



We adhere to the philosophy of Dr. Sue Donim. Some key quotes from her seminal paper, Revolutionizing Code Affirmation in Our Relativistic World, are shown below.

  • "...a study done in 2010, a gedanken experiment, revealed that the number one issue facing software developers and software itself is self-esteem [footnote: 80% of statistics are made up.]..."
  • "insecure, low-confidence, low-self-esteem code results in tentative systems that are not capable of the kind of robust operation we need..."
  • "We need systems that have the creative confidence to take the bold, innovative steps we need them to take; to instill confidence in end users. If this approach is extended from back to front, end users will feel good about the softer outcomes of their inept..."
  • "...countless generations of incompetent people have shown us that you don't actually need success to feel successful..."
  • " a world where perception is reality, what we need most is our people and our users to feel successful..."