| {"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":"<template>\n <header class=\"navbar\">\n <div class=\"brand\">\n <h1>Christina's Bakery</h1>\n </div>\n\n <nav class=\"nav-container\">\n <div class=\"dropdown\" @mouseleave=\"isMenuOpen = false\">\n <button \n class=\"dropdown-trigger\" \n @click=\"toggleMenu\"\n aria-haspopup=\"true\" \n :aria-expanded=\"isMenuOpen\"\n >\n Menu ▾\n </button>\n\n <transition name=\"fade\">\n <ul v-if=\"isMenuOpen\" class=\"dropdown-menu\">\n <li><a href=\"#home\">Home</a></li>\n <li><a href=\"#recipes\">Recipes</a></li>\n <li><a href=\"#contact\">Contact</a></li>\n </ul>\n </transition>\n </div>\n\n <div class=\"search-box\">\n <input \n type=\"text\" \n v-model=\"searchQuery\" \n placeholder=\"Search treats...\" \n @keyup.enter=\"handleSearch\"\n />\n <button @click=\"handleSearch\">Search</button>\n </div>\n </nav>\n </header>\n</template>\n\n<script setup>\nimport { ref } from 'vue'\nconst isMenuOpen = ref(false)\nconst toggleMenu = () => {\n isMenuOpen.value = !isMenuOpen.value\n}\n\nconst searchQuery = ref('')\nconst handleSearch = () => {\n if (searchQuery.value.trim()) {\n console.log(`Searching for: ${searchQuery.value}`)\n }\n}\n</script>\n<style scoped>\n.navbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem 2rem;\n background-color: #fff5f8;\n border-bottom: 2px solid #f2d1d1;\n font-family: 'Playfair Display', serif;\n}\n.brand h1 {\n margin: 0;\n color: #8b5e3c;\n font-size: 1.5rem;\n}\n\n.nav-container {\n display: flex;\n gap: 20px;\n align-items: center;\n}\n.dropdown {\n position: relative;\n}\n.dropdown-trigger {\n background: #8b5e3c;\n color: white;\n border: none;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n}\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n background: white;\n list-style: none;\n padding: 10px 0;\n margin: 5px 0 0;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n border-radius: 4px;\n min-width: 120px;\n z-index: 10;\n}\n\n.dropdown-menu li a {\n display: block;\n padding: 8px 16px;\n text-decoration: none;\n color: #333;\n}\n\n.dropdown-menu li a:hover {\n background-color: #f2d1d1;\n}\n\n.search-box input {\n padding: 6px 10px;\n border: 1px solid #ccc;\n border-radius: 4px 0 0 4px;\n outline: none;\n}\n\n.search-box button {\n padding: 6px 12px;\n background: #8b5e3c;\n color: white;\n border: none;\n border-radius: 0 4px 4px 0;\n cursor: pointer;\n}\n.fade-enter-active, .fade-leave-active {\n transition: opacity 0.2s;\n}\n.fade-enter-from, .fade-leave-to {\n opacity: 0;\n}\n</style>", | |
| "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)<template/, \"Missing <template> 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)<input.*(type=['\\\"'](text|search)['\\\"']|v-model)/, \"Search bar input not found\"],\n [/(?i)(v-if|v-show|v-for|@click)/, \"Dropdown logic (directives) not found\"],\n [/(?i)v-model/, \"Search bar is not reactively bound\"]\n ]\n requirements.each { pattern, failureMsg ->\n assert source =~ pattern : failureMsg\n }\n return \"PASS\"\n}", | |
| "comment":"The solution MUST include a <template> 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":"<template>\n <div class=\"library-item\">\n <span class=\"book-info\">\n <strong>{{ bookTitle }}</strong> — {{ status }}\n </span>\n\n <div class=\"status-indicator\"></div>\n </div>\n</template>\n", | |
| "canonical_solution":"<template>\n <div class=\"library-item\">\n <span class=\"book-info\">\n <strong>{{ bookTitle }}</strong> — {{ status }}\n </span>\n\n <div \n class=\"status-indicator\" \n :style=\"{ backgroundColor: statusColor }\"\n ></div>\n </div>\n</template>\n\n<script setup>\nimport { computed } from 'vue'\nconst props = defineProps({\n bookTitle: String,\n status: String\n})\n\nconst statusColor = computed(() => {\n switch (props.status) {\n case 'Available': return '#2ecc71'\n case 'On Loan': return '#e74c3c'\n }\n})\n</script>\n\n<style scoped>\n.library-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 10px;\n border-bottom: 1px solid #eee;\n}\n\n.status-indicator {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n border: 1px solid rgba(0,0,0,0.1);\n}\n</style>", | |
| "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)<div[^>]*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":"<template>\n <div class=\"felipe-productions\">\n <header>\n <h1>{{ companyName }}</h1>\n <p>{{ welcomeMessage }}</p>\n </header>\n\n <section class=\"portfolio-stats\">\n <span>Featured Projects: {{ projectCount }}</span>\n <span> | </span>\n <span>Your Favorites: {{ favoriteCount }}</span>\n </section>\n\n <div class=\"actions\">\n <button @click=\"addFavorite\">❤ Add to Favorites</button>\n <button @click=\"resetFavorites\">Reset</button>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n data() {\n return {\n companyName: 'Felipe Productions',\n projectCount: 12,\n favoriteCount: 0\n };\n },\n computed: {\n welcomeMessage() {\n if (this.favoriteCount > 5) {\n return \"You're a true fan of our work!\";\n }\n return \"Innovative Media & Visual Storytelling\";\n }\n },\n\n methods: {\n addFavorite() {\n this.favoriteCount++;\n },\n resetFavorites() {\n this.favoriteCount = 0;\n }\n },\n mounted() {\n console.log(`${this.companyName} component has loaded successfully.`);\n }\n};\n</script>\n\n<style scoped>\n.felipe-productions {\n font-family: 'Helvetica', sans-serif;\n text-align: center;\n padding: 2rem;\n background-color: #1a1a1a;\n color: #ffffff;\n border-radius: 12px;\n}\nh1 {\n color: #ff3e00;\n margin-bottom: 0.5rem;\n}\n.portfolio-stats {\n margin: 1.5rem 0;\n font-weight: bold;\n}\nbutton {\n background: #ff3e00;\n color: white;\n border: none;\n padding: 10px 20px;\n margin: 0 5px;\n cursor: pointer;\n border-radius: 4px;\n}\nbutton:hover {\n background: #e63500;\n}\n</style>", | |
| "canonical_solution":"<template>\n <div class=\"felipe-productions\">\n <header>\n <h1>{{ companyName }}</h1>\n <p>{{ welcomeMessage }}</p>\n </header>\n\n <section class=\"portfolio-stats\">\n <span>Featured Projects: {{ projectCount }}</span>\n <span> | </span>\n <span>Your Favorites: {{ favoriteCount }}</span>\n </section>\n\n <div class=\"actions\">\n <button @click=\"addFavorite\">❤ Add to Favorites</button>\n <button @click=\"resetFavorites\">Reset</button>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, computed, onMounted } from 'vue'\nconst companyName = ref('Felipe Productions')\nconst projectCount = ref(12)\nconst favoriteCount = ref(0)\n\nconst welcomeMessage = computed(() => {\n if (favoriteCount.value > 5) {\n return \"You're a true fan of our work!\"\n }\n return \"Innovative Media & Visual Storytelling\"\n})\n\nconst addFavorite = () => {\n favoriteCount.value++\n}\n\nconst resetFavorites = () => {\n favoriteCount.value = 0\n}\n\nonMounted(() => {\n console.log(`${companyName.value} component has loaded successfully.`)\n})\n</script>\n\n<style scoped>\n.felipe-productions {\n font-family: 'Helvetica', sans-serif;\n text-align: center;\n padding: 2rem;\n background-color: #1a1a1a;\n color: #ffffff;\n border-radius: 12px;\n}\nh1 {\n color: #ff3e00;\n margin-bottom: 0.5rem;\n}\n.portfolio-stats {\n margin: 1.5rem 0;\n font-weight: bold;\n}\nbutton {\n background: #ff3e00;\n color: white;\n border: none;\n padding: 10px 20px;\n margin: 0 5px;\n cursor: pointer;\n border-radius: 4px;\n}\nbutton:hover {\n background: #e63500;\n}\n</style>", | |
| "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 <script setup> syntax, import 'ref' and 'computed' from 'vue', and correctly use .value for reactive references. The mounted() lifecycle hook should be replaced with onMounted(). The solution should not use the 'this' keyword, as it is not used in the Composition API." | |
| } | |
| {"id":"stress_dataweave_01","dataset_type":"stress","language":"DataWeave","task_category":"queries", | |
| "prompt_en":"Write a function in DataWeave that calculates and returns the GPA of each student.", | |
| "prompt_nl":"Schrijf een functie in DataWeave die het GPA van elke student berekent en weergeeft.", | |
| "code_snippet_input":"[\n {\n \"student_id\": \"STU001\",\n \"name\": \"Laura Morales\",\n \"grades\": {\n \"Mathematical Modelling\": 9,\n \"Human Computer Interaction\": 8,\n \"Natural Language Processing\": 10\n }\n },\n {\n \"student_id\": \"STU002\",\n \"name\": \"Felipe Janssen\",\n \"grades\": {\n \"Mathematical Modelling\": 7,\n \"Human Computer Interaction\": 9,\n \"Natural Language Processing\": 6\n }\n },\n {\n \"student_id\": \"STU003\",\n \"name\": \"Sam Stutterheim\",\n \"grades\": {\n \"Mathematical Modelling\": 10,\n \"Human Computer Interaction\": 9,\n \"Natural Language Processing\": 8\n }\n },\n {\n \"student_id\": \"STU004\",\n \"name\": \"Jesse Visser\",\n \"grades\": {\n \"Mathematical Modelling\": 5,\n \"Human Computer Interaction\": 7,\n \"Natural Language Processing\": 8\n }\n },\n {\n \"student_id\": \"STU005\",\n \"name\": \"Alejandra Garcia\",\n \"grades\": {\n \"Mathematical Modelling\": 9,\n \"Human Computer Interaction\": 10,\n \"Natural Language Processing\": 9\n }\n },\n {\n \"student_id\": \"STU006\",\n \"name\": \"Carolina Giannini\",\n \"grades\": {\n \"Mathematical Modelling\": 10,\n \"Human Computer Interaction\": 10,\n \"Natural Language Processing\": 9\n }\n },\n {\n \"student_id\": \"STU007\",\n \"name\": \"Maria Baro\",\n \"grades\": {\n \"Mathematical Modelling\": 8,\n \"Human Computer Interaction\": 7,\n \"Natural Language Processing\": 9\n }\n },\n {\n \"student_id\": \"STU008\",\n \"name\": \"Michelle Lu\",\n \"grades\": {\n \"Mathematical Modelling\": 6,\n \"Human Computer Interaction\": 8,\n \"Natural Language Processing\": 7\n }\n },\n {\n \"student_id\": \"STU009\",\n \"name\": \"Isis Marshall\",\n \"grades\": {\n \"Mathematical Modelling\": 9,\n \"Human Computer Interaction\": 10,\n \"Natural Language Processing\": 9\n }\n },\n {\n \"student_id\": \"STU010\",\n \"name\": \"Jimena Narvaez\",\n \"grades\": {\n \"Mathematical Modelling\": 7,\n \"Human Computer Interaction\": 6,\n \"Natural Language Processing\": 8\n }\n }\n]", | |
| "canonical_solution":"%dw 2.0\noutput application/json\n\nfun calculateGPA(grades: Object) = do {\n var gradeList = valuesOf(grades)\n ---\n avg(gradeList) as String {format: \"0.00\"} as Number\n}\n---\npayload map (student) -> {\n \"id\": student.student_id,\n \"name\": student.name,\n \"total_subjects\": sizeOf(student.grades),\n \"gpa\": calculateGPA(student.grades),\n \"status\": if (calculateGPA(student.grades) >= 6.0) \"Pass\" else \"Fail\"\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 assert source =~ /%dw 2\\.0/ : \"Missing %dw 2.0 directive.\"\n\n def extractsValues = (source =~ /valuesOf\\(/) || (source =~ /pluck/)\n assert extractsValues : \"The solution must extract values from the grades object using valuesOf() or pluck.\"\n\n def calculatesMean = (source =~ /avg\\(/) || (source =~ /sum\\(.*\\)\\s*\/\\s*sizeOf/)\n assert calculatesMean : \"The solution must calculate the mean using avg() or manual division.\"\n assert source =~ /(?i)gpa/ : \"The output must contain a 'gpa' field.\"\n return \"PASS\"\n}", | |
| "comment":"the solution MUST extract the values from the grades object using valuesOf() or pluck, calculate the mean using avg() or by manually summing and dividing by the number of subjects, and contain a 'gpa' (case insensitive) field with the calculated GPA for each student." | |
| } | |
| {"id":"stress_dataweave_02","dataset_type":"stress","language":"DataWeave","task_category":"fix_bug", | |
| "prompt_en":"I want to pass the item variable dynamically to the getSFDCId function, but it doesn't work. fix the bug.", | |
| "prompt_nl":"Ik wil de variable item dynamisch doorgeven aan de functie getSFDCId, maar dat lukt niet. Los het probleem op.", | |
| "code_snippet_input":"/*\n{\n \"OrderId\": \"TST-test-123212-01\",\n}\n*/\n%dw 2.0\noutput application/json\nvar lis = {\n \"TST-test-123212-01\": \"a2F2h000000pMl8EAE\",\n \"TST-test-123212-02\": \"a2F2h000000q6qHEAQ\"\n}\nfun getSFDCId (item) = lis.item\n---\n{\n OrderId__c: getSFDCId(payload.OrderId)\n}", | |
| "canonical_solution":"%dw 2.0\noutput application/json\nvar lis = {\n \"TST-test-123212-01\": \"a2F2h000000pMl8EAE\",\n \"TST-test-123212-02\": \"a2F2h000000q6qHEAQ\"\n}\nfun getSFDCId (item) = lis[item]\n---\n{\n OrderId__c: getSFDCId(payload.OrderId)\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 hasBuggyNotation = source =~ /lis\\.item/\n assert !hasBuggyNotation : \"kept the buggy 'lis.item' notation.\"\n\n def hasDynamicAccess = source =~ /lis\\s*\\[\\s*item\\s*\\]/\n assert hasDynamicAccess : \"The model failed to use bracket notation 'lis[item]' for dynamic access.\"\n assert source =~ /%dw 2\\.0/ : \"The script is missing the %dw 2.0 header.\"\n assert source =~ /---/ : \"The script is missing the body separator (---).\"\n return \"PASS\"\n}", | |
| "comment":"the bug is in lis.item, which looks for an 'item' key in the list, instead of searching for the value in the item variable. The solution MUST use bracket notation lis[item] to access the value dynamically based on the item variable" | |
| } | |
| {"id":"stress_dataweave_03","dataset_type":"stress","language":"DataWeave","task_category":"syntax_recall", | |
| "prompt_en":"write a Dataweave function loanBook(book:Object)to change the entry passed as an input to available = false and last_loan_date to the current date, whithout reassigning every field.", | |
| "prompt_nl":"Schrijf een Dataweave function loanBook(book:Object) om de invoer die als input wordt doorgegeven te wijzigen in available = false en last_loan_date in de huidige datum, zonder elk veld opnieuw toe te wijzen.", | |
| "code_snippet_input":"/*title,author,available,last_loan_date\nThe Great Gatsby,F. Scott Fitzgerald,true,2025-11-12\n1984,George Orwell,false,2026-02-28\nTo Kill a Mockingbird,Harper Lee,true,2025-08-15\nThe Hobbit,J.R.R. Tolkien,true,2026-01-10\nBrave New World,Aldous Huxley,false,2026-03-01\nThe Catcher in the Rye,J.D. Salinger,true,2025-12-05\nThe Alchemist,Paulo Coelho,false,2026-02-20\nPride and Prejudice,Jane Austen,true,2025-07-22\nThe Road,Cormac McCarthy,true,2026-02-14\nDune,Frank Herbert,false,2026-03-03\n*/", | |
| "canonical_solution":"%dw 2.0\noutput application/json\nfun loanBook(book: Object) = book update {\n case .available -> false\n case .last_loan_date -> now() as String {format: \"yyyy-MM-dd\"}\n}\n---\npayload map (item) -> loanBook(item)", | |
| "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 usesUpdateOperator = source =~ /update\\s*\\{/\n assert usesUpdateOperator : \"The solution failed to use the 'update' operator.\"\n\n def hasCaseStatements = source =~ /case\\s+\\./\n assert hasCaseStatements : \"The 'update' operator is used, but it is missing the mandatory 'case' selectors (e.g., case .available).\"\n assert source =~ /case\\s+\\.available/ : \"The solution must specifically target the '.available' field.\"\n assert source =~ /case\\s+\\.last_loan_date/ : \"The solution must specifically target the '.last_loan_date' field.\"\n return \"PASS\"\n}", | |
| "comment":"the solution MUST use the 'update' operator to modify only the specified fields without reassigning every field in the object with the map operator. The 'update' operator requires 'case' selectors to specify which fields to update, so the solution MUST include 'case .available' to set it to false and 'case .last_loan_date' to set it to the current date." | |
| } | |
| {"id":"stress_dataweave_04","dataset_type":"stress","language":"DataWeave","task_category":"refactoring", | |
| "prompt_en":"Refactor this DataWeave code to improve redability and maintainability, without changing its functionality.", | |
| "prompt_nl":"Herstructureer deze DataWeave code om de leesbaarheid en onderhoudbaarheid te verbeteren, zonder de functionaliteit te wijzigen.", | |
| "code_snippet_input":"%dw 2.0\noutput application/json\n---\npayload map (sensor) -> {\n sensor_id: sensor.id,\n alert_level: if (sensor.status == \"OFFLINE\")\n \"CRITICAL\"\n else \n if (sensor.type == \"BOILER\")\n if (sensor.temp > 100) \"DANGER\"\n else if (sensor.temp > 80) \"WARNING\"\n else \"NORMAL\"\n else if (sensor.type == \"CHILLER\")\n if (sensor.temp < 0) \"DANGER\"\n else if (sensor.temp < 5) \"WARNING\"\n else \"NORMAL\"\n else \"UNKNOWN_DEVICE\"\n}", | |
| "canonical_solution":"%dw 2.0\noutput application/json\n---\npayload map (sensor) -> {\n sensor_id: sensor.id,\n alert_level: sensor match {\n case s if (s.status == \"OFFLINE\") -> \"CRITICAL\"\n case s if (s.type == \"BOILER\" and s.temp > 100) -> \"DANGER\"\n case s if (s.type == \"BOILER\" and s.temp > 80) -> \"WARNING\"\n case s if (s.type == \"CHILLER\" and s.temp < 0) -> \"DANGER\"\n case s if (s.type == \"CHILLER\" and s.temp < 5) -> \"WARNING\"\n else -> \"NORMAL\"\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 usesMatch = source =~ /(?i)match\\s*\\{/\n assert usesMatch : \"The solution failed to implement the 'match' operator.\"\n\n assert source =~ /->/ : \"Missing case arrows (->).\"\n\n assert source.count(\"case\") >= 5 : \"The solution is missing required logic branches.\"\n\n assert !(source =~ /else\\s+if/) : \"The solution still uses legacy 'else if' chains.\"\n\n return \"PASS\"\n}", | |
| "comment":"the solution MUST refactor the nested if-else statements into a more readable structure using the 'match' operator. Each condition should be represented as a 'case' within the match block." | |
| } | |