Snapshot: new training tasks (balanced generation), docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
40
tasks_gen/train/G1954/faulty/m0_if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/faulty/m0_if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 9.
|
||||
TYPES ty_damage TYPE c LENGTH 4.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'EYLT',
|
||||
batt TYPE ty_damage VALUE 'BATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 200.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
40
tasks_gen/train/G1954/faulty/m1_if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/faulty/m1_if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 10.
|
||||
TYPES ty_damage TYPE c LENGTH 3.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'EYLT',
|
||||
batt TYPE ty_damage VALUE 'BATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 200.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
40
tasks_gen/train/G1954/faulty/m2_if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/faulty/m2_if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 10.
|
||||
TYPES ty_damage TYPE c LENGTH 4.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'ZYLT',
|
||||
batt TYPE ty_damage VALUE 'BATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 200.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
40
tasks_gen/train/G1954/faulty/m3_if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/faulty/m3_if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 10.
|
||||
TYPES ty_damage TYPE c LENGTH 4.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'EYLT',
|
||||
batt TYPE ty_damage VALUE 'ZATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 200.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
40
tasks_gen/train/G1954/faulty/m4_if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/faulty/m4_if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 10.
|
||||
TYPES ty_damage TYPE c LENGTH 4.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'EYLT',
|
||||
batt TYPE ty_damage VALUE 'BATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 201.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
34
tasks_gen/train/G1954/generation.json
Normal file
34
tasks_gen/train/G1954/generation.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"id": "G1954",
|
||||
"pool": "train",
|
||||
"object_type": "INTF",
|
||||
"category": "A",
|
||||
"attempts": [
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 0,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 81.4,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 81.4,
|
||||
"null": 0
|
||||
},
|
||||
{
|
||||
"stage": "validate",
|
||||
"oracle": 100.0,
|
||||
"null": 0,
|
||||
"mutation": {
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"ok": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"accepted": true
|
||||
}
|
||||
105
tasks_gen/train/G1954/hidden/t02_hidden.clas.abap
Normal file
105
tasks_gen/train/G1954/hidden/t02_hidden.clas.abap
Normal file
@@ -0,0 +1,105 @@
|
||||
CLASS {{p}}t02_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS reason_ok FOR TESTING.
|
||||
METHODS reason_empty FOR TESTING.
|
||||
METHODS reason_damage FOR TESTING.
|
||||
METHODS reason_cloth FOR TESTING.
|
||||
METHODS reason_length FOR TESTING.
|
||||
METHODS reason_rush FOR TESTING.
|
||||
METHODS damage_codes FOR TESTING.
|
||||
METHODS cloth_codes FOR TESTING.
|
||||
METHODS limits FOR TESTING.
|
||||
METHODS type_lengths FOR TESTING.
|
||||
METHODS method_signature FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t02_hidden IMPLEMENTATION.
|
||||
METHOD reason_ok.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'OK'
|
||||
act = {{p}}if_sail_repair=>c_reason-ok ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_empty.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'EMPTY'
|
||||
act = {{p}}if_sail_repair=>c_reason-empty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_damage.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DAMAGE'
|
||||
act = {{p}}if_sail_repair=>c_reason-damage ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_cloth.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CLOTH'
|
||||
act = {{p}}if_sail_repair=>c_reason-cloth ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_length.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LENGTH'
|
||||
act = {{p}}if_sail_repair=>c_reason-length ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD reason_rush.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'RUSH'
|
||||
act = {{p}}if_sail_repair=>c_reason-rush ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD damage_codes.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'TEAR'
|
||||
act = {{p}}if_sail_repair=>c_damage-tear ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'SEAM'
|
||||
act = {{p}}if_sail_repair=>c_damage-seam ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'EYLT'
|
||||
act = {{p}}if_sail_repair=>c_damage-eylt ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BATT'
|
||||
act = {{p}}if_sail_repair=>c_damage-batt ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD cloth_codes.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LITE'
|
||||
act = {{p}}if_sail_repair=>c_cloth-lite ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'MEDM'
|
||||
act = {{p}}if_sail_repair=>c_cloth-medm ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HEAV'
|
||||
act = {{p}}if_sail_repair=>c_cloth-heav ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD limits.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 400
|
||||
act = {{p}}if_sail_repair=>c_max_length ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 200
|
||||
act = {{p}}if_sail_repair=>c_rush_limit ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD type_lengths.
|
||||
DATA lv_reason TYPE {{p}}if_sail_repair=>ty_reason.
|
||||
DATA lv_damage TYPE {{p}}if_sail_repair=>ty_damage.
|
||||
DATA lv_cloth TYPE {{p}}if_sail_repair=>ty_cloth.
|
||||
DATA lv_long TYPE string.
|
||||
lv_long = 'ABCDEFGHIJKLMNOP'.
|
||||
lv_reason = lv_long.
|
||||
lv_damage = lv_long.
|
||||
lv_cloth = lv_long.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCDEFGHIJ' act = lv_reason ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCD' act = lv_damage ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCD' act = lv_cloth ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD method_signature.
|
||||
DATA lo_order TYPE REF TO {{p}}if_sail_repair.
|
||||
DATA lv_reason TYPE {{p}}if_sail_repair=>ty_reason.
|
||||
TRY.
|
||||
lv_reason = lo_order->check_order(
|
||||
iv_damage = {{p}}if_sail_repair=>c_damage-tear
|
||||
iv_cloth = {{p}}if_sail_repair=>c_cloth-lite
|
||||
iv_length = 150
|
||||
iv_rush = abap_false ).
|
||||
CATCH cx_sy_ref_is_initial.
|
||||
lv_reason = {{p}}if_sail_repair=>c_reason-ok.
|
||||
ENDTRY.
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_sail_repair=>c_reason-ok
|
||||
act = lv_reason ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
55
tasks_gen/train/G1954/mutation.json
Normal file
55
tasks_gen/train/G1954/mutation.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"task": "G1954",
|
||||
"mutants": [
|
||||
{
|
||||
"object": "{{P}}IF_SAIL_REPAIR",
|
||||
"mutant": "line 2: LENGTH 10 -> LENGTH 9 (length)",
|
||||
"status": "killed",
|
||||
"hidden": "10/11",
|
||||
"failed_tests": [
|
||||
"TYPE_LENGTHS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_SAIL_REPAIR",
|
||||
"mutant": "line 3: LENGTH 4 -> LENGTH 3 (length)",
|
||||
"status": "killed",
|
||||
"hidden": "9/11",
|
||||
"failed_tests": [
|
||||
"DAMAGE_CODES",
|
||||
"TYPE_LENGTHS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_SAIL_REPAIR",
|
||||
"mutant": "line 20: VALUE 'EYLT' -> VALUE 'ZYLT' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "10/11",
|
||||
"failed_tests": [
|
||||
"DAMAGE_CODES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_SAIL_REPAIR",
|
||||
"mutant": "line 21: VALUE 'BATT' -> VALUE 'ZATT' (lit)",
|
||||
"status": "killed",
|
||||
"hidden": "10/11",
|
||||
"failed_tests": [
|
||||
"DAMAGE_CODES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "{{P}}IF_SAIL_REPAIR",
|
||||
"mutant": "line 32: VALUE 200 -> VALUE 201 (const)",
|
||||
"status": "killed",
|
||||
"hidden": "10/11",
|
||||
"failed_tests": [
|
||||
"LIMITS"
|
||||
]
|
||||
}
|
||||
],
|
||||
"valid": 5,
|
||||
"killed": 5,
|
||||
"kill_rate": 1.0,
|
||||
"ok": true
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
CLASS {{p}}cl_sail_repair_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS reason_codes FOR TESTING.
|
||||
METHODS code_lists FOR TESTING.
|
||||
METHODS limits FOR TESTING.
|
||||
METHODS type_lengths FOR TESTING.
|
||||
METHODS method_signature FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}cl_sail_repair_test IMPLEMENTATION.
|
||||
METHOD reason_codes.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'OK'
|
||||
act = {{p}}if_sail_repair=>c_reason-ok ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'EMPTY'
|
||||
act = {{p}}if_sail_repair=>c_reason-empty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'DAMAGE'
|
||||
act = {{p}}if_sail_repair=>c_reason-damage ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'CLOTH'
|
||||
act = {{p}}if_sail_repair=>c_reason-cloth ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LENGTH'
|
||||
act = {{p}}if_sail_repair=>c_reason-length ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'RUSH'
|
||||
act = {{p}}if_sail_repair=>c_reason-rush ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD code_lists.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'TEAR'
|
||||
act = {{p}}if_sail_repair=>c_damage-tear ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'SEAM'
|
||||
act = {{p}}if_sail_repair=>c_damage-seam ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'EYLT'
|
||||
act = {{p}}if_sail_repair=>c_damage-eylt ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'BATT'
|
||||
act = {{p}}if_sail_repair=>c_damage-batt ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'LITE'
|
||||
act = {{p}}if_sail_repair=>c_cloth-lite ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'MEDM'
|
||||
act = {{p}}if_sail_repair=>c_cloth-medm ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'HEAV'
|
||||
act = {{p}}if_sail_repair=>c_cloth-heav ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD limits.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 400
|
||||
act = {{p}}if_sail_repair=>c_max_length ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 200
|
||||
act = {{p}}if_sail_repair=>c_rush_limit ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD type_lengths.
|
||||
DATA lv_reason TYPE {{p}}if_sail_repair=>ty_reason.
|
||||
DATA lv_damage TYPE {{p}}if_sail_repair=>ty_damage.
|
||||
DATA lv_cloth TYPE {{p}}if_sail_repair=>ty_cloth.
|
||||
DATA lv_long TYPE string.
|
||||
lv_long = 'ABCDEFGHIJKLMNOP'.
|
||||
lv_reason = lv_long.
|
||||
lv_damage = lv_long.
|
||||
lv_cloth = lv_long.
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCDEFGHIJ' act = lv_reason ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCD' act = lv_damage ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 'ABCD' act = lv_cloth ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD method_signature.
|
||||
DATA lo_order TYPE REF TO {{p}}if_sail_repair.
|
||||
DATA lv_reason TYPE {{p}}if_sail_repair=>ty_reason.
|
||||
TRY.
|
||||
lv_reason = lo_order->check_order(
|
||||
iv_damage = {{p}}if_sail_repair=>c_damage-seam
|
||||
iv_cloth = {{p}}if_sail_repair=>c_cloth-heav
|
||||
iv_length = 250
|
||||
iv_rush = abap_true ).
|
||||
CATCH cx_sy_ref_is_initial.
|
||||
lv_reason = {{p}}if_sail_repair=>c_reason-ok.
|
||||
ENDTRY.
|
||||
cl_abap_unit_assert=>assert_equals( exp = {{p}}if_sail_repair=>c_reason-ok
|
||||
act = lv_reason ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
40
tasks_gen/train/G1954/reference/if_sail_repair.intf.abap
Normal file
40
tasks_gen/train/G1954/reference/if_sail_repair.intf.abap
Normal file
@@ -0,0 +1,40 @@
|
||||
INTERFACE {{p}}if_sail_repair PUBLIC.
|
||||
TYPES ty_reason TYPE c LENGTH 10.
|
||||
TYPES ty_damage TYPE c LENGTH 4.
|
||||
TYPES ty_cloth TYPE c LENGTH 4.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_reason,
|
||||
ok TYPE ty_reason VALUE 'OK',
|
||||
empty TYPE ty_reason VALUE 'EMPTY',
|
||||
damage TYPE ty_reason VALUE 'DAMAGE',
|
||||
cloth TYPE ty_reason VALUE 'CLOTH',
|
||||
length TYPE ty_reason VALUE 'LENGTH',
|
||||
rush TYPE ty_reason VALUE 'RUSH',
|
||||
END OF c_reason.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_damage,
|
||||
tear TYPE ty_damage VALUE 'TEAR',
|
||||
seam TYPE ty_damage VALUE 'SEAM',
|
||||
eylt TYPE ty_damage VALUE 'EYLT',
|
||||
batt TYPE ty_damage VALUE 'BATT',
|
||||
END OF c_damage.
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_cloth,
|
||||
lite TYPE ty_cloth VALUE 'LITE',
|
||||
medm TYPE ty_cloth VALUE 'MEDM',
|
||||
heav TYPE ty_cloth VALUE 'HEAV',
|
||||
END OF c_cloth.
|
||||
|
||||
CONSTANTS c_max_length TYPE i VALUE 400.
|
||||
CONSTANTS c_rush_limit TYPE i VALUE 200.
|
||||
|
||||
METHODS check_order
|
||||
IMPORTING iv_damage TYPE ty_damage
|
||||
iv_cloth TYPE ty_cloth
|
||||
iv_length TYPE i
|
||||
iv_rush TYPE abap_bool
|
||||
RETURNING VALUE(rv_reason) TYPE ty_reason.
|
||||
ENDINTERFACE.
|
||||
62
tasks_gen/train/G1954/spec.md
Normal file
62
tasks_gen/train/G1954/spec.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# 1. Goal
|
||||
A sailmaker loft repairs sails for yacht owners. Two intake points send a repair
|
||||
order to the same check: the loft counter and the online form. Both intake points
|
||||
and the loft work with one interface. The interface is the shared contract of the
|
||||
repair order check. It holds the codes, the limits and the method signature.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- The interface {{P}}IF_SAIL_REPAIR does not exist yet. Create it in package $TMP.
|
||||
- A repair order has a damage code, a cloth code, the damaged length in
|
||||
centimetres, and a rush flag.
|
||||
- The loft knows four damage codes, three cloth codes and two limits.
|
||||
- The intake points call the method of the interface before they accept an order.
|
||||
|
||||
# 4. Contract
|
||||
- Create the interface {{P}}IF_SAIL_REPAIR in package $TMP.
|
||||
- The interface has these public types: TY_REASON (character 10),
|
||||
TY_DAMAGE (character 4) and TY_CLOTH (character 4).
|
||||
- The interface has the public constant structure C_REASON with the components
|
||||
OK, EMPTY, DAMAGE, CLOTH, LENGTH and RUSH. Each component has the type
|
||||
TY_REASON.
|
||||
- The interface has the public constant structure C_DAMAGE with the components
|
||||
TEAR, SEAM, EYLT and BATT. Each component has the type TY_DAMAGE.
|
||||
- The interface has the public constant structure C_CLOTH with the components
|
||||
LITE, MEDM and HEAV. Each component has the type TY_CLOTH.
|
||||
- The interface has the public constants C_MAX_LENGTH and C_RUSH_LIMIT, both of
|
||||
type I.
|
||||
- The interface has one method CHECK_ORDER with the importing parameters
|
||||
IV_DAMAGE (type TY_DAMAGE), IV_CLOTH (type TY_CLOTH), IV_LENGTH (type I) and
|
||||
IV_RUSH (type ABAP_BOOL) and the returning parameter RV_REASON (type
|
||||
TY_REASON).
|
||||
- Do not add other public components.
|
||||
|
||||
# 5. Business rules
|
||||
1. The reason codes have these values: OK = 'OK', EMPTY = 'EMPTY',
|
||||
DAMAGE = 'DAMAGE', CLOTH = 'CLOTH', LENGTH = 'LENGTH', RUSH = 'RUSH'.
|
||||
2. The damage codes have these values: TEAR = 'TEAR', SEAM = 'SEAM',
|
||||
EYLT = 'EYLT', BATT = 'BATT'.
|
||||
3. The cloth codes have these values: LITE = 'LITE', MEDM = 'MEDM',
|
||||
HEAV = 'HEAV'.
|
||||
4. C_MAX_LENGTH is 400. C_RUSH_LIMIT is 200.
|
||||
5. TY_REASON is 10 characters long. TY_DAMAGE is 4 characters long. TY_CLOTH is
|
||||
4 characters long.
|
||||
6. The method CHECK_ORDER has exactly the importing parameters IV_DAMAGE,
|
||||
IV_CLOTH, IV_LENGTH and IV_RUSH and the returning parameter RV_REASON.
|
||||
IV_DAMAGE has the type TY_DAMAGE. IV_CLOTH has the type TY_CLOTH. IV_LENGTH
|
||||
has the type I. IV_RUSH has the type ABAP_BOOL. RV_REASON has the type
|
||||
TY_REASON.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
|
||||
- Coding standards: Clean ABAP. No global variables. No comment that restates
|
||||
the code.
|
||||
- Out of scope: do not create an implementation class. Do not change other
|
||||
objects in package $TMP.
|
||||
|
||||
# 7. Acceptance
|
||||
- The interface {{P}}IF_SAIL_REPAIR is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write your own ABAP Unit tests for the interface.
|
||||
49
tasks_gen/train/G1954/task.json
Normal file
49
tasks_gen/train/G1954/task.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"id": "G1954",
|
||||
"category": "A",
|
||||
"object_type": "INTF",
|
||||
"difficulty": 2,
|
||||
"release_target": "v816",
|
||||
"expected_outcome": "implement",
|
||||
"budget": {
|
||||
"max_tool_calls": 60,
|
||||
"max_activations": 15
|
||||
},
|
||||
"seed": [],
|
||||
"contract": [
|
||||
{
|
||||
"type": "INTF",
|
||||
"name": "{{P}}IF_SAIL_REPAIR"
|
||||
}
|
||||
],
|
||||
"out_of_scope": [
|
||||
"Do not create an implementation class",
|
||||
"Do not change other objects in package $TMP"
|
||||
],
|
||||
"hidden_tests": [
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}T02_HIDDEN",
|
||||
"file": "hidden/t02_hidden.clas.abap",
|
||||
"description": "T02 hidden tests: constant values, type lengths and the method signature of the sail repair contract"
|
||||
}
|
||||
],
|
||||
"reference": [
|
||||
{
|
||||
"type": "INTF",
|
||||
"name": "{{P}}IF_SAIL_REPAIR",
|
||||
"file": "reference/if_sail_repair.intf.abap",
|
||||
"description": "Sail repair contract"
|
||||
},
|
||||
{
|
||||
"type": "CLAS",
|
||||
"name": "{{P}}CL_SAIL_REPAIR_TEST",
|
||||
"file": "reference/cl_sail_repair_test.clas.abap",
|
||||
"description": "Own tests for the sail repair contract"
|
||||
}
|
||||
],
|
||||
"craft_checks": [
|
||||
"naming_conventions",
|
||||
"constant_values"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user