Keynote article ...
|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 log files - loading data into dynamic (realloc'd arrays of structs, and then extracting data from those structures. And we wrote an initial main routine to run and test from the command line. For initial development, that's great but ...
... the main couldn't remain as we started to build with the logic
... lots of sections / routine groups need testing.
• Rename main to a different name such as test_access and leave it in the original file
• build a tiny test harness that runs each set of tests and correlates the results
• have the test harness send standard output (stdout) within the tests to a file
A rudemintary regression testing system, where each time you add a new set of routines or change something, you can rerun all the tests and get an automated set of replies.
The results of running the test suite look a bit boring:
WomanWithCat:cj16 grahamellis$ ./framework
Failed 1 test(s) out of 4, passed 3
Commented framework source is [here] and tests and routines to be tested [here] and [here].
(this article written on 2016-01-29)
Other articles ...
shell - bash. Writing conditional tests and statements - the options available
Extending your bash shell with aliases, functions and extra commands
What is make? What is gcc?
Bash ... some new scripts to - handling user input
Web Server Admin - some of those things that happen, and solutions
or Show all for Linux and Shell Programming
Can a legitimate forum post become illegal a year later?
Change to Libel and Defamation laws from 1st January 2014
Apache httpd - a robust, open source web server
Helping search engines with appropriate 400 error codes
Handling failures / absences of your backend server nicely
or Show all for Apache HTTP and Tomcat Servers
Encapsulating logic in functions and structs - the C approach to Object Oriented techniques - (new - 2016-01-30)
Regression testing - via a very short C testing framework - (new - 2016-01-29)
String handling in C - new examples of extracting integers from a string - (new - 2016-01-27)
Remember to ask the question before you listen for the answer - (new - 2016-01-26)
C - why is slow to write and debug) but fast to run?
or Show all for C and C++ Programming
TransWilts Community Interest Company AGM - 13 Feb 2016, Swindon - (new - 2016-02-05)
TransWilts - robust these days - no longer the first service to be cancelled - (new - 2016-01-03)
Management view - TransWilts and transport at the end of 2015 - (new - 2015-12-25)
A near-empty plate of pastries - sign of a breakfast enjoyed
Japanese and Malaysian food in Melksham
or Show all for Melksham
Training course and hotel room prices - 2016 - (new - 2015-12-31)
What teach you in a week stays with you for a decade
Perl, PHP, Python, Lua, Tcl, C++, Ruby - final public courses for 2015
Course Schedule - October 2015 to June 2016
Open source programming courses - October to December 2015
or Show all for Training from Well House Consultants
No cold sales calls please - but delighted to hear from others!
Effect on external factors on traffic to our web sites - an update
Four in a Bed - most popular answers
Seventh stay away this year - and it's still only February!
Buffet review - taking the price into account
or Show all for Running a training and hotel company
In your room at Well House Manor, Melksham, Wiltshire - (new - 2016-02-08)
PC Plod - alive and scaremongering in Wiltshire? - (new - 2016-01-04)
Our best hotel customers help us ... to help them ... be our best customers. - (new - 2016-01-04)
Happy New Year. Our customers are our ambassadors - (new - 2016-01-01)
A warm welcome awaits you at Well House Manor, Melksham
or Show all for Well House Manor - Hotel and Training Centre
Moderation - and the tendency to over-moderate
Almost so wrong, but perhaps it's right for some?
The unbalanced relationship between customer and provider
A booking that looks too good to be true? It probably is too good to be true!
Well House Consultants, Well House Manor, First Great Western Coffee shop, TransWilts / 2014 web site reports
or Show all for For the Webmaster, Postmaster and moderator
Singleton design pattern - examples and uses - (new - 2016-01-20)
From single block to structure and object oriented programming
Principles or a GUI and their practical application using wxPthon
Learning not just what a program does, but how to design it in the first place.
Hello Flask world / Python web micro framework
or Show all for General Programming Topics
A small teaching program - demonstration of principles only - (new - 2016-02-08)
Using an MVC structure - even without a formal framework - (new - 2016-02-07)
Associative objects - one object within another. - (new - 2016-01-20)
Caching results in an object for efficiency - avoiding re-calculation - (new - 2016-01-20)
The power of scripting - (new - 2016-01-12)
or Show all for PHP - the language and its application
Java web application for teaching - now with sessions and clustering / load balancing demonstrations
A Java servlet that is also a stand alone program. And a server that is also a web client.
The spirit of Java - delegating to classes
Using the lead - passing arrays and other collections in Java
Java example - for loop and conditionals from course exercise
or Show all for Java and the Java Environment
Rambling from Westbury - (new - 2016-01-16)
Frosty morning, beauty of Wiltshire - (new - 2016-01-14)
A lovely meal in Swindon - just a short walk from the station
Open for the new year - Imber
New Pictures - Melksham Pack Horse Bridge
or Show all for Around, about and nearby to Wiltshire
Perl 6 - a Practical Extraction and Reporting example! - (new - 2016-01-11)
Hungarian, Camel, Snake and Kebab - variable naming conventions - (new - 2016-01-03)
Sorting by key or by comparator - Perl 6 - (new - 2016-01-03)
Mapping an array / list without a loop - how to do it in Perl 6 - (new - 2016-01-03)
Introspecion in Perl 6 - (new - 2016-01-02)
Classes and object - first steps in Perl 6 - (new - 2016-01-02)
Using Perl 6 to analyse and report on data - (new - 2016-01-02)
Hello World - in Perl 6 - (new - 2016-01-02)
Perl - version 6 - official version launched at Christmas - (new - 2016-01-02)
or Show all for The Perl Programming Language and its use
Problem ... I want to print a series of numbered forms
Sending a message to the server and changing text on a page when a button is pressed
Cascading Style Sheets and formatting your web page
HTML tags uses in these blog articles
Special characters in HTML
Back in the saddle again - excellent open source course from Well House Consultants
Thin application, thick objects - keep you main code simple. Example in Ruby
Easy example - data record to object and object to data record mapping in Ruby
Behaviour and test driven development in Ruby using RSpec
RUby - loading, using, changing, storing JSON format data
or Show all for Ruby and Ruby on Rails
Forgotten / lost MySQL root password
Starting MySQL. ERROR! The server quit without updating PID file - how we fixed it.
Extracting data from backups to restore selected rows from MySQL tables
Fixing damaged MySQL tables - Error 1712 and Error 2013
Checking MySQL database backups have worked (not failed)
or Show all for SQL and MySQL
Still teaching Tcl in 2016? - (new - 2016-01-06)
What does Tcl do if you try to run a command that is not defined?
Tcl - a new example for data reformatting
Catching failed commands and not crashing the program in Tcl
Loading packages in your Tcl program
or Show all for Tcl, Tcl/Tk and Expect
repeat until in Lua - a one or more rather than a zero or more loop
Classic style OO code - in Lua
Tables with values and code in Lua - looks like an object?
Lua - using modules to add your own utilities
Lua - changes to how integers and floats are handled - 5.2 to 5.3
or Show all for Programming in Lua
Pytest - second example beyond hello world - (new - 2016-01-08)
Pytest - starting example - (new - 2016-01-07)
Python formatting update - including named completions - (new - 2015-12-10)
XML handling in Python - a new teaching example using etree
Command line parameter handling in Python via the argparse module
or Show all for Python Programming
From last July (2015) - (new - 2016-02-08)
People matter - but there is a tradeoff between different people in there - (new - 2016-02-01)
Where does Wiltshire bus subsidy money come from? - (new - 2016-01-19)
A big change in August - (new - 2015-12-25)
Happy Christmas - and a Christmas thought - (new - 2015-12-24)
Not standing as your local councillor - (new - 2015-12-18)
or Show all for And also ...
Who was Doctor Beeching and what was his axe? - (new - 2016-02-06)
Working out the costs of running a bus service through the day - (new - 2016-02-06)
Rail user groups worried about what is happening on the buses - (new - 2016-01-31)
What would the Wiltshire Council bus cuts mean for Melksham? - (new - 2016-01-25)
Making travel time useful time on public transport - (new - 2016-01-22)
Campaigning for a sensible bus solution and not against anyone! - (new - 2016-01-17)
Buses - not about the buses, but about the people who use the buses - (new - 2016-01-10)
Questions for First (West of England) - (new - 2016-01-05)
21 places to get your train and bus timetables for TransWilts - (new - 2015-12-19)
Call for help counting passengers - TransWilts, 12th to 14th December - (new - 2015-12-10)
or Show all for Public Transport
The story behind the bus cuts, and what they could mean - (new - 2016-01-24)
Interview conditions,and other instructions to staff
Please do not ask me to be the chair!
On tipping - and the expectation of a tip
The important customers are the majority, not the celebrity
or Show all for Fun and Flames
Brown - or Mrs Sally Brown, accountant from Whitstable?
Looking ahead to the Autumn season of training and accommodation
Where do I start when writing a program?
Past Delegate Offer - Summer Holiday / Weekend Break
Well House Manor Hotel - on plan for 2009 business guests
or Show all for Keynote Articles
If it's Tuesday it must be Belgium?
Throwing a die - exercise in Ruby
Melksham to London by train - dont buy more than you need
TransAtlantic crossing - the starter
A busy January
or Show all for unclassified
A little more about this newsletter ...
At Well House Consultants, we run niche IT training courses ... and we run a hotel for delegates on those courses and other visitors to Melksham too. And we make a lot of friends - have a lot of ambassadors with whom we want to keep in touch. So every day Graham (that's me, writing this piece) puts together an article or two which might include the latest sample programs that I've written during the current course, new information about Well House Manor - our business hotel
, tips on search engine optimisation, announcements of upcoming public courses
, pictures of local places, and even (on occasions) rants and whimsical pieces to keep those friends up to date and in touch. The feeds are available directlt via the Blog - "The Horse's Mouth"
, they're on our Twitter Feed
and you can find me at my LinkedIn profile
. But most people just want to look us up occasionally - every month or two, and then to catch up on the latest news just for their particular subjects of interest
... and that's what this newsletter is about
You'll find above the titles of ALL the new articles written in the last two months, listed by major subject area, and showing as (new)
with their date of publication. You'll find additional articles in each category too - topping each category up to a minimum of five articles. And you'll find a link at the end of each section which lets you expand that section to show the titles of every article that's been published in that section. After all, "the old ones are often the best ones", aren't they?