Board index » delphi » Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)

Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)

Hi All,

Today, I supposed should be very happy to submit my PASCAL assignment
in advance to my tutor. I tried this very hard and devoted a great
deal of time in this. Instead, I felt frustrated by the way he handled
the acceptance testing (e.g. try to test whether any bug on my
program). Attached is the PASCAL program submitted to my tutor. I must
admit that there are some parts of the program not very well written.
This is not the point, but the point is that it works very well.
Perfectly no bug, as far as the result of the rotation is concern.

Basically, the program specification is like this. I'm asked to write
a program to capture 10 lines of 10 character strings and rotate the
inputed 10 strings 90 degrees clockwise such that when I rotate 4
times, the the result will return to the original input strings.
Strings greater than 10 characters will be truncated. Strings less
than 10 characters will be padded with blank space. There are no other

restriction on how to design the program logic except that we are
asked to use function or procedure in adherence to modular design
concept.

Usually, when student submit the program for testing, the tester (in
this case my tutor) should only input the test cases that can
potentially identified a bug. No program source code will be touched
by the tutor during the testing process, right?

I was really surprised how my tutor test the program. He asked me to
MODIFIED MY PROGRAM SOURCE CODE FIRST, and then he test the program !
Why should I change my program, for what purpose.
This is ridiculous. The is the first time how an User Acceptance
Testing was carried out during my whole 10 years of IT experience!

He asked me to change the array size from 10 x 10 (specified on the
program specfication) to 5 x 5 array. I must admit that my program
can't cater this because I didn't put this on my mine due the the
following reason :

1. My tutor initially said that you can use any method you like as
long as you can display the result.

2. The program specification didn't mention that I have to cater 5 x 5

array in case tutor changed his mind.

3. We, the student, mostly don't expect the testing procedure will
carried out on this way, that is asking to change the source code
first and test it.

4. In a commercial application user acceptance testing process, have
you heard the user (tutor) ask the developer (the student) to modify
the source code and input the data then? It is the other way around.
User input the test case data and check the result, if something is
wrong, take note on it on a UAT log sheet and pass to the developer
and developer verified the test result. If it is really a bug, then
the program is rectified.

I was told my program have a big BUG! Oh my God! It is not a bug
instead a need to improve program flexibitity to cater 5 x 5 array.

As a matter of giving a face to my teacher in front of a class, I
remain silent and really surprised on the way he handle this case.
If he uses this method of doing acceptance test, I think no student
will accept it.

Any comments on this predicament?

James Lo
MIEEE-CS,MACM
North Point, Hong Kong
e-Mail  : loja...@netvigator.com  (Private)
          U95...@cis.hkuspace.org (School)
          loja...@acm.org         (ACM)
          james...@sema.com.hk    (Office)
HomePage: http://home.netvigator.com/~lojames/index.htm

"Live your life each day as you would climb a mountain.
An occasional glance towards the summit keeps the goal in
mind, but many beautiful scenes are to be observed from
each new vantage point."                                          

James Lo
MIEEE-CS,MACM
North Point, Hong Kong
e-Mail  : loja...@netvigator.com  (Private)
          U95...@cis.hkuspace.org (School)
          loja...@acm.org         (ACM)
          james...@sema.com.hk    (Office)
HomePage: http://home.netvigator.com/~lojames/index.htm

"Live your life each day as you would climb a mountain.
An occasional glance towards the summit keeps the goal in
mind, but many beautiful scenes are to be observed from
each new vantage point."

 

Re:Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)


Quote
Ching Tian wrote:
> Hi All,

> Today, I supposed should be very happy to submit my PASCAL assignment
> in advance to my tutor. I tried this very hard and devoted a great
> deal of time in this. Instead, I felt frustrated by the way he handled
> the acceptance testing (e.g. try to test whether any bug on my
> program). Attached is the PASCAL program submitted to my tutor. I must
> admit that there are some parts of the program not very well written.
> This is not the point, but the point is that it works very well.
> Perfectly no bug, as far as the result of the rotation is concern.

The point is that it works very well *only for the case written for*.
As an approach to algorithm design, it's a failure.

Quote
> [snip]

> I was really surprised how my tutor test the program. He asked me to
> MODIFIED MY PROGRAM SOURCE CODE FIRST, and then he test the program !
> Why should I change my program, for what purpose.
> This is ridiculous. The is the first time how an User Acceptance
> Testing was carried out during my whole 10 years of IT experience!

Ten years and nobody has questioned an algorithm?

Quote
> He asked me to change the array size from 10 x 10 (specified on the
> program specfication) to 5 x 5 array. I must admit that my program
> can't cater this because I didn't put this on my mine due the the
> following reason :

A well-written program would accomodate working properly with any value
assigned to maxchar.  It would use for loops, repeat/until, and while/do
loops to accomplish the functions you unrolled.

Quote
> 1. My tutor initially said that you can use any method you like as
> long as you can display the result.

> 2. The program specification didn't mention that I have to cater 5 x 5
> array in case tutor changed his mind.

Well, I'm curious to see the exact assignment definition.  Nevertheless
I'd be surprised if somewhere in the course the instructor hadn't
covered what passes for good design and what should be avoided (I know I
got this in the entry-level Pascal class I attended).

Quote
> 3. We, the student, mostly don't expect the testing procedure will
> carried out on this way, that is asking to change the source code
> first and test it.

Well, in a language like Pascal, expect it.  Your program IMHO doesn't
meet modularity standards, and would probably be a good deal shorter if
rewritten in modular form.  If you want to do a little independent work,
look back over your code and work on devising a program which will work
no matter what maxchar is.

Quote
> 4. In a commercial application user acceptance testing process, have
> you heard the user (tutor) ask the developer (the student) to modify
> the source code and input the data then? It is the other way around.
> User input the test case data and check the result, if something is
> wrong, take note on it on a UAT log sheet and pass to the developer
> and developer verified the test result. If it is really a bug, then
> the program is rectified.

No, this wouldn't be handled user/developer, it would be handled
QA/developer.  Besides, I can't see how a professional programmer would
qualify as being a professional programmer writing code that way.  I
think the word for it is "kludge".  Sure it may work, but it's a cheap
fix for something that has to be done.

Quote
> I was told my program have a big BUG! Oh my God! It is not a bug
> instead a need to improve program flexibitity to cater 5 x 5 array.

Then what is it -- a feature?

Quote
> As a matter of giving a face to my teacher in front of a class, I
> remain silent and really surprised on the way he handle this case.
> If he uses this method of doing acceptance test, I think no student
> will accept it.

> Any comments on this predicament?

I hope you don't take this too hard, but I'm trying to also take into
consideration what I've experienced in the learning process and be as
fair about it as possible.

Quote
> James Lo
> MIEEE-CS,MACM
> North Point, Hong Kong
> [snip -- some reason for signing twice?]

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Re:Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)


On Sat, 08 Nov 1997 15:14:55 -0500, Scott Earnest

Quote
<set...@ix.netcom.com> wrote:
>James  wrote:

>> Hi All,

>> Today, I supposed should be very happy to submit my PASCAL assignment
>> in advance to my tutor. I tried this very hard and devoted a great
>> deal of time in this. Instead, I felt frustrated by the way he handled
>> the acceptance testing (e.g. try to test whether any bug on my
>> program). Attached is the PASCAL program submitted to my tutor. I must
>> admit that there are some parts of the program not very well written.
>> This is not the point, but the point is that it works very well.
>> Perfectly no bug, as far as the result of the rotation is concern.

>The point is that it works very well *only for the case written for*.
>As an approach to algorithm design, it's a failure.

Yes, I must admit this, it can't cater for cases other than 10 x 10. I
didn't put this on my mind. It is a good approach if I can
incorporated it. The point is that if the tutor inform us that this is
one of the requirements, then the approach I should made will never be
the same. The program specification didn't mention this.

Quote
>> [snip]

>> I was really surprised how my tutor test the program. He asked me to
>> MODIFIED MY PROGRAM SOURCE CODE FIRST, and then he test the program !
>> Why should I change my program, for what purpose.
>> This is ridiculous. The is the first time how an User Acceptance
>> Testing was carried out during my whole 10 years of IT experience!

>Ten years and nobody has questioned an algorithm?

I never use PASCAL programming on my commercial programming. PASCAL
programming is a teaching programming language NOT a application
development language. It gives an idea to the student what is a
modular programming. I used COBOL,VISUAL BASIC, 4GL. Frankly speaking
and in reality, nobody will question your algorithm as long as you can
give the expected correct result. Unless the company has QA software
division that monitosr the quality of the software, otherwise no one
will question it, even your boss. So the quality of the software
produced really depends on the quality of the software developer who
developed it. The newcomer can learn commercial tricks on software
development thru analysing the codes written by those experts.

Quote
>> He asked me to change the array size from 10 x 10 (specified on the
>> program specfication) to 5 x 5 array. I must admit that my program
>> can't cater this because I didn't put this on my mine due the the
>> following reason :

>A well-written program would accomodate working properly with any value
>assigned to maxchar.  It would use for loops, repeat/until, and while/do
>loops to accomplish the functions you unrolled.

Yes, I absolutely agree with you on this point. As a matter of fact, I
use loops construct to accomplish the task. It is just that the number
of input 10 lines of characters procedure seemed awkward.

Quote
>> 1. My tutor initially said that you can use any method you like as
>> long as you can display the result.

>> 2. The program specification didn't mention that I have to cater 5 x 5
>> array in case tutor changed his mind.

>Well, I'm curious to see the exact assignment definition.  Nevertheless
>I'd be surprised if somewhere in the course the instructor hadn't
>covered what passes for good design and what should be avoided (I know I
>got this in the entry-level Pascal class I attended).

OKAY, here's exactly the problem statement given on the assignment
paper.

Q3:

Input any design or pattern from the keyboard into a 10x10 array of
characters. To save keying time, input each row of the array as a
string[10] variable. Then assign each character of the input string to
an array of element of the current row, padding trailing spaces (write
a procedure that will do that task). Write a procedure that will
modify the array to rotate 90 degrees clockwise. Display the rotated
array. Use a REPEAT loop in the main program to allow as many
rotations as the user desires. Four consecutive rotations should bring
back the original pattern.

----end of problem statement-----

You see, the program statement is plain and simple. It didn't give any
restriction and any hints that the problem should cater 5 x 5 array of
characters.

Quote
>> 3. We, the student, mostly don't expect the testing procedure will
>> carried out on this way, that is asking to change the source code
>> first and test it.

>Well, in a language like Pascal, expect it.  Your program IMHO doesn't
>meet modularity standards, and would probably be a good deal shorter if
>rewritten in modular form.  If you want to do a little independent work,
>look back over your code and work on devising a program which will work
>no matter what maxchar is.

Yes, I admit that it is not flexible enough. The point is that if the
tutor inform us in advance that although the problem states a 10 x 10
array,  I will test your program using 5 x 5 or 7 x 7 or anything
dimension of array the tutor wants as long as within the 10 x 10
range.

- Show quoted text -

Quote

>> 4. In a commercial application user acceptance testing process, have
>> you heard the user (tutor) ask the developer (the student) to modify
>> the source code and input the data then? It is the other way around.
>> User input the test case data and check the result, if something is
>> wrong, take note on it on a UAT log sheet and pass to the developer
>> and developer verified the test result. If it is really a bug, then
>> the program is rectified.

>No, this wouldn't be handled user/developer, it would be handled
>QA/developer.  Besides, I can't see how a professional programmer would
>qualify as being a professional programmer writing code that way.  I
>think the word for it is "kludge".  Sure it may work, but it's a cheap
>fix for something that has to be done.

>> I was told my program have a big BUG! Oh my God! It is not a bug
>> instead a need to improve program flexibitity to cater 5 x 5 array.

>Then what is it -- a feature?

I really don't know what he mean a bug! Like you said, my tutor should
say it that he need a additional features to cater 5 x 5 array
instead.

Quote

>> As a matter of giving a face to my teacher in front of a class, I
>> remain silent and really surprised on the way he handle this case.
>> If he uses this method of doing acceptance test, I think no student
>> will accept it.

>> Any comments on this predicament?

>I hope you don't take this too hard, but I'm trying to also take into
>consideration what I've experienced in the learning process and be as
>fair about it as possible.

I'm very not concerned on this because assignment accounts 20% of the
grade and exam take 80%, it is still safe for me.

I absolutely didn't take this too hard. It is just that I was really
surprised how he QA my program , he he he !

All of the student complain just like myself, as I expected. It is
just play a ball game with new additional rules enforced before the
game starts. It is not fair to the players, right? :)

James Lo
MIEEE-CS,MACM
North Point, Hong Kong
e-Mail  : loja...@netvigator.com  (Private)
          U95...@cis.hkuspace.org (School)
          loja...@acm.org         (ACM)
          james...@sema.com.hk    (Office)
HomePage: http://home.netvigator.com/~lojames/index.htm

"Live your life each day as you would climb a mountain.
An occasional glance towards the summit keeps the goal in
mind, but many beautiful scenes are to be observed from
each new vantage point."

Re:Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)


On Sun, 09 Nov 1997 01:23:48 GMT, loja...@netvigator.com (Ching Tian)
wrote:

Quote
>On Sat, 08 Nov 1997 15:14:55 -0500, Scott Earnest
><set...@ix.netcom.com> wrote:

>>James  wrote:

>>> Hi All,

>>> Today, I supposed should be very happy to submit my PASCAL assignment
>>> in advance to my tutor. I tried this very hard and devoted a great
>>> deal of time in this. Instead, I felt frustrated by the way he handled
>>> the acceptance testing (e.g. try to test whether any bug on my
>>> program).
 [snip]
>I never use PASCAL programming on my commercial programming. PASCAL
>programming is a teaching programming language NOT a application
>development language. It gives an idea to the student what is a
>modular programming. I used COBOL,VISUAL BASIC, 4GL. Frankly speaking
>and in reality, nobody will question your algorithm as long as you can
>give the expected correct result.

You hit the nail here, Pascal is a teaching language and you are in a
programming class. So here, acceptance is a phase where the program
is checked to see if it meets the standards you are supposed to learn
in this class. It is only natural the program source is included in
the review.
In real life, a company with a large IT division will have programming
standards, and an acceptance test may very well include a review of
the source code to see if it meets those standards. After this stage,
the program, source and executable, is handed over to some other
division responsible for production software, and the programmer is no
longer the owner of the source after that.
[snip]

- Show quoted text -

Quote
>OKAY, here's exactly the problem statement given on the assignment
>paper.

>Q3:

>Input any design or pattern from the keyboard into a 10x10 array of
>characters. To save keying time, input each row of the array as a
>string[10] variable. Then assign each character of the input string to
>an array of element of the current row, padding trailing spaces (write
>a procedure that will do that task). Write a procedure that will
>modify the array to rotate 90 degrees clockwise. Display the rotated
>array. Use a REPEAT loop in the main program to allow as many
>rotations as the user desires. Four consecutive rotations should bring
>back the original pattern.

>----end of problem statement-----

>You see, the program statement is plain and simple. It didn't give any
>restriction and any hints that the problem should cater 5 x 5 array of
>characters.

In the problem statement it is specified you should use only one input
string and a 10x10 character array. You use 10 separate input string
variables, so the program clearly doesn't meet the specifications.

BTW, I already hinted to you in October, when you submitted an earlier
version of your program to this group, that it would be a good idea to
rewrite the string reading part using a 'for', 'while' or 'repeat'
loop.
I don't know if you are going to rewrite it now, but if you do, I
strongly advise that you declare two constants for the array
dimensions: one for the maximum number of characters in a string, and
a separate one for the number of strings.

A last point: it is a violation of the netiquette of this newsgroup to
include binary attachments to your messages.

Bob Ferguson.

--
J.R. Ferguson, Amsterdam, The Netherlands
e-mail: j.r.fergu...@iname.com

Re:Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)


Quote
Ching Tian (loja...@netvigator.com) writes:
> On Sat, 08 Nov 1997 15:14:55 -0500, Scott Earnest
> <set...@ix.netcom.com> wrote:

> Q3:

> Input any design or pattern from the keyboard into a 10x10 array of
> characters. To save keying time, input each row of the array as a
> string[10] variable. Then assign each character of the input string to
> an array of element of the current row, padding trailing spaces (write
> a procedure that will do that task). Write a procedure that will
> modify the array to rotate 90 degrees clockwise. Display the rotated
> array. Use a REPEAT loop in the main program to allow as many
> rotations as the user desires. Four consecutive rotations should bring
> back the original pattern.

> ----end of problem statement-----

> say it that he need a additional features to cater 5 x 5 array
> instead.

If you are really upset talk to the Professor not the marker and
explain your concern.

But ... when you work with array (see your class notes) you will
probably see that the examples rarely ever use "magic" numbers like 10.
Instead you will see a constant used as
Const
   max = 10;
then all array definitions will refer to the size as max and not as 10.

This programming style is usually emphasized in the first few lectures along
with other guidelines.  See your handout on good programming style.
It is too bad that the professor didn't re-emphasize this.  In any case
your program worked for the specified size but could not be easily changed to
handle any reasonable size.

I marking guide handed out before the assignment would also help set
the programming standards.

Some courses emphasize that programming assignments must be wriiten
to very rigid standards, far different from just practise exercises.

Hang in and keep programming and reading other people programs.

--
John Katic    e-mail address aq...@freenet.carleton.ca
              fax number     1-613-224-0805
-----------------------------------------------------------------

Re:Surprise by the way how my PASCAL tutor check my assignment program - cw2c.pas (0/1)


On Sat Nov  8, Ching Tian wrote:
 [snip happens...]

Quote
>I was really surprised how my tutor test the program. He asked me to
>MODIFIED MY PROGRAM SOURCE CODE FIRST, and then he test the program !
>Why should I change my program, for what purpose.
>This is ridiculous. The is the first time how an User Acceptance
>Testing was carried out during my whole 10 years of IT experience!

James

Had a quick look at your code. What your tutor was trying to
tell you was that your program, while correct, showed a lack
of understanding of programming. You are lucky he did not ask
you to make your program work for 100 strings rather than 10, or
perhaps 1000 strings.

Your solution does not grow well.

One thing you will find out if you get a job programming is that
the specs change even before you finish. You should write
programs that can be easily adapted. This is more important than
efficiency or simplicity in some cases.

When your tutor glanced at your progam and found it was 10 times
as large as it should be, he quickly decided he had to try to
explain something to you. Stop whining and listen and learn.

Brent
--
Brent Beach, Victoria, BC

Other Threads