post

TesterDream: A TopCoder Arena Plugin

TesterDream is a TopCoder Arena plugin for testing your solution against example cases in external editor. It works in combination with FileEdit and CodeProcessor plugins.

It will extract the example cases and insert them in your source code. When you run your program, your solution will be automatically tested against them. When you submit your source code, the example cases will be automatically deleted. Your TopCoder SRM experience will become more convenient using this plugin.

This plugin currently only supports C++ language.

Features

  • Testcases are executed on different processes, so you don’t need to clear global variables between testcase runs.
  • doubles and vector<double>s in return values are compared according to TopCoder’s rule.
  • The result of each testcase can be one of the following:
    • Passed
    • Failed
    • Runtime Error
  • All testcases are guaranteed to be performed, even when your program crashes in some testcases (unless you kill the program).
  • You can add as many custom testcases as you like easily.
  • You can view the runtime of your solution for each testcase.
  • You can view the current score of your solution, i.e., the points you will receive if you immediately submit your solution.

Here is a sample screenshot of a running program.

Testing SomeProblem (250.0 points)

#0: Passed (0.00 secs)
#1: Failed (0.36 secs)
           Expected: { "foo", "bar" }
           Received: { "bar", "foo" }
#2: Runtime Error

Time  : 9 minutes 3 secs
Score : 227.76 points

Download

Download TesterDream 1.2.4.

Changelog

Version 1.2.4 (19th December 2012)

  • Still fixed long long[] bug.

Version 1.2.3 (20th January 2012)

  • Still fixed long long[] bug.

Version 1.2.2 (27th December 2011)

  • Fixed long long[] bug.

Version 1.2.1 (28th October 2011)

  • Fixed infinite loop in some operating systems.

Version 1.2 (9th September 2011)

  • Added custom testcase functionality.

Version 1.1 (26th January 2011)

  • Initial public release.

Installation

  1. Download and extract TesterDream plugin.
  2. Launch TopCoder Arena and login.
  3. Click Options -> Editor.
  4. Click Add.
  5. Type “FileEdit” in the Name box and “fileedit.EntryPoint” in the EntryPoint box.
  6. In the ClassPath box, browse the “FileEdit.jar” file in the directory you extracted the plugin.
  7. Click OK.
    TD_1
  8. Highlight FileEdit and then click Configure.
  9. Enter your directory to save the problem solutions (the .cpp files).
  10. Uncheck Backup existing file then overwrite.
  11. Click Code Template tab.
  12. Edit you C++ code template to match your needs. Insert this code at the bottom template. IMPORTANT: If you have another “BEGIN CUT HERE” at the top of your template, please delete it.
    // BEGIN CUT HERE
    $TESTCODE$
    // END CUT HERE

  13. Click Save and then Close.
  14. Click Add again.
  15. Type “CodeProcessor” in the Name box and “codeprocessor.EntryPoint” in the EntryPoint box.
  16. In the ClassPath box, browse “FileEdit.jar”, and then “CodeProcessor.jar”, and then “TesterDream.jar”.
  17. Click OK.
  18. Highlight CodeProcessor and click Configure.
  19. Type “fileedit.EntryPoint” in the Editor EntryPoint box, and “fushar.TesterDream” in the Processor Class box.
    TD_2
  20. Click Verify and make sure you don’t get any error messages. Then click OK.
    TD_3
  21. Select CodeProcessor as the default editor.
  22. Click Save and then Close.
  23. Make sure your default programming language is C++, if not, click Options -> Setup User Preferences, click Editors tab and select C++ in Default Language.
  24. Enjoy! Now, if you open a problem in SRM, a file with the same name as the problem name will be automatically created in your chosen directory. Write your solution in this file. To check against example cases, run the file. To submit, press Compile and then Submit in the Arena – no need to delete anything in your code.

Liked TesterDream? Share it to your friends!