Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
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 to go a stage further, though - I'm going to encourage you to write the tests before you write the code, and have the tests form the specification. As the code grows, and functioanllity is added, you can add extra tests to your test pattern and by rerunning your tests each time you add to or alter the code, and then testing will make sure you've not damaged something else.
There are packages and fucntions to help you write your test driven development
softwares, and unit testing
stuff to let you separate your tests, and to manage the results. However, today I was teaching "Learning to program in C" and those extra routines use code that's far too sophisticted on day 1, so I wrote some simple stuff directly in C.
Code to be tested - [here]
Include file (headers) - [here]
Test code - [here]
You'll note that I've printed out results all through the tests, but then sent a final status out to stderr
. That way I can run the tests in a verbose mode, but if I just want to see if it all works I can redirect stdout
Result is 24.54
Result is 0
Result is 56.82
Result is 1
Result is 18.08
Result is -1
trainee@kingston:~/c_dec14$ ./tdd > /dev/null
All of our courses emphasise excellent coding practise and advocate its application from early on - our course schedule is [here]
. The example here is a very basic one, but we'll establish this principle at the start of your course and then make sure you write good, testable code for ever. (written 2014-12-01)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesC208 - C and C based languages - Programming techniques and tools 
Segmentation Fault, Segmentation Violation, Bus Error, Stack Smashing - (2014-12-04)Q456 - Object Orientation and General technical topics - Test Driven Development and Behaviour Driven Development 
Testing new algorithms in PHP - (2016-02-20) 
Regression testing - via a very short C testing framework - (2016-01-29) 
The principle of mocking - and the Python Mock package - (2015-10-17) 
Test framework for TCL - Tcltest - some examples - (2015-03-11) 
Regression Testing my website - Cucumber and Watir - (2015-01-07) 
Behaviour Driven Development / Ruby and Cucumber - (2015-01-02) 
Test driven development, and class design, from first principles (using C++) - (2014-12-30) 
A behaviour driven example of writing a Java program - (2014-12-09) 
Learning to program - comments, documentation and test code - (2014-11-22)
Some other Articles
Command line and file handling in CSimple C structs - building up to full, dynamic examplePassing arrays into functions in CLearning to program sample program - past its prime, but still usefulTest Driven Development - a first example of principle in CFlexible public courses - residential or commuting, programming newcomer or experienced, C or C++Splitting out code into name blocks for clarity and reusabilityMisty Melksham MorningFirst Java Application - calculating the weight of a tableclothMusings on a Welsh town
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page
This is a page archived from The Horse's Mouth at
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).