Testlib and Polygon Updates (June, 2015)

Revision en3, by fcspartakm, 2015-06-29 18:57:06

Hello, Codeforces!

A month ago, I joined the wonderful Codeforces team led by Mike Mirzayanov (MikeMirzayanov). Traditionally, to understand all the niceties of this project, my work begun from Polygon system. I would like to tell you about its changes.

To edit the files in Polygon now used Ace Editor. It has a nice looking syntax highlighting and autocompletion (you have to press Ctrl + Space). Soon planned to implement this editor in Codeforces.

Unfortunately, Ace Editor not support scrolling text on the smartphones and the tablets. Because of that on them left the old text editor.

On the validator, checker and interactor pages appeared button View Source. When you press this button you can see the source code file. It is convenient because now you can see the source code of standart checkers.

In Testlib library useful changes have been made too, which also work in Polygon. Now you can specify in validator different restrictions for different testsets and for different test groups. To register validator you need to use registerValidation(argc, argv);, and methods validator.group() and validator.testset() appeared in validator.

To check test by validator from command line using testset and group you need to write command val.exe --testset "testsetName" --group "groupName" < testFile.

This changes useful, for example, for preparing school problems where allocated different test groups. Also this changes will allow to use in Codeforces round multitestsets, prohibiting use such tests in hacking attempts.

It becomes easier to check cover of different cases by tests. It is supporting in Polygon in tab Invocation.

If in validator you indicated variable name (this function ignores variable which contains digits in their names), then if you have no tests, in which this variable reaches minimal or maximal values, after perform Invocation, you wil get warning about it.

Кроме того в testlib/Polygon появилась дополнительная функциональность, которую мы назвали features. Зачастую (обычно координатору подготовки задач) требуется удостовериться, что тесты покрывают тот или иной случай (паттерны). Например, в задаче на графы, вероятно, надо быть уверенным, что есть тесты с несвязными графами и большими деревьями. Для того, чтобы гарантировать это теперь достаточно добавить в валидатор в начале декларацию поддержки двух фич addFeature("unconnected"); и addFeature("big-tree");. В основной части валидатора, после считывания графа можно проверить правда ли он несвязный, и если несвязный, то зафиксировать этот факт вызовом feature("unconnected");. Аналогично с деревом: если граф — большое дерево, то вызвать feature("big-tree");.

When you startup invocation Polygon will alert you, if there is declarated feature, which did not met in tests. In out examples it will say, that tests does not contains disconnected graph and big trees.

Introduction the Features will be useful for a person, who check ready problem or ready contest. But we think that also it will be very helpful for problem writers.

Validator output information about achieving extreme variable values and about features, if you add to call validator in command line parameter --testOverviewLogFileName log.txt. Polygon reads and parses exactly this logs to show warnings for you.

Soon you will get new and new improvements! I wish to all good summer mood!

Tags codeforces, polygon, testlib, полигон

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en12 English fcspartakm 2015-06-30 14:23:45 30
ru32 Russian fcspartakm 2015-06-30 14:23:31 0 (опубликовано)
ru31 Russian fcspartakm 2015-06-30 14:23:12 30 (сохранено в черновиках)
ru30 Russian fcspartakm 2015-06-30 12:52:14 15 Мелкая правка: 'orces.\n\n![ ](h' -br/
en11 English fcspartakm 2015-06-30 12:51:57 228 Tiny change: '.\n\n[cut]\n\n![ ](h' -br/
ru29 Russian fcspartakm 2015-06-30 12:47:13 284
ru28 Russian fcspartakm 2015-06-30 12:42:33 0 (опубликовано)
en10 English fcspartakm 2015-06-30 12:42:21 77
ru27 Russian fcspartakm 2015-06-30 12:37:26 45
en9 English fcspartakm 2015-06-30 12:36:50 139
en8 English fcspartakm 2015-06-30 12:32:04 153
ru26 Russian fcspartakm 2015-06-30 12:17:58 131
en7 English fcspartakm 2015-06-29 19:28:58 61
en6 English fcspartakm 2015-06-29 19:28:15 10 Tiny change: 'om/4cbe16/тетстстс.png)\n\nI' -
ru25 Russian fcspartakm 2015-06-29 19:26:07 62
en5 English fcspartakm 2015-06-29 19:25:19 65
ru24 Russian fcspartakm 2015-06-29 19:24:58 71
en4 English fcspartakm 2015-06-29 19:23:53 1089
en3 English fcspartakm 2015-06-29 18:57:06 2096
en2 English fcspartakm 2015-06-29 17:46:39 451
en1 English fcspartakm 2015-06-29 17:35:14 4050 Initial revision for English translation
ru23 Russian fcspartakm 2015-06-29 15:28:43 263
ru22 Russian fcspartakm 2015-06-29 15:26:44 168
ru21 Russian fcspartakm 2015-06-29 15:25:59 167
ru20 Russian fcspartakm 2015-06-29 15:25:14 890
ru19 Russian fcspartakm 2015-06-29 15:16:29 39
ru18 Russian fcspartakm 2015-06-29 15:15:48 80
ru17 Russian fcspartakm 2015-06-29 15:14:52 58
ru16 Russian fcspartakm 2015-06-29 15:11:18 16
ru15 Russian fcspartakm 2015-06-29 15:10:48 6 Мелкая правка: 'нию, [Ace Redactor](http:' -> 'нию, [Ace Editor](http:'
ru14 Russian fcspartakm 2015-06-29 15:09:54 48
ru13 Russian fcspartakm 2015-06-29 14:44:32 1 Мелкая правка: 'estsetName --group "' -> 'estsetName" --group "'
ru12 Russian fcspartakm 2015-06-29 14:18:44 8 Мелкая правка: ' хорошего настроения' -> ' хорошего летнегнастроения'
ru11 Russian fcspartakm 2015-06-29 14:17:58 2 Мелкая правка: 'upName" ----testOver' -> 'upName" --testOver'
ru10 Russian fcspartakm 2015-06-29 14:17:38 187
ru9 Russian fcspartakm 2015-06-29 14:01:49 543
ru8 Russian fcspartakm 2015-06-29 13:56:37 2 Мелкая правка: 'мального и максимал' -> 'мального или максимал'
ru7 Russian fcspartakm 2015-06-29 13:56:16 14 Мелкая правка: 'титестсеты, чтобы избежать проблем с' -> 'титестсеты без проблем с'
ru6 Russian fcspartakm 2015-06-29 13:55:15 84
ru5 Russian fcspartakm 2015-06-29 13:53:07 986 Мелкая правка: 'человека. Например, ' -
ru4 Russian fcspartakm 2015-06-29 13:38:02 100 Мелкая правка: '`.\n\n\n\n' -
ru3 Russian fcspartakm 2015-06-29 13:37:09 322 Мелкая правка: 'et()`.\n\n![ ](http://mirror.codeforces.com/492b87/validator.png)\n\n' -> 'et()`.\n\n\n\n'
ru2 Russian fcspartakm 2015-06-29 13:20:48 550 Мелкая правка: 'та.\n\n2. ' -
ru1 Russian fcspartakm 2015-06-29 13:15:15 341 Первая редакция (сохранено в черновиках)