SlideShare a Scribd company logo
1 of 16
Download to read offline
XXX Code Test
Toy Robot
Simulator
1 April 2015
Paul Peng Deng
I am an experienced and enthusiastic full stack IoT (Internet of
Things) application developer.
Have hands-on experience in wide range of wireless
communication protocols and big data cloud applications. With
innovation in my genes, I translate my idea into design and
working prototype rapidly to evaluate potential new products or
services.
I currently work for Intercel Australia in Melbourne and open for all
opportunities.
Author
Revision History
Revision Date Comments
0.1 20 January 2015 Draft
0.2 21 January 2015 Test, UML, How to Run, Future Work
0.3 22 January 2015 Typos, text format, rephrase sentences
Licence
Creative Commons
Attribution 4.0 International (CC BY 4.0)
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in
any way that suggests the licensor endorses you or your use.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
 http://dengpeng.de
1
TOY ROBOT SIMULATOR
Table of Contents
Requirements............................................................................................................................... 2
Description ............................................................................................................................... 2
Constraints............................................................................................................................... 2
Example Input and Output....................................................................................................... 3
Deliverables.............................................................................................................................. 3
Paul Deng’s Java Implementation .............................................................................................. 4
Deliverables.............................................................................................................................. 4
How to Run............................................................................................................................... 4
UML .......................................................................................................................................... 4
Test........................................................................................................................................... 5
Summary.............................................................................................................................. 5
Junit Test Cases .................................................................................................................. 5
Future Work............................................................................................................................ 10
Requirements Verification................................................................................................. 10
Code Quality Improvements.............................................................................................. 10
Use Design Pattern............................................................................................................ 10
Add Interactive Mode ........................................................................................................ 10
Better Test Coverage......................................................................................................... 11
Better In-Line Comments................................................................................................... 11
Better Version Control ....................................................................................................... 11
Better Documentation ....................................................................................................... 11
Add UI................................................................................................................................. 11
Similar Projects and Implementations ..................................................................................... 11
Notes .......................................................................................................................................... 12
 http://dengpeng.de
2
TOY ROBOT SIMULATOR
Requirements
Description
 The application is a simulation of a toy robot moving on a square tabletop, of
dimensions 5 units x 5 units.
 There are no other obstructions on the table surface.
 The robot is free to roam around the surface of the table, but must be prevented from
falling to destruction. Any movement that would result in the robot falling from the table
must be prevented, however further valid movement commands must still be allowed.
Create an application that can read in commands of the following form -
PLACE X,Y,F
MOVE
LEFT
RIGHT
REPORT
 PLACE will put the toy robot on the table in position X,Y and facing NORTH, SOUTH,
EAST or WEST.
 The origin (0,0) can be considered to be the SOUTH WEST most corner.
 The first valid command to the robot is a PLACE command, after that, any sequence of
commands may be issued, in any order, including another PLACE command. The
application should discard all commands in the sequence until a valid PLACE command
has been executed.
 MOVE will move the toy robot one unit forward in the direction it is currently facing.
 LEFT and RIGHT will rotate the robot 90 degrees in the specified direction without
changing the position of the robot.
 REPORT will announce the X,Y and F of the robot. This can be in any form, but standard
output is sufficient.
 A robot that is not on the table can choose then ignore the MOVE, LEFT, RIGHT and
REPORT commands.
 Input can be from a file, or from standard input, as the developer chooses.
 Provide test data to exercise the application.
Constraints
The toy robot must not fall off the table during movement. This also includes the initial
placement of the toy robot.
Any move that would cause the robot to fall must be ignored.
 http://dengpeng.de
3
TOY ROBOT SIMULATOR
Example Input and Output
a)
PLACE 0,0,NORTH
MOVE
REPORT
Output: 0,1,NORTH
b)
PLACE 0,0,NORTH
LEFT
REPORT
Output: 0,0,WEST
c)
PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT
Output: 3,3,NORTH
Deliverables
The Ruby source files, the test data and any test code.
It is not required to provide any graphical output showing the movement of the toy robot.
 http://dengpeng.de
4
TOY ROBOT SIMULATOR
Paul Deng’s Java Implementation
 Java implementation
 File input only. Does not accept input interactively from keyboard
 Command line application, no GUI
Deliverables
Deliverables can be downloaded from: http://dengpeng.de/wp-
content/uploads/2015/01/ToyRobotSimulator.zip
 Executable JAR: ToyRobotSimulator/dist/ToyRobotSimulator.jar
 Java Source File: ToyRobotSimulator/src
 Project Document (this document): ToyRobotSimulator/docs/Toy Robot
Simulator.pdf
 Junit Source Files: ToyRobotSimulator/src/toyrobotsimulator_testcases
 Junit Test Case Input Files: ToyRobotSimulator/testFiles
How to Run
UML
Class Diagram
 http://dengpeng.de
5
TOY ROBOT SIMULATOR
Test
Summary
This table below extracts requirements from project description and concludes with test
cases and test results. For detail of each individual test case, please read the next section.
# Requirements Test Cases # Results
1 Any movement that would result in the robot falling from
the table must be prevented, however further valid
movement commands must still be allowed.
16, 17, 18, 19 Pass
2 The first valid command to the robot is a PLACE
command.
05, 06 Pass
3 Any sequence of commands may be issued, in any order,
including another PLACE command.
07 Pass
4 The application should discard all commands in the
sequence until a valid PLACE command has been
executed.
07 Pass
5 MOVE will move the toy robot one unit forward in the
direction it is currently facing.
13, 14, 15,
16, 17, 18, 19
Pass
6 LEFT and RIGHT will rotate the robot 90 degrees in the
specified direction without changing the position of the
robot.
13, 14, 15,
16, 17, 18, 19
Pass
7 REPORT will announce the X,Y and F of the robot. 13, 14, 15,
16, 17, 18, 19
Pass
8 A robot that is not on the table can choose then ignore the
MOVE, LEFT, RIGHT and REPORT commands.
05, 08 Pass
9 The toy robot must not fall off the table during movement 16, 17, 18, 19 Pass
10 This also includes the initial placement of the toy robot. 08 Pass
11 Any move that would cause the robot to fall must be
ignored.
16, 17, 18, 19 Pass
12 Example input and output a, b, c 13, 14, 15 Pass
Junit Test Cases
1. Missing argument
Input: java –jar ToyrobotSimulator
Expected output: Only accept 1 argument, 0 given.
2. Too many arguments
Input: java –jar ToyrobotSimulator too many arguments
Expected output: Only accept 1 argument, 3 given.
3. Invalid input file
Input: java –jar ToyrobotSimulator ../testFiles/file_not_exist.txt
Expected output: File not found: ../testFiles/file_not_exist.txt
 http://dengpeng.de
6
TOY ROBOT SIMULATOR
4. Empty input file
Input: java –jar
ToyrobotSimulator ../testFiles/TestCase_04_EmptyInputFile.txt
Expected output: Empty file: ../testFiles/TestCase_04_EmptyInputFile.txt
5. PLACE command missing
Input commands: MOVE
REPORT
Expected output: Invalid command file:
testFiles/TestCase_05_PLACECommandMissing.txt
Notes In this implementation, no PLACE command means this file is invalid
or corrupted.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
6. Invalid PLACE command
Input commands: PLACE 0,southeast
LEFT
REPORT
Expected output: Invalid command file:
testFiles/TestCase_06_InvalidPLACECommand.txt
Notes In this implementation, invalid PLACE command means this file is
invalid or corrupted.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
7. Duplicate PLACE commands
Input commands: MOVE
REPORT
PLACE 1,2,EAST
PLACE 0,0,NORTH
MOVE
REPORT
PLACE 0,0,NORTH
LEFT
REPORT
PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT
Expected output: Output: 0,1,NORTH
Output: 0,0,WEST
Output: 3,3,NORTH
8. PLACE outside of table
Input commands: PLACE 10,10,NORTH
 http://dengpeng.de
7
TOY ROBOT SIMULATOR
MOVE
REPORT
Expected output: Invalid command file:
testFiles/TestCase_08_PLACEOutsideOfTable.txt
Notes: In this implementation, PLACE outside of table means it is an invalid
PLACE command.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
9. Invalid MOVE, LEFT and RIGHT command
Input commands: PLACE 1,2,EAST
movebla
leftbla
rightbla
REPORT
Expected output: Output: 1,2,EAST
10. REPORT command missing
Input commands: PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
Expected output:
Notes: In this implementation, missing REPORT is considered valid, thus no
output.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
11. Invalid REPORT command
Input commands: PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORTbla
Expected output:
Notes: In this implementation, invalid REPORT is ignored, thus no output.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
12. Unsolicited command
Input commands: PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
This is a unsolicited command line
 http://dengpeng.de
8
TOY ROBOT SIMULATOR
REPORT
Expected output:
Notes: In this implementation, invalid command is ignored.
However, further verification is required with the QA team or
customer, in order to meet the exact specification.
13. Test case a
This test case is from project description.
Input commands: PLACE 0,0,NORTH
MOVE
REPORT
Expected output: Output: 0,1,NORTH
14. Test case b
This test case is from project description.
Input commands: PLACE 0,0,NORTH
LEFT
REPORT
Expected output: Output: 0,0,WEST
15. Test case c
This test case is from project description.
Input commands: PLACE 1,2,EAST
MOVE
MOVE
LEFT
MOVE
REPORT
Expected output: Output: 3,3,NORTH
16. Move North outbound
Input commands: PLACE 0,0,NORTH
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
 http://dengpeng.de
9
TOY ROBOT SIMULATOR
MOVE
MOVE
MOVE
MOVE
RIGHT
MOVE
REPORT
Expected output: Output: 1,4,EAST
17. Move South outbound
Input commands: PLACE 0,0,SOUTH
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
LEFT
MOVE
REPORT
Expected output: Output: 1,0,EAST
18. Move West outbound
Input commands: PLACE 0,0,WEST
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
RIGHT
MOVE
REPORT
Expected output: Output: 0,1,NORTH
 http://dengpeng.de
10
TOY ROBOT SIMULATOR
19. Move East outbound
Input commands: PLACE 0,0,EAST
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
MOVE
LEFT
MOVE
REPORT
Expected output: Output: 4,1,NORTH
Future Work
Requirements Verification
The following requirements are not clear and need to go back to Project Manager/Customer
to have further verification.
 Test Case 05: PLACE Command Missing
 Test Case 06: Invalid PLACE Command
 Test Case 08: PLACE Outside of Table
 Test Case 10: REPORT Command Missing
 Test Case 11: Invalid REPORT Command
 Test Case 12: Unsolicited command
Code Quality Improvements
Due to the time restriction, the code quality is not very good. Further optimization is
required.
Use Design Pattern
This is a simple application, I decide not to use any design pattern.
However, with the time goes on, new features will be added and it may need to use a proper
design pattern to increase code reuse and maintainability.
Add Interactive Mode
This application only implements file IO. The next version should accept input in real time
and print out result immediately.
 http://dengpeng.de
11
TOY ROBOT SIMULATOR
Better Test Coverage
Some complex scenarios are not tested in this version, due to time restriction.
Future version should cover them, for example:
 multiple PLACE commands with invalid and valid commands mixed
 different OSs and different JVMs
Better In-Line Comments
Ad-hoc in line comments in place.
However, it is not idea and should use proper format which aligns with company code
policy.
Better Version Control
SVN or Git is not used for this simple application.
Better Documentation
Only class diagram is presented in this document. Sequence diagram is required to explain
how this application works internally.
Add UI
Attracts more customers.
Similar Projects and Implementations
 Ruby implementation: https://github.com/huwr/toy-robot-simulator
 js and html5 implementation: http://lisalu.com.au/toy-robot-simulator-using-
javascript-and-html5/
 js implementation: http://jsfiddle.net/lisatinglu/cBm2Z/light/
 Java implementation: https://groups.google.com/forum/#!msg/happy-
programming/O0-lg6yn1F0/O8E_8qXGvk4J
 Ruby implementation: http://thatalexguy.com/posts/2013-07-15-failure-to-
code.html
 Discussion: https://joneaves.wordpress.com/2014/07/21/toy-robot-coding-test/
 Java implementation: https://github.com/alexwibowo/Robot
 http://dengpeng.de
12
TOY ROBOT SIMULATOR
Notes
1 April 2015
 http://dengpeng.de
Contact
 dengpeng.cn@gmail.com
Skype: dengpengcd
QQ: 285637
LinkedIn:
http://au.linkedin.com/in/
pengdeng/
 中国电邮请发送到 paul.deng@foxmail.com

More Related Content

What's hot

Red bull Marketing Strategies
Red bull Marketing StrategiesRed bull Marketing Strategies
Red bull Marketing StrategiesYujata Pasricha
 
Marketing Planning Coca Cola
Marketing Planning Coca ColaMarketing Planning Coca Cola
Marketing Planning Coca ColaMayank Kumar
 
How to Use Colour to Influence Productivity and Perception
How to Use Colour to Influence Productivity and PerceptionHow to Use Colour to Influence Productivity and Perception
How to Use Colour to Influence Productivity and PerceptionGetSmarter
 
Logo design process
 Logo design process Logo design process
Logo design processZainab Choco
 
Red Bull Ireland Digital Media Landscape Report - December 2014
Red Bull Ireland Digital Media Landscape Report - December 2014Red Bull Ireland Digital Media Landscape Report - December 2014
Red Bull Ireland Digital Media Landscape Report - December 2014Adam Hide
 
Integrated marketing communication plan for Red Bull Flux
Integrated marketing communication plan for Red Bull FluxIntegrated marketing communication plan for Red Bull Flux
Integrated marketing communication plan for Red Bull FluxShrey Kapoor
 
The Deconstruction of Red Bull (7 P's)
The Deconstruction of Red Bull (7 P's)The Deconstruction of Red Bull (7 P's)
The Deconstruction of Red Bull (7 P's)nmladenoska
 
Snickers Spin to Win - An Ad Campaign
Snickers Spin to Win - An Ad CampaignSnickers Spin to Win - An Ad Campaign
Snickers Spin to Win - An Ad CampaignHope Kicak
 
Starbucks final
Starbucks   finalStarbucks   final
Starbucks finalvifonseca
 
Logo Design basics
Logo Design basicsLogo Design basics
Logo Design basicsGreg Sarles
 
Coca-Cola Presentation
Coca-Cola PresentationCoca-Cola Presentation
Coca-Cola PresentationWasim Haidar
 

What's hot (20)

Red bull Marketing Strategies
Red bull Marketing StrategiesRed bull Marketing Strategies
Red bull Marketing Strategies
 
Marketing Planning Coca Cola
Marketing Planning Coca ColaMarketing Planning Coca Cola
Marketing Planning Coca Cola
 
How to Use Colour to Influence Productivity and Perception
How to Use Colour to Influence Productivity and PerceptionHow to Use Colour to Influence Productivity and Perception
How to Use Colour to Influence Productivity and Perception
 
Logo design process
 Logo design process Logo design process
Logo design process
 
Starbucks
StarbucksStarbucks
Starbucks
 
Red bull
Red bullRed bull
Red bull
 
Red bull ppt
Red bull pptRed bull ppt
Red bull ppt
 
Creative brief (1)
Creative brief (1)Creative brief (1)
Creative brief (1)
 
Red Bull Ireland Digital Media Landscape Report - December 2014
Red Bull Ireland Digital Media Landscape Report - December 2014Red Bull Ireland Digital Media Landscape Report - December 2014
Red Bull Ireland Digital Media Landscape Report - December 2014
 
Integrated marketing communication plan for Red Bull Flux
Integrated marketing communication plan for Red Bull FluxIntegrated marketing communication plan for Red Bull Flux
Integrated marketing communication plan for Red Bull Flux
 
Book de criação - 2016/2
Book de criação - 2016/2Book de criação - 2016/2
Book de criação - 2016/2
 
Color branding
Color brandingColor branding
Color branding
 
The Deconstruction of Red Bull (7 P's)
The Deconstruction of Red Bull (7 P's)The Deconstruction of Red Bull (7 P's)
The Deconstruction of Red Bull (7 P's)
 
Snickers Spin to Win - An Ad Campaign
Snickers Spin to Win - An Ad CampaignSnickers Spin to Win - An Ad Campaign
Snickers Spin to Win - An Ad Campaign
 
Red Bull
Red BullRed Bull
Red Bull
 
Aula 05 Briefing
Aula 05   BriefingAula 05   Briefing
Aula 05 Briefing
 
Starbucks final
Starbucks   finalStarbucks   final
Starbucks final
 
Logo Design basics
Logo Design basicsLogo Design basics
Logo Design basics
 
Coca-Cola Presentation
Coca-Cola PresentationCoca-Cola Presentation
Coca-Cola Presentation
 
Starbucks
StarbucksStarbucks
Starbucks
 

Similar to Toy robot simulator

TP_Webots_7mai2021.pdf
TP_Webots_7mai2021.pdfTP_Webots_7mai2021.pdf
TP_Webots_7mai2021.pdfkiiway01
 
Lewis brady engine_terminology (edited version)
Lewis brady engine_terminology (edited version)Lewis brady engine_terminology (edited version)
Lewis brady engine_terminology (edited version)LewisB2013
 
design the implementation of trajectory path of the robot using parallel loop
design the implementation of trajectory path of the robot using parallel loopdesign the implementation of trajectory path of the robot using parallel loop
design the implementation of trajectory path of the robot using parallel loopAnkita Tiwari
 
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.Ankita Tiwari
 
Design the implementation of Brushless DC Motor Six Step Control.
Design the implementation of Brushless DC Motor Six Step Control.Design the implementation of Brushless DC Motor Six Step Control.
Design the implementation of Brushless DC Motor Six Step Control.Ankita Tiwari
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?Pin-Ying Tu
 
222066369 clad-study-guide
222066369 clad-study-guide222066369 clad-study-guide
222066369 clad-study-guidehomeworkping9
 
ECET 3640 Group 2 Project Report
ECET 3640 Group 2 Project ReportECET 3640 Group 2 Project Report
ECET 3640 Group 2 Project ReportLogan Isler
 
Design the implementation of Robotic Simulator: Goalkeeper.
Design the implementation of Robotic Simulator: Goalkeeper.Design the implementation of Robotic Simulator: Goalkeeper.
Design the implementation of Robotic Simulator: Goalkeeper.Ankita Tiwari
 
Lentin joseph learning robotics using python design, simulate, program, an...
Lentin joseph   learning robotics using python  design, simulate, program, an...Lentin joseph   learning robotics using python  design, simulate, program, an...
Lentin joseph learning robotics using python design, simulate, program, an...Rajmeet Singh
 
Visual Studio Mobile Center: A story about mobile DevOps
Visual Studio Mobile Center: A story about mobile DevOpsVisual Studio Mobile Center: A story about mobile DevOps
Visual Studio Mobile Center: A story about mobile DevOpsGeert van der Cruijsen
 
JetBot basic motion
JetBot basic motionJetBot basic motion
JetBot basic motionPeiJia5
 
10 robotic manufacturing systems
10    robotic manufacturing systems10    robotic manufacturing systems
10 robotic manufacturing systemsGanesh Murugan
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerBill Scott
 
Presentation IOT Robot
Presentation IOT RobotPresentation IOT Robot
Presentation IOT RobotVatsal N Shah
 

Similar to Toy robot simulator (20)

TP_Webots_7mai2021.pdf
TP_Webots_7mai2021.pdfTP_Webots_7mai2021.pdf
TP_Webots_7mai2021.pdf
 
Lewis brady engine_terminology (edited version)
Lewis brady engine_terminology (edited version)Lewis brady engine_terminology (edited version)
Lewis brady engine_terminology (edited version)
 
RobotStudiopp.ppt
RobotStudiopp.pptRobotStudiopp.ppt
RobotStudiopp.ppt
 
ie450RobotStudio.ppt
ie450RobotStudio.pptie450RobotStudio.ppt
ie450RobotStudio.ppt
 
First fare 2010 lab-view overview
First fare 2010 lab-view overviewFirst fare 2010 lab-view overview
First fare 2010 lab-view overview
 
First fare 2013 basic-labview
First fare 2013   basic-labviewFirst fare 2013   basic-labview
First fare 2013 basic-labview
 
design the implementation of trajectory path of the robot using parallel loop
design the implementation of trajectory path of the robot using parallel loopdesign the implementation of trajectory path of the robot using parallel loop
design the implementation of trajectory path of the robot using parallel loop
 
ABB training report
ABB training reportABB training report
ABB training report
 
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
Design the implementation of 1D Kalman Filter Encoder and Accelerometer.
 
Design the implementation of Brushless DC Motor Six Step Control.
Design the implementation of Brushless DC Motor Six Step Control.Design the implementation of Brushless DC Motor Six Step Control.
Design the implementation of Brushless DC Motor Six Step Control.
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
 
222066369 clad-study-guide
222066369 clad-study-guide222066369 clad-study-guide
222066369 clad-study-guide
 
ECET 3640 Group 2 Project Report
ECET 3640 Group 2 Project ReportECET 3640 Group 2 Project Report
ECET 3640 Group 2 Project Report
 
Design the implementation of Robotic Simulator: Goalkeeper.
Design the implementation of Robotic Simulator: Goalkeeper.Design the implementation of Robotic Simulator: Goalkeeper.
Design the implementation of Robotic Simulator: Goalkeeper.
 
Lentin joseph learning robotics using python design, simulate, program, an...
Lentin joseph   learning robotics using python  design, simulate, program, an...Lentin joseph   learning robotics using python  design, simulate, program, an...
Lentin joseph learning robotics using python design, simulate, program, an...
 
Visual Studio Mobile Center: A story about mobile DevOps
Visual Studio Mobile Center: A story about mobile DevOpsVisual Studio Mobile Center: A story about mobile DevOps
Visual Studio Mobile Center: A story about mobile DevOps
 
JetBot basic motion
JetBot basic motionJetBot basic motion
JetBot basic motion
 
10 robotic manufacturing systems
10    robotic manufacturing systems10    robotic manufacturing systems
10 robotic manufacturing systems
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partner
 
Presentation IOT Robot
Presentation IOT RobotPresentation IOT Robot
Presentation IOT Robot
 

More from pauldeng

Deng Peng document template
Deng Peng document templateDeng Peng document template
Deng Peng document templatepauldeng
 
Programming The Real World
Programming The Real WorldProgramming The Real World
Programming The Real Worldpauldeng
 
Scaling a Rich Client to Half a Billion Users
Scaling a Rich Client to Half a Billion UsersScaling a Rich Client to Half a Billion Users
Scaling a Rich Client to Half a Billion Userspauldeng
 
Arch Rock Overview
Arch Rock OverviewArch Rock Overview
Arch Rock Overviewpauldeng
 
无线识别技术
无线识别技术无线识别技术
无线识别技术pauldeng
 
Issnip Presentation
Issnip PresentationIssnip Presentation
Issnip Presentationpauldeng
 
6 Lo Wpan Tutorial 20080206
6 Lo Wpan Tutorial 200802066 Lo Wpan Tutorial 20080206
6 Lo Wpan Tutorial 20080206pauldeng
 
Programming The Real World
Programming The Real WorldProgramming The Real World
Programming The Real Worldpauldeng
 
Acceleration Based Hci Prototype
Acceleration Based Hci PrototypeAcceleration Based Hci Prototype
Acceleration Based Hci Prototypepauldeng
 
Sunspot Final
Sunspot FinalSunspot Final
Sunspot Finalpauldeng
 
Anonymizing Networks
Anonymizing NetworksAnonymizing Networks
Anonymizing Networkspauldeng
 
Anonymous Network
Anonymous NetworkAnonymous Network
Anonymous Networkpauldeng
 
IDEA Lab Presentation
IDEA Lab PresentationIDEA Lab Presentation
IDEA Lab Presentationpauldeng
 
Introduction To SPOT
Introduction To SPOTIntroduction To SPOT
Introduction To SPOTpauldeng
 

More from pauldeng (19)

Deng Peng document template
Deng Peng document templateDeng Peng document template
Deng Peng document template
 
Programming The Real World
Programming The Real WorldProgramming The Real World
Programming The Real World
 
V We
V WeV We
V We
 
Final
FinalFinal
Final
 
Scaling a Rich Client to Half a Billion Users
Scaling a Rich Client to Half a Billion UsersScaling a Rich Client to Half a Billion Users
Scaling a Rich Client to Half a Billion Users
 
Arch Rock Overview
Arch Rock OverviewArch Rock Overview
Arch Rock Overview
 
无线识别技术
无线识别技术无线识别技术
无线识别技术
 
Issnip Presentation
Issnip PresentationIssnip Presentation
Issnip Presentation
 
6 Lo Wpan Tutorial 20080206
6 Lo Wpan Tutorial 200802066 Lo Wpan Tutorial 20080206
6 Lo Wpan Tutorial 20080206
 
Programming The Real World
Programming The Real WorldProgramming The Real World
Programming The Real World
 
Acceleration Based Hci Prototype
Acceleration Based Hci PrototypeAcceleration Based Hci Prototype
Acceleration Based Hci Prototype
 
Sunspot Final
Sunspot FinalSunspot Final
Sunspot Final
 
Anonymizing Networks
Anonymizing NetworksAnonymizing Networks
Anonymizing Networks
 
Anonymous Network
Anonymous NetworkAnonymous Network
Anonymous Network
 
Idea Lab
Idea LabIdea Lab
Idea Lab
 
IDEA Lab Presentation
IDEA Lab PresentationIDEA Lab Presentation
IDEA Lab Presentation
 
Sunspot
SunspotSunspot
Sunspot
 
Sunspot
SunspotSunspot
Sunspot
 
Introduction To SPOT
Introduction To SPOTIntroduction To SPOT
Introduction To SPOT
 

Recently uploaded

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 

Recently uploaded (20)

%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Toy robot simulator

  • 1. XXX Code Test Toy Robot Simulator 1 April 2015
  • 2. Paul Peng Deng I am an experienced and enthusiastic full stack IoT (Internet of Things) application developer. Have hands-on experience in wide range of wireless communication protocols and big data cloud applications. With innovation in my genes, I translate my idea into design and working prototype rapidly to evaluate potential new products or services. I currently work for Intercel Australia in Melbourne and open for all opportunities. Author
  • 3. Revision History Revision Date Comments 0.1 20 January 2015 Draft 0.2 21 January 2015 Test, UML, How to Run, Future Work 0.3 22 January 2015 Typos, text format, rephrase sentences Licence Creative Commons Attribution 4.0 International (CC BY 4.0) You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material for any purpose, even commercially. The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
  • 4.  http://dengpeng.de 1 TOY ROBOT SIMULATOR Table of Contents Requirements............................................................................................................................... 2 Description ............................................................................................................................... 2 Constraints............................................................................................................................... 2 Example Input and Output....................................................................................................... 3 Deliverables.............................................................................................................................. 3 Paul Deng’s Java Implementation .............................................................................................. 4 Deliverables.............................................................................................................................. 4 How to Run............................................................................................................................... 4 UML .......................................................................................................................................... 4 Test........................................................................................................................................... 5 Summary.............................................................................................................................. 5 Junit Test Cases .................................................................................................................. 5 Future Work............................................................................................................................ 10 Requirements Verification................................................................................................. 10 Code Quality Improvements.............................................................................................. 10 Use Design Pattern............................................................................................................ 10 Add Interactive Mode ........................................................................................................ 10 Better Test Coverage......................................................................................................... 11 Better In-Line Comments................................................................................................... 11 Better Version Control ....................................................................................................... 11 Better Documentation ....................................................................................................... 11 Add UI................................................................................................................................. 11 Similar Projects and Implementations ..................................................................................... 11 Notes .......................................................................................................................................... 12
  • 5.  http://dengpeng.de 2 TOY ROBOT SIMULATOR Requirements Description  The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.  There are no other obstructions on the table surface.  The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement commands must still be allowed. Create an application that can read in commands of the following form - PLACE X,Y,F MOVE LEFT RIGHT REPORT  PLACE will put the toy robot on the table in position X,Y and facing NORTH, SOUTH, EAST or WEST.  The origin (0,0) can be considered to be the SOUTH WEST most corner.  The first valid command to the robot is a PLACE command, after that, any sequence of commands may be issued, in any order, including another PLACE command. The application should discard all commands in the sequence until a valid PLACE command has been executed.  MOVE will move the toy robot one unit forward in the direction it is currently facing.  LEFT and RIGHT will rotate the robot 90 degrees in the specified direction without changing the position of the robot.  REPORT will announce the X,Y and F of the robot. This can be in any form, but standard output is sufficient.  A robot that is not on the table can choose then ignore the MOVE, LEFT, RIGHT and REPORT commands.  Input can be from a file, or from standard input, as the developer chooses.  Provide test data to exercise the application. Constraints The toy robot must not fall off the table during movement. This also includes the initial placement of the toy robot. Any move that would cause the robot to fall must be ignored.
  • 6.  http://dengpeng.de 3 TOY ROBOT SIMULATOR Example Input and Output a) PLACE 0,0,NORTH MOVE REPORT Output: 0,1,NORTH b) PLACE 0,0,NORTH LEFT REPORT Output: 0,0,WEST c) PLACE 1,2,EAST MOVE MOVE LEFT MOVE REPORT Output: 3,3,NORTH Deliverables The Ruby source files, the test data and any test code. It is not required to provide any graphical output showing the movement of the toy robot.
  • 7.  http://dengpeng.de 4 TOY ROBOT SIMULATOR Paul Deng’s Java Implementation  Java implementation  File input only. Does not accept input interactively from keyboard  Command line application, no GUI Deliverables Deliverables can be downloaded from: http://dengpeng.de/wp- content/uploads/2015/01/ToyRobotSimulator.zip  Executable JAR: ToyRobotSimulator/dist/ToyRobotSimulator.jar  Java Source File: ToyRobotSimulator/src  Project Document (this document): ToyRobotSimulator/docs/Toy Robot Simulator.pdf  Junit Source Files: ToyRobotSimulator/src/toyrobotsimulator_testcases  Junit Test Case Input Files: ToyRobotSimulator/testFiles How to Run UML Class Diagram
  • 8.  http://dengpeng.de 5 TOY ROBOT SIMULATOR Test Summary This table below extracts requirements from project description and concludes with test cases and test results. For detail of each individual test case, please read the next section. # Requirements Test Cases # Results 1 Any movement that would result in the robot falling from the table must be prevented, however further valid movement commands must still be allowed. 16, 17, 18, 19 Pass 2 The first valid command to the robot is a PLACE command. 05, 06 Pass 3 Any sequence of commands may be issued, in any order, including another PLACE command. 07 Pass 4 The application should discard all commands in the sequence until a valid PLACE command has been executed. 07 Pass 5 MOVE will move the toy robot one unit forward in the direction it is currently facing. 13, 14, 15, 16, 17, 18, 19 Pass 6 LEFT and RIGHT will rotate the robot 90 degrees in the specified direction without changing the position of the robot. 13, 14, 15, 16, 17, 18, 19 Pass 7 REPORT will announce the X,Y and F of the robot. 13, 14, 15, 16, 17, 18, 19 Pass 8 A robot that is not on the table can choose then ignore the MOVE, LEFT, RIGHT and REPORT commands. 05, 08 Pass 9 The toy robot must not fall off the table during movement 16, 17, 18, 19 Pass 10 This also includes the initial placement of the toy robot. 08 Pass 11 Any move that would cause the robot to fall must be ignored. 16, 17, 18, 19 Pass 12 Example input and output a, b, c 13, 14, 15 Pass Junit Test Cases 1. Missing argument Input: java –jar ToyrobotSimulator Expected output: Only accept 1 argument, 0 given. 2. Too many arguments Input: java –jar ToyrobotSimulator too many arguments Expected output: Only accept 1 argument, 3 given. 3. Invalid input file Input: java –jar ToyrobotSimulator ../testFiles/file_not_exist.txt Expected output: File not found: ../testFiles/file_not_exist.txt
  • 9.  http://dengpeng.de 6 TOY ROBOT SIMULATOR 4. Empty input file Input: java –jar ToyrobotSimulator ../testFiles/TestCase_04_EmptyInputFile.txt Expected output: Empty file: ../testFiles/TestCase_04_EmptyInputFile.txt 5. PLACE command missing Input commands: MOVE REPORT Expected output: Invalid command file: testFiles/TestCase_05_PLACECommandMissing.txt Notes In this implementation, no PLACE command means this file is invalid or corrupted. However, further verification is required with the QA team or customer, in order to meet the exact specification. 6. Invalid PLACE command Input commands: PLACE 0,southeast LEFT REPORT Expected output: Invalid command file: testFiles/TestCase_06_InvalidPLACECommand.txt Notes In this implementation, invalid PLACE command means this file is invalid or corrupted. However, further verification is required with the QA team or customer, in order to meet the exact specification. 7. Duplicate PLACE commands Input commands: MOVE REPORT PLACE 1,2,EAST PLACE 0,0,NORTH MOVE REPORT PLACE 0,0,NORTH LEFT REPORT PLACE 1,2,EAST MOVE MOVE LEFT MOVE REPORT Expected output: Output: 0,1,NORTH Output: 0,0,WEST Output: 3,3,NORTH 8. PLACE outside of table Input commands: PLACE 10,10,NORTH
  • 10.  http://dengpeng.de 7 TOY ROBOT SIMULATOR MOVE REPORT Expected output: Invalid command file: testFiles/TestCase_08_PLACEOutsideOfTable.txt Notes: In this implementation, PLACE outside of table means it is an invalid PLACE command. However, further verification is required with the QA team or customer, in order to meet the exact specification. 9. Invalid MOVE, LEFT and RIGHT command Input commands: PLACE 1,2,EAST movebla leftbla rightbla REPORT Expected output: Output: 1,2,EAST 10. REPORT command missing Input commands: PLACE 1,2,EAST MOVE MOVE LEFT MOVE Expected output: Notes: In this implementation, missing REPORT is considered valid, thus no output. However, further verification is required with the QA team or customer, in order to meet the exact specification. 11. Invalid REPORT command Input commands: PLACE 1,2,EAST MOVE MOVE LEFT MOVE REPORTbla Expected output: Notes: In this implementation, invalid REPORT is ignored, thus no output. However, further verification is required with the QA team or customer, in order to meet the exact specification. 12. Unsolicited command Input commands: PLACE 1,2,EAST MOVE MOVE LEFT MOVE This is a unsolicited command line
  • 11.  http://dengpeng.de 8 TOY ROBOT SIMULATOR REPORT Expected output: Notes: In this implementation, invalid command is ignored. However, further verification is required with the QA team or customer, in order to meet the exact specification. 13. Test case a This test case is from project description. Input commands: PLACE 0,0,NORTH MOVE REPORT Expected output: Output: 0,1,NORTH 14. Test case b This test case is from project description. Input commands: PLACE 0,0,NORTH LEFT REPORT Expected output: Output: 0,0,WEST 15. Test case c This test case is from project description. Input commands: PLACE 1,2,EAST MOVE MOVE LEFT MOVE REPORT Expected output: Output: 3,3,NORTH 16. Move North outbound Input commands: PLACE 0,0,NORTH MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE
  • 12.  http://dengpeng.de 9 TOY ROBOT SIMULATOR MOVE MOVE MOVE MOVE RIGHT MOVE REPORT Expected output: Output: 1,4,EAST 17. Move South outbound Input commands: PLACE 0,0,SOUTH MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE LEFT MOVE REPORT Expected output: Output: 1,0,EAST 18. Move West outbound Input commands: PLACE 0,0,WEST MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE RIGHT MOVE REPORT Expected output: Output: 0,1,NORTH
  • 13.  http://dengpeng.de 10 TOY ROBOT SIMULATOR 19. Move East outbound Input commands: PLACE 0,0,EAST MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE MOVE LEFT MOVE REPORT Expected output: Output: 4,1,NORTH Future Work Requirements Verification The following requirements are not clear and need to go back to Project Manager/Customer to have further verification.  Test Case 05: PLACE Command Missing  Test Case 06: Invalid PLACE Command  Test Case 08: PLACE Outside of Table  Test Case 10: REPORT Command Missing  Test Case 11: Invalid REPORT Command  Test Case 12: Unsolicited command Code Quality Improvements Due to the time restriction, the code quality is not very good. Further optimization is required. Use Design Pattern This is a simple application, I decide not to use any design pattern. However, with the time goes on, new features will be added and it may need to use a proper design pattern to increase code reuse and maintainability. Add Interactive Mode This application only implements file IO. The next version should accept input in real time and print out result immediately.
  • 14.  http://dengpeng.de 11 TOY ROBOT SIMULATOR Better Test Coverage Some complex scenarios are not tested in this version, due to time restriction. Future version should cover them, for example:  multiple PLACE commands with invalid and valid commands mixed  different OSs and different JVMs Better In-Line Comments Ad-hoc in line comments in place. However, it is not idea and should use proper format which aligns with company code policy. Better Version Control SVN or Git is not used for this simple application. Better Documentation Only class diagram is presented in this document. Sequence diagram is required to explain how this application works internally. Add UI Attracts more customers. Similar Projects and Implementations  Ruby implementation: https://github.com/huwr/toy-robot-simulator  js and html5 implementation: http://lisalu.com.au/toy-robot-simulator-using- javascript-and-html5/  js implementation: http://jsfiddle.net/lisatinglu/cBm2Z/light/  Java implementation: https://groups.google.com/forum/#!msg/happy- programming/O0-lg6yn1F0/O8E_8qXGvk4J  Ruby implementation: http://thatalexguy.com/posts/2013-07-15-failure-to- code.html  Discussion: https://joneaves.wordpress.com/2014/07/21/toy-robot-coding-test/  Java implementation: https://github.com/alexwibowo/Robot
  • 16. 1 April 2015  http://dengpeng.de Contact  dengpeng.cn@gmail.com Skype: dengpengcd QQ: 285637 LinkedIn: http://au.linkedin.com/in/ pengdeng/  中国电邮请发送到 paul.deng@foxmail.com