Verbose Logging

software development with some really amazing hair

T + G I F R

Articles tagged with "testing"

manbearpig: Mutation Testing for Go

· Posted in Programming
Mutation testing isn't about testing your code, but about improving your tests. What happens is the testing tool looks through your source code for instances of some known thing. This usually something easily tweaked, like ==. For each instance, it changes it to some opposite value that makes sense. In the case of ==, we can change it to !=. For each single change it makes, it runs the tests. The idea is that the tests should fail. If they don't…

Debugging Cucumber On Rails

· Posted in Programming
I like frameworks, but sometimes debugging them is more entertaining. I don't know why I didn't think of this method before, but mischa on github has a great little repo showing how you can do it. The README Usage: Add: require 'ruby-debug' require 'cucumber_rails_debug/steps' To features/support/env.rb Then use: Then debug # opens the debugger or Then what # prints out params, url and html Check it out here

Riding Rails With Selenium

· Posted in Programming
Selenium is a suite of tools to automate web app testing across many platforms. Cucumber is a BDD framework that allows you to write things in English (or whatever language you want, really), and have that execute as code. Put those together with webrat and rspec and you have a pretty mean stack to test your ruby on rails web application with. Sort of. I've been having some problems with it, getting it set up, but it's coming along. This isn't a…

Using Ruby's Eval To Make Cucumber Bigger And Greener

· Posted in Programming
In case you just crawled out from under your rock just to read my blog, and haven't the foggiest, cucumber is a ruby acceptance testing framework, and works great with rails. I was writing features for admin users in this application, and needed a step like this: Then I should be editing "test@example.com" Where the quoted email is the login. Later on (in fact right after…I was testing edit functionality, and after safe you end up on the view us…

Stubs Vs mocks

· Posted in Programming
I keep coming back to asking myself what the difference between stub and mock objects are and I have it figured out, so here it is: Stubs just return whatever you tell them do, and that's it. Mocks have expectations and cause tests to fail if those expectations aren't met.