-
-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robot simulator descriptions too long #1525
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,10 +10,12 @@ | |||||
], | ||||||
"cases": [ | ||||||
{ | ||||||
"description": "A robot is created with a position and a direction", | ||||||
"description": "Create", | ||||||
"comments": [ "A robot is created with a position and a direction" ], | ||||||
"cases": [ | ||||||
{ | ||||||
"description": "Robots are created with a position and direction", | ||||||
"description": "at origin facing north", | ||||||
"comments": [ "Robots are created with a position and direction" ], | ||||||
"property": "create", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -31,7 +33,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "Negative positions are allowed", | ||||||
"description": "at negative position facing South", | ||||||
"comments": [ "Negative positions allowed" ], | ||||||
"property": "create", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -51,10 +54,12 @@ | |||||
] | ||||||
}, | ||||||
{ | ||||||
"description": "rotates the robot's direction 90 degrees clockwise", | ||||||
"description": "Rotate clockwise", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to rotate other than 90 degrees? If not, it is superfluous to say so. |
||||||
"comments": [ "rotates the robot's direction 90 degrees clockwise" ], | ||||||
"cases": [ | ||||||
{ | ||||||
"description": "changes the direction from north to east", | ||||||
"description": "north to east", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already know it changes direction, since the parent is "Rotate clockwise"
|
||||||
"comments": [ "changes the direction from north to east" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -73,7 +78,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from east to south", | ||||||
"description": "east to south", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from east to south" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -92,7 +98,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from south to west", | ||||||
"description": "south to west", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from south to west" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -111,7 +118,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from west to north", | ||||||
"description": "west to north", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from west to north" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -132,10 +140,12 @@ | |||||
] | ||||||
}, | ||||||
{ | ||||||
"description": "rotates the robot's direction 90 degrees counter-clockwise", | ||||||
"description": "Rotates counter-clockwise", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "rotates the robot's direction 90 degrees counter-clockwise" ], | ||||||
"cases": [ | ||||||
{ | ||||||
"description": "changes the direction from north to west", | ||||||
"description": "north to west", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from north to west" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -154,7 +164,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from west to south", | ||||||
"description": "west to south", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from west to south" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -173,7 +184,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from south to east", | ||||||
"description": "south to east", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from south to east" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -192,7 +204,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "changes the direction from east to north", | ||||||
"description": "east to north", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "changes the direction from east to north" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -213,10 +226,12 @@ | |||||
] | ||||||
}, | ||||||
{ | ||||||
"description": "moves the robot forward 1 space in the direction it is pointing", | ||||||
"description": "Forward One", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "moves the robot forward 1 space in the direction it is pointing" ], | ||||||
"cases": [ | ||||||
{ | ||||||
"description": "increases the y coordinate one when facing north", | ||||||
"description": "facing north", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats the same length as the original, which is pointless for me. The goal is facilitate reasonable length unit test names. And we already know its moving forward from the parent |
||||||
"comments": [ "increases the y coordinate one when facing north" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -235,7 +250,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "decreases the y coordinate by one when facing south", | ||||||
"description": "facing south", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "decreases the y coordinate by one when facing south" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -254,7 +270,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "increases the x coordinate by one when facing east", | ||||||
"description": "facing east", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "increases the x coordinate by one when facing east" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -273,7 +290,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "decreases the x coordinate by one when facing west", | ||||||
"description": "facing west", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"comments": [ "decreases the x coordinate by one when facing west" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -294,10 +312,14 @@ | |||||
] | ||||||
}, | ||||||
{ | ||||||
"description": "Where R = Turn Right, L = Turn Left and A = Advance, the robot can follow a series of instructions and end up with the correct position and direction", | ||||||
"description": "Series of instructions", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This seems like a fine movement from description to comment. This means that this comment most likely does not end up with the user. Comments are meant for track maintainers / test generator writers. So maybe this means that a cryptic part of an exercise becomes more cryptic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there any other instructions beside Left, Right, Advance? Otherwise its redundant to mention them. |
||||||
"comments": [ "The robot can follow a series of instructions and end up with the correct position and direction.", | ||||||
"Where R = Turn Right, L = Turn Left and A = Advance" | ||||||
] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your review. Some background....
which is a bit awful to ask a GUI IDE to deal with. The canonical schema specifies both "description" and "comments". One of those is implicitly longer, and the other needs to provide a minimal identifier for the test. What other data is available to generate unit test method names of reasonable length? I didn't spend the time making this edit to shorten the descriptions only for the sake of making them shorter. Its about distinguishing a descriptive-identifier from a verbose-comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is what comments are for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oof. I can imagine. That looks like quite a bit 😓. Since the names are pretty descriptive in their original form, would this work by not cascading them?
Comments are for the generator / implementer, free form and no rules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
#1411 has some info on that. To add to it: If we look at Python, Go and C# implementations of this exercise, only C# uses the description for method naming. Perhaps you could take a look at Go or Python for other options.
That's what the description is for. From the README:
I do think they don't do a great job of explaining the why but these changes don't help with that issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Right. What I meant that I didn't think the length was problematic as is ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since Python & Go don't use directly use the description, my changes will have no impact on them. Can you provide some concrete code examples of where my changes cause harm? Reviewing Python robot_simulator_test.py Reviewing C#, it looks like their method names are generated similar to Pharo by concatenating each level's description. Their longest is an 190 character identifier. This change may be beneficial to them? @robkeim @GKotfis @ErikSchierboom @abecerramatias public void A_robot_is_created_with_a_position_and_a_direction_robots_are_created_with_a_position_and_direction()
public void A_robot_is_created_with_a_position_and_a_direction_negative_positions_are_allowed()
public void Rotates_the_robots_direction_90_degrees_clockwise_changes_the_direction_from_north_to_east()
public void Rotates_the_robots_direction_90_degrees_clockwise_changes_the_direction_from_east_to_south()
public void Rotates_the_robots_direction_90_degrees_clockwise_changes_the_direction_from_south_to_west()
public void Rotates_the_robots_direction_90_degrees_clockwise_changes_the_direction_from_west_to_north()
public void Rotates_the_robots_direction_90_degrees_counter_clockwise_changes_the_direction_from_north_to_west()
public void Rotates_the_robots_direction_90_degrees_counter_clockwise_changes_the_direction_from_west_to_south()
public void Rotates_the_robots_direction_90_degrees_counter_clockwise_changes_the_direction_from_south_to_east()
public void Rotates_the_robots_direction_90_degrees_counter_clockwise_changes_the_direction_from_east_to_north()
public void Moves_the_robot_forward_1_space_in_the_direction_it_is_pointing_increases_the_y_coordinate_one_when_facing_north()
public void Moves_the_robot_forward_1_space_in_the_direction_it_is_pointing_decreases_the_y_coordinate_by_one_when_facing_south()
public void Moves_the_robot_forward_1_space_in_the_direction_it_is_pointing_increases_the_x_coordinate_by_one_when_facing_east()
public void Moves_the_robot_forward_1_space_in_the_direction_it_is_pointing_decreases_the_x_coordinate_by_one_when_facing_west()
public void Where_r_turn_right_l_turn_left_and_a_advance_the_robot_can_follow_a_series_of_instructions_and_end_up_with_the_correct_position_and_direction_instructions_to_move_east_and_north_from_readme()
public void Where_r_turn_right_l_turn_left_and_a_advance_the_robot_can_follow_a_series_of_instructions_and_end_up_with_the_correct_position_and_direction_instructions_to_move_west_and_north()
public void Where_r_turn_right_l_turn_left_and_a_advance_the_robot_can_follow_a_series_of_instructions_and_end_up_with_the_correct_position_and_direction_instructions_to_move_west_and_south()
public void Where_r_turn_right_l_turn_left_and_a_advance_the_robot_can_follow_a_series_of_instructions_and_end_up_with_the_correct_position_and_direction_instructions_to_move_east_and_north() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At least in the current form of the schema, it uses the description for something it's not intended to be, thus making the file less human-readable and more annoying to generate for generators that rely on the description being descriptive. I gave examples for both these points above.
Ways to generate test suites without using the descriptions as method names directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@SaschaMann Please note, I'd prefer not to change these descriptions at all. I'm only doing so as I was directed to here. |
||||||
"cases": [ | ||||||
{ | ||||||
"description": "instructions to move east and north from README", | ||||||
"description": "moving east and north", | ||||||
"comments": [ "instructions to move east and north from README" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -316,7 +338,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "instructions to move west and north", | ||||||
"description": "moving west and north", | ||||||
"comments": [ "instructions to move west and north" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -335,7 +358,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "instructions to move west and south", | ||||||
"description": "moving west and south", | ||||||
"comments": [ "instructions to move west and south" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
@@ -354,7 +378,8 @@ | |||||
} | ||||||
}, | ||||||
{ | ||||||
"description": "instructions to move east and north", | ||||||
"description": "moving east and north", | ||||||
"comments": [ "instructions to move east and north" ], | ||||||
"property": "move", | ||||||
"input": { | ||||||
"position": { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment just repeats what the description says, so it could be removed. Same with the comments in L58, L62, L82 etc.
(I'm opposed to the suggested changes in general (see the other comment thread), but if this would go through, the redundancy should be removed imo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the comment is superfluous here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the same when I did it. I was just trying to not to lose any info. I'll wait to see how the other discussion pans out be doing such cleanup.