Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Specification, Design, Implementation, Testing and Documentation - stages of a (Java) programming project

There are two key factors in writing even a simple program - working out what you want to do / how you're going to do it, and then actually doing it in the language of your choice. Call the two phases "design" and "implementation" if you like.

The design phase can be very much more 'free format' - artistic, and the implemetation is more prescriptive - scientific. And as a result, different grous / types of people will find one phase, or the other, the more challenging. There are those who can see the design easily but have trouble reducing it to the very specific and accurate code statementas, and there are those who struggle with the design, but can then easily convert it into code when they have the design figured.

It's a good idea to split the phases - design and inplementtion - somehow. And it's worth adding a third phase - specification ("describing the problem") onto the beginning. Many is the system that's been written where the specification hasn't clearly been defined, which has resulted in a very nice final program ... which won't actually do what it was intended for!

It's a good idea to split the phases - design and inplementtion - somehow. And it's worth adding a third phase - specification ("describing the problem") onto the beginning. Many is the system that's been written where the specification hasn't clearly been defined, which has resulted in a very nice final program ... which won't actually do what it was intended for!

Let's take an example showing each of the phases - from my Java course earlier this week. (The fact that the target language is Java doesn't effect the first steps - but becomes vital in the final coding step).

Specification

Working out what you really want.

"How long a train do I need to take "xxxx" passengers to Weymouth?"

is translated into

"Given an expected number of passengers, work out the minimum number of carriages on a train such that 4 seats in 5 will be occupied. Railway carriages on this line can take up to 75 seated passengers and note that there's a limit of 5 carriages per train on the service you're working out"

Design

Start off by setting (as constants) values that don't change. The ask the user to enter the number of travellers.

Write a loop to start off with one carriage, and see what the loading factor is. Keep adding further carriages in a loop until (a) the loading factor is less that 80% or (b) the train is 5 carriages long.

Print out the train length required, and what the laoding factor will be. It might be a good idea to revisit the specification at this point and decide whether or not to add a further output if the train is 5 cars long to say whether the loading factor is within specification, if the train will be very full indeed, or if people will actully have to stand.

Implementation

This is the bit where you translate into code. I would suggest setting up the framework of the program first (the public class and method main in Java), and then writing the design into the code in the form of comment statements. You can then fill in the code.

Testing

Beyond the writing process, do not forget testing (and you may jump back to earlier stages as you test). Try the code initially with easy, know user inputs that you can work out for yourself. Try a couple of more complex ones. Think of all the special cases that may occur and try each of them. Try things that you know are wrong, and make sure that you program handles them in an appropriate way.

Documentation

Remember that you'll need instructions for the user, a description of how the program works for the maintainaince programmer, and appropriate formatting and labelling of the results that the program produces so that the user knows how to read the results (and so does the person who's sent a copy of the results by email!)

There's a completed coded example showing the program I've talked about - up to the coding phase - [here].

Example from our Learning to Program in Java course.
(written 2011-07-21)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Q904 - Object Orientation and General technical topics - Analysing a Programming Task
  [747] The Fag Packet Design Methodology - (2006-06-06)
  [1345] Perl and Shell coding standards / costs of an IT project - (2007-09-11)
  [1513] Perl, PHP or Python? No - Perl AND PHP AND Python! - (2008-01-20)
  [1607] Learning to program in Perl - (2008-04-11)
  [1850] Daisy the Cow and a Pint of Ginger Beer - (2008-10-21)
  [1853] Well structured coding in Perl - (2008-10-24)
  [2327] Planning! - (2009-08-08)
  [2715] Uploading an image, document or pdf via a browser (php) - (2010-04-10)
  [2834] Teaching examples in Perl - third and final part - (2010-06-27)
  [3329] Perl from basics - (2011-06-20)
  [3461] From flowchart to program - code design for the newcomer - (2011-09-29)
  [3895] Flowchart to program - learning to program with Well House - (2012-10-14)


Back to
Turning bright delegates into bright and knowledgable ones
Previous and next
or
Horse's mouth home
Forward to
Google +1 - what is it?
Some other Articles
Standing Challenge
Local Council leads bans on many activities
Well House Manor hotel, Melksham - recommended to you by our customers
Google +1 - what is it?
Specification, Design, Implementation, Testing and Documentation - stages of a (Java) programming project
Turning bright delegates into bright and knowledgable ones
Dogs Legs on the Dogleg
Should we take sponsored adverts on our site?
Swindon, Chippenham and Melksham to Weymouth - Sunday Train Service Starts
Blowing our own trumpet - MySQL resources
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 http://www.wellho.net/horse/ - 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).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/3366_Spe ... oject.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb