Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts
Wednesday, March 15, 2017
Monday, January 30, 2017
'Toy Robot' Review by Ryan Bigg (@ryanbigg)
I have started working through a book called Toy Robot by Ryan Bigg, who explains in his introduction:
All my posts about this book will be labeled "toyrobot", so you can call up all the posts to date at your leisure.
As per the book, I used the bundler gem to create a project tree, which is made available on github: https://github.com/clockworkpc/toy_robot
Let's see how it goes!
In this book, I’m going to go through how I would implement the Toy Robot exercise myself in Ruby, just for demonstration purposes. I’ll be building it up piece-by-piece with the overall aim to be to help anyone reading how to think through and implement this problem.Having just completed "Learn Ruby the Hard Way" I hope to refine my skills by working through Bigg's book.
All my posts about this book will be labeled "toyrobot", so you can call up all the posts to date at your leisure.
As per the book, I used the bundler gem to create a project tree, which is made available on github: https://github.com/clockworkpc/toy_robot
Let's see how it goes!
Thursday, January 26, 2017
Monday, January 23, 2017
Project Complete!
I have finished re-writing my text adventure game, Tree House Prince, available here: (https://github.com/clockworkpc/tree-house-prince)
It is a very simple game, but I am proud of all the things I learned to get it into this shape.
The game demonstrates my grasp of conditionals, classes, inheritance, and automation testing. Every scene in the game has full module testing in Rakefile; the integration testing has to be done manually at this stage. (I will learn about that soon!)
Wednesday, January 18, 2017
Tuesday, January 17, 2017
User Testing Update
I've had to hit the books again to improve my understanding of variables, classes, and methods.
I've been re-writing my text adventure game so that every aspect of it is tested by the Rakefile. This means that I have had to extrapolate the logic of the enter() method in each class, so that a test can be written for it.
The most interesting parts of the game involve somewhat complex conditionals, written as case conditionals, and for some reason it took me a while to understand how to pass on a variable to the method containing a case conditional. Now that I look at it again, it's very simple, but c'est la vie.
Anyway, the re-written game is nearing completion and the latest code is up on Github.
Wednesday, January 11, 2017
Ruby Hack Night Review (2017-01-11)
The first Melbourne Ruby Hack Night, hosted by REA Group, was every bit as good as I had hoped.
It was my first proper hacking event since my Linux Victoria days, and it was exciting to sit in a room full of people who really enjoy their code. The atmosphere at the event was the right mix of serious keyboard tapping and light-hearted conversation, and the venue is really quite comfortable.
We started at 18:00 and worked each of us fairly quietly for about an hour, until the pizzas were delivered. We downed tools and enjoyed some good food and friendly conversation. After doing the schmoozing rounds, we drifted back to our computers, and the evening passed by pleasurably and productively until the end of the evening at 21:00.
I was especially pleased to get some much needed help with my test automation, and my vastly improved code will be ready for a push to Github tomorrow, once I've tidied up some loose ends.
(Update: The next version of the code I was working is available)
Many thanks to the organisers and I'm looking forward to the next Melbourne Ruby Hack Night.
![]() |
| Check out Ruby and Rails Melbourne on Meetup. |
We started at 18:00 and worked each of us fairly quietly for about an hour, until the pizzas were delivered. We downed tools and enjoyed some good food and friendly conversation. After doing the schmoozing rounds, we drifted back to our computers, and the evening passed by pleasurably and productively until the end of the evening at 21:00.
I was especially pleased to get some much needed help with my test automation, and my vastly improved code will be ready for a push to Github tomorrow, once I've tidied up some loose ends.
(Update: The next version of the code I was working is available)
Many thanks to the organisers and I'm looking forward to the next Melbourne Ruby Hack Night.
Monday, January 2, 2017
Getting started with Rakefile and testing
Up to chapter 47 of Learn Ruby the Hard Way, and I have uploaded version 0.01 of my little text adventure, Treehouse Prince.
https://github.com/clockworkpc/treehouseprince/tree/master/skeleton
The purpose of working on this is to familiarise myself with the fundamentals of testing. As I put back all the components of the game, I shall get to see how the Rakefile saves me running the game manually a thousand times over.
https://github.com/clockworkpc/treehouseprince/tree/master/skeleton
The purpose of working on this is to familiarise myself with the fundamentals of testing. As I put back all the components of the game, I shall get to see how the Rakefile saves me running the game manually a thousand times over.
Wednesday, December 14, 2016
Thursday, December 8, 2016
First Small Step Into Testing
I am working on Exercise 28 of Learn Ruby the Hard Way and this is my first concrete example of using testing in the course of coding.
The exercise is a test of boolean logic: I am given a statement e.g.
And must work out whether it is "true" or "false".
As you can see, I have organised the statements in a two-dimensional array in which each sub-array is composed of three elements: a string denoting the statement, the statement itself, and my prediction.
The exercise is a test of boolean logic: I am given a statement e.g.
true == true
And must work out whether it is "true" or "false".
As you can see, I have organised the statements in a two-dimensional array in which each sub-array is composed of three elements: a string denoting the statement, the statement itself, and my prediction.
# List of boolean statements to test my knowledge thereof, organised in a two-dimensional array booleanTest = [ ["true && true", true && true, true], ["false && true", false && true, false], ["1 == 1 && 2 == 1", 1 == 1 && 2 == 1, false], ['"test" == "test"', "test" == "test", true], ["1 == 1 || 2 != 1", 1 == 1 || 2 != 1, true], ["true && 1 == 1", true && 1 == 1, true], ["false && 0 != 0", false && 0 != 0, false], ["true || 1 == 1", true || 1 == 1, true], ['"test" == "testing"', "test" == "testing", false], ["1 != 0 && 2 == 1", 1 != 0 && 2 == 1, false], ['"test" != "testing"', "test" != "testing", true], ['"test" == 1', "test" == 1, false], ["!(true && false)", !(true && false), true], ["!(1 == 1 && 0 != 1)", !(1 == 1 && 0 != 1), false], ["!(10 == 1 || 1000 == 1000)", !(10 == 1 || 1000 == 1000), false], ["!(1 != 10 || 3 == 4)", !(1 != 10 || 3 == 4), true] ]I test my prediction by running the following testing loop, and in keeping with the practice of "green" for good and "red" for error, I installed the colorize gem and applied it to the output of the testing loop.
# Required in order to highlight the text in the testing loop green or red.
# Colorize gem to mark the result green or red.
require 'colorize'
# Testing loop
puts "Here are the results of my test:\n\n"
booleanTest.each do|description,result,prediction|
puts "PREDICTION: #{description} GIVES #{prediction}, RESULT: #{result}"
if prediction == result
puts "Correct!".colorize(:green)
else
puts "Incorrect!".colorize(:red)
end
end
And here are the results:
Subscribe to:
Posts (Atom)
1,050 hours
It took me 13 working days to complete my first 100 "work" pomodoros as a Junior Software Tester at Profectus Group. Much of ...
-
I have finished re-writing my text adventure game, Tree House Prince, available here: ( https://github.com/clockworkpc/tree-house-prince...
-
NOTE: My fiancée wishes to stay out of the online limelight, and neither her real name nor her image shall appear in this or future posts. ...
-
It's 03:08 and I am finally starting to make sense of object-oriented programming. It's not that I didn't understand it concep...








