{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/logicase-effective-test-case-generation-from","title":"LogiCase: Effective Test Case Generation from Logical Description in Competitive Programming","arxiv_id":"2505.15039","date":"2025-05-21","proceeding":null,"authors":["Sicheol Sung","Aditi","Dogyu kim","Yo-Sub Han","Sang-Ki Ko"],"abstract":"Automated Test Case Generation (ATCG) is crucial for evaluating software reliability, particularly in competitive programming where robust algorithm assessments depend on diverse and accurate test cases. However, existing ATCG methods often fail to meet complex specifications or generate effective corner cases, limiting their utility. In this work, we introduce Context-Free Grammars with Counters (CCFGs), a formalism that captures both syntactic and semantic structures in input specifications. Using a fine-tuned CodeT5 model, we translate natural language input specifications into CCFGs, enabling the systematic generation of high-quality test cases. Experiments on the CodeContests dataset demonstrate that CCFG-based test cases outperform baseline methods in identifying incorrect algorithms, achieving significant gains in validity and effectiveness. Our approach provides a scalable and reliable grammar-driven framework for enhancing automated competitive programming evaluations.","url_abs":"https://arxiv.org/abs/2505.15039v1","url_pdf":"https://arxiv.org/pdf/2505.15039v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[],"tasks":[],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"codet5","method_name":"CodeT5"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2505.15039","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.15039"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/Aditi1612/Grammar-based-test-case-generation","reach":null}],"summary":{"ran":3,"ran_draft_wrong":6,"ran_honours":2,"unverified":8},"by_repo_kind":{"found_in_text":{"samples":19,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":19,"samples":[{"code_sha256_prefix":"28cf845eed963801","entry":"Comparison","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"28cf845eed963801"}},{"code_sha256_prefix":"5c9d21851339dda0","entry":"Constraint","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"5c9d21851339dda0"}},{"code_sha256_prefix":"151e6de68310bba3","entry":"InvalidGrammarError","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"151e6de68310bba3"}},{"code_sha256_prefix":"11faa5c2b71ca449","entry":"_comparator_to_str","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"11faa5c2b71ca449"}},{"code_sha256_prefix":"64878c6e6559bfbd","entry":"_normalize_comparison","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"64878c6e6559bfbd"}},{"code_sha256_prefix":"e81c6113e28eaa97","entry":"_parse_comparands","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e81c6113e28eaa97"}},{"code_sha256_prefix":"a91035038012d48f","entry":"_parse_comparator","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a91035038012d48f"}},{"code_sha256_prefix":"4b2e246493f4b4d9","entry":"_split","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4b2e246493f4b4d9"}},{"code_sha256_prefix":"7c42701d0e35d0a9","entry":"_to_transitive_bound","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7c42701d0e35d0a9"}},{"code_sha256_prefix":"117c9e8b5e4ef49b","entry":"normalize_variable","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"117c9e8b5e4ef49b"}},{"code_sha256_prefix":"974eb395003a3911","entry":"parse_comparand","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"974eb395003a3911"}},{"code_sha256_prefix":"7a2093db64b50596","entry":"Comparator","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7a2093db64b50596"}},{"code_sha256_prefix":"efdedce16aee6681","entry":"CountingContextFreeGrammar","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"efdedce16aee6681"}},{"code_sha256_prefix":"9e38841c5db26e61","entry":"InvalidConstraintError","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9e38841c5db26e61"}},{"code_sha256_prefix":"a5706e1f3b741877","entry":"InvalidProductionError","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a5706e1f3b741877"}},{"code_sha256_prefix":"ef73f3e6b207c8f6","entry":"SubscriptType","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ef73f3e6b207c8f6"}},{"code_sha256_prefix":"a726defcf0dea380","entry":"TokenType","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a726defcf0dea380"}},{"code_sha256_prefix":"9dbded1261c13d89","entry":"_update_constraints_and_comparisons","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9dbded1261c13d89"}},{"code_sha256_prefix":"7ecc2b0e46187127","entry":"parse","repo":"Aditi1612/Grammar-based-test-case-generation","repo_kind":"found_in_text","path":"src/counting_context_free_grammar/counting_context_free_grammar.py","file_url":"https://github.com/Aditi1612/Grammar-based-test-case-generation/blob/HEAD/src/counting_context_free_grammar/counting_context_free_grammar.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7ecc2b0e46187127"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}