pluginAfter competing in many SRMs, I realized that I had to use good TopCoder Arena plugins to achieve the fastest coding experience. I have been using FileEdit + CodeProcessor + some tester plugins before, and I was quite satisfied with their performance during SRMs.

The most vital plugin is probably the tester plugin, because with a single click in my IDE, all sample testcases will be run. There is no need to click many buttons in the Arena to run the testcases.

However, as a programmer, I am interested to create my own tester plugin. So, here is my BETA version of the plugin, called TesterDream. Please have a try!

It is inspired by TZTester and moj.

Features

The current BETA version has these features. TesterDream only supports C++ language.

  1. Your program is tested against sample testcases with only one click (or two, depending on your IDE).
  2. Each testcase is run on different process, so you don’t need to clear global variables between testcases.
  3. doubles and vector<double>s in return values are compared according to TopCoder’s rule.
  4. The result of each testcase is one of the following:
    • Accepted: return value matches the expected value.
    • Wrong Answer: return value doesn’t match the expected value.
    • Time Limit Exceeded: solution runs longer than the time limit (2 seconds).
    • Runtime Error: solution crashes.
  5. All testcases are guaranteed to be run, even when your program crashes in some testcases.
  6. After all testcases are completed, you can view the points if you submit you program.

Screenshot

Of course this is not a screenshot of any SRMs; this is only a sample output you will get when using TesterDream.

Running example tests....

#0: Accepted
#1: Wrong Answer
                Expected: { "foo", "bar" }
                Received: { "bar", "foo" }
#2: Time Limit Exceeded
#3: Runtime Error

Submission is worth 247.25 points.

Download TesterDream

Currently TesterDream only supports Linux with GCC compiler. A version for Windows user is also available, but it lacks the “Time Limit Exceeded” feature. That is, TesterDream cannot stop you program when it run beyond the time limit.

The download archive contains TesterDream, FileEdit, CodeProcessor, and the installation instruction.

Template Tag

TesterDream uses $TESTCODE$ tag as the placeholder for the testing code. Place it at the bottom of your CodeProcessor template. Here is an example, using FileEdit.

struct $CLASSNAME$
{
    $RC$ $METHODNAME$($METHODPARMS$)
    {
    }
};

// BEGIN CUT HERE
$TESTCODE$
// END CUT HERE

This plugin is still in BETA version and may contains some bugs. Any comments, critics, or suggestions will be greatly appreciated!

  • Share/Bookmark

Enjoyed this article? Subscribe to our RSS feed for free!

3 Responses to “TesterDream: A New TopCoder Arena Plugin to Run Sample Testcases in Your IDE”

visitor says:
January 2, 2010 at 20:50


I haven’t looked into the source and I’m not entirely sure that I understand your plugin, but if you want to develop with this I wouldn’t add the killing the program after a TLE feature to it. It is just annoying; you can kill it by yourself. It just makes debugging or trying things out harder. It is enough to make it just different color (eg. red for more than 1900 ms) when displaying the required time. Maybe for testing just before submitting would be great, but then again moj can do that too.

[Reply]

fushar replies:


Thanks visitor, I will consider your thought.

[Reply]

Wilbert says:
January 4, 2010 at 23:01


Good Job Fus…
Pengen nyobain juga nih.. Ide nya keren,
pake AC, WA, TLE segala.. :D

[Reply]

Leave a Reply