Code Monkey home page Code Monkey logo

Comments (11)

MuhammadSawalhy avatar MuhammadSawalhy commented on August 28, 2024 1

it is almost impossible to generate all the answers in the testing function since the number might be very large.

Agree. And the only way (I think) to test this problem is to write code that will test your output according to the input which is similar to stress-testing and testing interactive problems.

We need an interactor which will do the following:

  1. generate random test cases
  2. receive the output of the solution
  3. validate the output according to the input

from competitest.nvim.

xeluxee avatar xeluxee commented on August 28, 2024

Assign a function to output_compare_method (see configuration for further details).
In this case it's likely you want to use local configuration

from competitest.nvim.

TroySigX avatar TroySigX commented on August 28, 2024

Not really. For example, a problem asks to print out the shortest path from to node to another. Since there might be more than one path that are shortest, the sample output only prints one of them. Can Competitest check this multiple answer-problem in this case?

from competitest.nvim.

xeluxee avatar xeluxee commented on August 28, 2024

What if output_compare_method accepted three arguments: output, expected output and input?
So you could write a function to check the correctness of your solution.

from competitest.nvim.

TroySigX avatar TroySigX commented on August 28, 2024

What I think is that programmers using the plugins usually compete in online contest like Codeforces, where it is not convenient to write the output checking function since the contest is very time-sensitive. Is there any solution?

from competitest.nvim.

TroySigX avatar TroySigX commented on August 28, 2024

One possible solution I can think of is to create a server for programmers to "not actually" submit to check their output (like creating a dummy user on Codeforces and let coders submit through that user, but the plugin should only check for the sample test cases, not the hidden test cases on Codeforces). This is easier to utilize the output checking function that has been written before by testers.

from competitest.nvim.

xeluxee avatar xeluxee commented on August 28, 2024

I could add a way to store more than one answer in a testcase, so that a testcase is correct when output matches one of the provided expected outputs.
This can be already done with a workaround

  1. Put a special character like | between possible answers when writing expected output
  2. In output_compare_method split expected_output into a list, using the special character as separator
  3. Check if output belongs to the list

One possible solution I can think of is to create a server for programmers to "not actually" submit to check their output (like creating a dummy user on Codeforces and let coders submit through that user, but the plugin should only check for the sample test cases, not the hidden test cases on Codeforces).

This is unlikely, and probably dummy users aren't allowed on many competitive programming platforms.

This is easier to utilize the output checking function that has been written before by testers.

A better way would be to use a checker function provided by testers, though I don't know if they're available during a contest.

from competitest.nvim.

TroySigX avatar TroySigX commented on August 28, 2024

I think it's nearly impossible to generate all answers to put into the checker during contest.

from competitest.nvim.

MuhammadSawalhy avatar MuhammadSawalhy commented on August 28, 2024

like creating a dummy user on Codeforces and let coders submit through that user

Some platforms do this such as vjudge but this won't work in running contests because your submitted code will be first submitted by this dummy user and if you submitted it again you will be marked as a cheater.

I don't think we can implement this feature in the way you want (automated). A manual test code should be written. I also believe that this feature is related to interactive problems and stress testing. We can try to implement 3 features with the same effort. @xeluxee what do you think?

from competitest.nvim.

MuhammadSawalhy avatar MuhammadSawalhy commented on August 28, 2024

This is the current script I use to test interactive problems. I also noticed that I can use it to stress-test problems and make it a more generalized script abandoning the other bash script I used to use for stress testing.

from competitest.nvim.

TroySigX avatar TroySigX commented on August 28, 2024

Testing interactive problems is also a feature to be added. But what I meant was that in problems where more than 1 answers are valid (e.g That might be multiple path from source to sink with the shortest length), it is almost impossible to generate all the answers in the testing function since the number might be very large.

from competitest.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.