Friday, January 21, 2011

Making Mock Data Fun

While looking at documention for Pivotal Tracker's Activity Web Hook we were looking at the following piece of XML they provide as sample data:

<?xml version="1.0" encoding="UTF-8"?>
<activity>
<id type="integer">1031</id>
<version type="integer">175</version>
<event_type>story_update</event_type>
<occurred_at type="datetime">2009/12/14 14:12:09 PST</occurred_at>
<author>James Kirk</author>
<project_id type="integer">26</project_id>
<description>James Kirk accepted &quot;More power to shields&quot;</description>
<stories>
<story>
<id type="integer">109</id>
<url>https:///projects/26/stories/109</url>
<accepted_at type="datetime">2009/12/14 22:12:09 UTC</accepted_at>
<current_state>accepted</current_state>
</story>
</stories>
</activity>

They also show the following example for creating a new user:

e.g. Name, email, or James T. Kirk (JTK) <kirk@starfleet.edu>

We couldn't help but laugh and think that pivotal must be a fun place to work.  While discussing other types of funny mock data we'd seen both in our own office and elsewhere we had the thought that having fun mock data could help get developers more involved with testing.  


In my experience most developers dislike creating data to test with. I'm not talking about making mock objects but making actual test data that mirrors what you'd expect to have in a real system. It's tedious and not very fun. Nothing beats real data of course, however, a good set of mock data makes it much easier to test an application either manually or in some automated CI system so it is definitely something you want to have when developing an application.