{"id":"stress_groovy_01","dataset_type":"stress","language":"Groovy","task_category":"elem_func",
"prompt_en":"write a singleton DatabaseConnection class in Groovy with the builder pattern. It must have fields for url, timeout and encrypted, and have equals, hashCode and toString methods.",
"prompt_nl":"Schrijf een singleton DatabaseConnection klasse in Groovy met het builder patroon. Deze moet velden hebben voor url, timeout en encrypted, en beschikken over equals, hashCode en toString methoden.",
"code_snippet_input":"",
"canonical_solution":"import groovy.transform.Canonical\nimport groovy.transform.builder.Builder\n\n@Singleton(lazy = true)\n@Canonical\n@Builder\nclass DatabaseConnection {\n String url\n Integer timeout\n Boolean encrypted\n}",
"unit_test_setup":"import groovy.lang.GroovyClassLoader\n\ndef evalCode(String llmOutput) {\n GroovyClassLoader loader = new GroovyClassLoader()\n try {\n Class clazz = loader.parseClass(llmOutput)\n return clazz\n } catch (Exception e) {\n return \"Compilation Error: ${e.message}\"\n }\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String && result.contains(\"Error\")) return result\n Class clazz = (Class) result\n\n def hasSingleton = clazz.methods.any { it.name == 'getInstance' }\n def hasCanonical = clazz.methods.any { it.name == 'canEqual' }\n def hasBuilder = clazz.declaredClasses.any { it.simpleName.contains('Builder') }\n\n assert hasSingleton : \"failed to use @Singleton\"\n assert hasCanonical : \"failed to use @Canonical or @EqualsAndHashCode\"\n assert hasBuilder : \"failed to use @Builder\"\n\n return \"PASS\"\n}",
"comment":"Groovy automatically handles the boilerplate code for a singleton and builder architecture by using the @Singleton and @Builder annotations. The @Canonical annotation is used to generate the equals, hashCode, and toString methods based on the fields of the class. The solution MUST use @Singleton, @Builder and @Canonical annotations, instead of writing the boilerplate code manually, and MUST have AT LEAST the fields url, timeout and encrypted."
}
{"id":"stress_groovy_02","dataset_type":"stress","language":"Groovy","task_category":"id_bug",
"prompt_en":"I dont know why the second test case fails since they are different objects. fix the bug.",
"prompt_nl":"Ik weet niet waarom de tweede testcase mislukt, aangezien het verschillende objecten zijn. Los de bug op.",
"code_snippet_input":"@groovy.transform.EqualsAndHashCode\nclass Cell{\n private int x;\n private int y;\n Cell(x,y){\n this.x = x;\n this.y = y;\n } \n}\n\ndef liveCells = [] as Set\n\nCell cell = new Cell(0,0);\nCell diffCell = new Cell(1,1);\n\nliveCells.add(cell)\nassert liveCells.contains(cell) == true\nassert liveCells.contains(diffCell) == false",
"canonical_solution":"@groovy.transform.EqualsAndHashCode\nclass Cell{\n int x;\n int y;\n \n}\n\ndef liveCells = [] as Set\n\nCell cell = new Cell(0,0);\nCell diffCell = new Cell(1,1);\n\nliveCells.add(cell)\nassert liveCells.contains(cell) == true\nassert liveCells.contains(diffCell) == false",
"unit_test_setup":"import groovy.lang.GroovyClassLoader\n\ndef evalCode(String llmOutput) {\n def loader = new GroovyClassLoader()\n try {\n Class clazz = loader.parseClass(llmOutput)\n return clazz\n } catch (Exception e) {\n return \"Compilation Error: \" + e.message\n }\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String) return result\n Class clazz = (Class) result\n def c1, c2\n try {\n c1 = clazz.newInstance(0, 0)\n c2 = clazz.newInstance(1, 1)\n } catch (e) {\n c1 = clazz.newInstance(x: 0, y: 0)\n c2 = clazz.newInstance(x: 1, y: 1)\n }\n\n assert c1.hashCode() != c2.hashCode() : \"bug still exists, HashCodes are identical\"\n assert !c1.equals(c2) : \"bug still exists, objects are considered equal\"\n def hasAnnotation = clazz.annotations.any { it.annotationType().name.contains(\"EqualsAndHashCode\") }\n def hasGeneratedMethods = clazz.methods.any { it.name == 'canEqual' }\n assert hasGeneratedMethods : \"did not use Groovy's EqualsAndHashCode transformation\"\n\n return \"PASS\"\n}",
"comment":"In groovy @EqualsAndHashCode does not take into account private fields, so two objects with the same properties (none) but different private fields will have the same hashcode and be considered equal. The solution MUST remove the private fields OR use EqualsAndHashCode(includeFields=true) to include private fields in the equality check."
}
{"id":"stress_groovy_03","dataset_type":"stress","language":"Groovy","task_category":"syntax recall",
"prompt_en":"write this logmessage so that the status dynamically updates in the log output at the time it is printed, without reassigning the logmessage variable.",
"prompt_nl":"Schrijf dit logmessage zodat de status dynamisch wordt bijgewerkt in de loguitvoer.",
"code_snippet_input":"class Logger {\n String status = 'initialized'\n def logMessage = \n}",
"canonical_solution":"class Logger {\n String status = 'initialized'\n def logMessage = \"${-> status}\"\n}",
"unit_test_setup":"import groovy.lang.GroovyClassLoader\ndef evalCode(String llmOutput) {\n def loader = new GroovyClassLoader()\n try {\n Class clazz = loader.parseClass(llmOutput)\n return [clazz: clazz, source: llmOutput]\n } catch (Exception e) {\n return \"Compilation Error: ${e.message}\"\n }\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String && result.contains(\"Error\")) return result\n def clazz = result.clazz\n def source = result.source\n def instance = clazz.newInstance()\n instance.status = \"alpha\"\n def firstVal = instance.logMessage.toString()\n instance.status = \"omega\"\n def secondVal = instance.logMessage.toString()\n assert firstVal != secondVal : \"string did not update\"\n\n def usedLazySyntax = source =~ /[\\$]\\{ *->/\n assert usedLazySyntax : \"logic works, but didn't use the \\${-> } lazy syntax\"\n return \"PASS\"\n}",
"comment":"In groovy, using Gstirng lazy evaluation syntax ${-> var} allows the string to print the current value of the variable at the time of evaluation, instead of at the time of the string's creation. The solution MUST use the ${-> var} syntax to ensure the log message updates dynamically with the current status."
}
{"id":"stress_vuejs_01","dataset_type":"stress","language":"VueJS","task_category":"UI_comps",
"prompt_en":"Write a VueJS component for a header of a webpage that contains the name \"Christina's Bakery\", a dropdown manu with items \"Home\", \"Recipes\" and \"Contact\", and a search bar.",
"prompt_nl":"Schrijf een VueJS-component voor een koptekst van een webpagina met de naam \"Christina's Bakery\", een vervolgkeuzemenu met de items \"Home\", \"Recepten\" en \"Contact\" en een zoekbalk.",
"code_snippet_input":"",
"canonical_solution":"\n \n
\n
Christina's Bakery
\n
\n\n \n \n\n\n\n",
"unit_test_setup":"def evalCode(String llmOutput) {\n if (llmOutput == null || llmOutput.trim().isEmpty()) {\n return \"empty solution\"\n }\n return [source:llmOutput]\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String && result.contains(\"Error\")) return result\n def source = result.source\n def requirements = [\n [/(?i) block\"],\n [/(?i)Christina[''’]s\\s+Bakery/, \"Brand name 'Christina's Bakery' not found\"],\n [/(?i)Home/, \"Menu item 'Home' not found\"],\n [/(?i)Recipes/, \"Menu item 'Recipes' not found\"],\n [/(?i)Contact/, \"Menu item 'Contact' not found\"],\n [/(?i)\n assert source =~ pattern : failureMsg\n }\n return \"PASS\"\n}",
"comment":"The solution MUST include a block with the brand name 'Christina's Bakery', a dropdown menu with the items 'Home', 'Recipes', and 'Contact', and a search bar input that is reactively bound using v-model. The dropdown menu MUST also include logic for showing/hiding the menu items using v-if or v-show, and be triggered by a click event. testing is performe din groovy"
}
{"id":"stress_vuejs_02","dataset_type":"stress","language":"VueJS","task_category":"syntax_recall",
"prompt_en":"I want to dynamically set the backgroundColor of the status-indicator div based on the value \"statusColor\", that will be green when available, and red when on loan.",
"prompt_nl":"Ik wishow me tl de backgroundColor van de status-indicator div dynamisch instellen op basis van de waarde \"statusColor\", die groen is wanneer beschikbaar en rood wanneer uitgeleend.",
"code_snippet_input":"\n
\n \n {{ bookTitle }} — {{ status }}\n \n\n \n
\n\n",
"canonical_solution":"\n
\n \n {{ bookTitle }} — {{ status }}\n \n\n \n
\n\n\n\n\n",
"unit_test_setup":"def evalCode(String llmOutput) {\n if (llmOutput == null || llmOutput.trim().isEmpty()) {\n return \"empty solution\"\n }\n return [source:llmOutput]\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String && result.contains(\"Error\")) return result\n def source = result.source\n\n def hasBinding = source =~ /(?i)(:style|v-bind:style)[ ]*=[ ]*['\"]/\n\n def referencesVar = source =~ /(?i)(:style|v-bind:style)[ ]*=[ ]*['\\\"][^'\\\"]*statusColor[^'\\\"]*['\\\"]/\n\n assert hasBinding : \"The model failed to use the :style or v-bind:style directive.\"\n assert referencesVar : \"The style binding exists, but it does not correctly reference the 'statusColor' variable.\"\n\n assert source =~ /(?i)
]*class=['\\\"]status-indicator['\\\"]/ : \"The status-indicator div was modified incorrectly or removed.\"\n \n return \"PASS\"\n}",
"comment":"the solution MUST use the :style or v-bind:style directive to bind the backgroundColor to statusColor. the solution does not need to include the logic for determining the value of statusColor, but it must correctly reference it in the style binding."
}
{"id":"stress_vuejs_03","dataset_type":"stress","language":"VueJS","task_category":"migrating",
"prompt_en":"Migrate this component to Vue 3 composition API syntax. Don't change anything else.",
"prompt_nl":"Migreer deze component naar de syntaxis van de Vue 3 composition API. Verander verder niets.",
"code_snippet_input":"\n
\n \n
{{ companyName }}
\n
{{ welcomeMessage }}
\n \n\n \n Featured Projects: {{ projectCount }}\n | \n Your Favorites: {{ favoriteCount }}\n \n\n
\n \n \n
\n
\n\n\n\n\n",
"canonical_solution":"\n
\n \n
{{ companyName }}
\n
{{ welcomeMessage }}
\n \n\n \n Featured Projects: {{ projectCount }}\n | \n Your Favorites: {{ favoriteCount }}\n \n\n
\n \n \n
\n
\n\n\n\n",
"unit_test_setup":"def evalCode(String llmOutput) {\n if (llmOutput == null || llmOutput.trim().isEmpty()) {\n return \"empty solution\"\n }\n return [source:llmOutput]\n}",
"unit_test_assertion":"def testSolution(Object result) {\n if (result instanceof String && result.contains(\"Error\")) return result\n def source = result.source\n\n def usesReactivity = (source =~ /\\.value/) || (source =~ /reactive\\(/)\n assert usesReactivity : \"The model did not implement Vue 3 reactivity correctly.\"\n\n def hasThisContext = source =~ /this\\.(favoriteCount|companyName|projectCount)/\n assert !hasThisContext : \"Migration failed: 'this' keyword found.\"\n\n assert source =~ /onMounted/ : \"Did not use onMounted hook\"\n\n return \"PASS\"\n}",
"comment":"the solution MUST use the