Exercises, examples and other material relating to training module Q456. This module is presented on Private Courses
and Specially Run Courses
By specifying what a program should do in a natural-like language
you can define a specification, provide program documentations, and
provide runnable and re-uable tests too.
|Articles and tips on this subject
|Testing new algorithms in PHP
During algorithm development, code testing, experiments and spike solutions often account for far more code than the final working code - a classic example of that today where I was writing / testing a loop for Lisa.
Scenario - our booking database holds flags for each of our five hotel bedrooms for ...
|Regression testing - via a very short C testing framework
Code testing is important. Separation of code into separate, managable sections is important. Retesting of code running all the old tests is important when the code sections are enhanced / debugged.
At the end of this week's C course, we wrote a whole series of pieces of logic relating to web server ...
|The principle of mocking - and the Python Mock package
When I'm writing code, or updating existing code, I need to test it before I release it as generally available.
There are lots of tests I might want to perform, to ensure that all conditions are checked, and that all past bugs have been fixed and have not re-appeared. And indeed as I develop the application, ...
|Test framework for TCL - Tcltest - some examples
Tcl ships with the tcltest test suite / harness - and standard advice for coding is to write lots of tests and check with them every time you run your code.
There's a (new) first example [here] - loading in Tcltest and defining 3 tests:
package require tcltest
|Regression Testing my website - Cucumber and Watir
Problem - I update my website to make a change and in doing so break something that's worked for years.
Frequency of occurence - All too often!
And as my website grows over the months and years, so the changes of a change breaking something from the past increases, and so the need for testing increases. ...
|Behaviour Driven Development / Ruby and Cucumber
Articles in this "Introduction to Cucumber" series:
[link] - Installing Cucumber for Ruby
[link] - Hello Test Cucumber World
[link] - First real tests / second example
[link] - Improved tests with RSpec
You write code to meet a requirement. The requirement is that it behaves in a certain ...
|Test driven development, and class design, from first principles (using C++)
I'm teaching OO / class design from first principles today ... in stages. The chosen source language is C++, but the principles are well applied across other OO languages too.
Stage 1 - write your test program to make sure it works for your customers want to do. Remember that the "customer is king" ...
|A behaviour driven example of writing a Java program
A new exercise example just posted from the Java course I'm running this week - contionals, loops, and a few static functions.
The question is to rea from the user how many tables there are in a restaurant, then read the width and length of each table and report on the number of people who can be seated ...
|Test Driven Development - a first example of principle in C
If you're writing a substantial chunk of code, chances are that you'll want to split it down into manageable pieces. By doing so, you can make for re-usable code, for clearer code when you come to maintain your application, and for code that you can test section by section.
I'm going to encourage yu ...
|Learning to program - comments, documentation and test code
Updates material from our courses for newcomers to programming ... we're very happy to help newcomers learn about the basic principles of programming, running an extra day for a very small group on the front of our regular courses for delegates who have programmed before, but in different languages.
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
What is test driven development?
What is behaviour driven development?
Comparison and specificational development.
An example of TDD.
An example of BDD using Cucumber and Ruby.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.