Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Q 4 Mr. Hunt & Mr Thomas (4): mockobjects & development cycle

 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear authors,
As a sidetrack of the topic:
Q 4 Mr. Hunt & Mr Thomas (3): unit test & development cycle
It seems that I should consider unit testing for adaptive
and corrective changes on software that has passed the
initial stages of development.
In your opinion, what could be the drawback of applying
the concept of mockobjects that your discuss in your
book in a phase when the mocked object in question really
doesn't exist yet, so that the programmer can test an increment
of a software product for prototyping reasons for example.
Is my interpretation of the use of mockobjects correct
in this context?
Thank you,
Gian Franco Casula
 
Author
Posts: 55
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It seems that I should consider unit testing for adaptive
and corrective changes on software that has passed the
initial stages of development.


I wouldn't necessarily agree with that. Unit testing is best served warm, for adaptive and corrective changes during initial development. Indeed, test-first design would have you write the test before the code ever exists.


In your opinion, what could be the drawback of applying
the concept of mockobjects that your discuss in your
book in a phase when the mocked object in question really
doesn't exist yet, so that the programmer can test an increment
of a software product for prototyping reasons for example.


Absolutely! In the case where an obejct doesn't exist yet, or an interface to a piece of hardware doesn't exist yet, mock obejcts are perfect. They form a powerful documentation aid to the eventual creator of the missing piece. "Make it work like this...". They then have unit tests to go against so they'll know that the new piece will work with the application.
 
Gian Franco
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Andy Hunt:

Absolutely! In the case where an obejct doesn't exist yet, or an interface to a piece of hardware doesn't exist yet, mock obejcts are perfect. They form a powerful documentation aid to the eventual creator of the missing piece. "Make it work like this...". They then have unit tests to go against so they'll know that the new piece will work with the application.


The mockobject could then be used to refine
the original specifications of the mocked object
to be?
Unit testing would then have an extra dimension
in the whole development process, nice.
Best regards,
Gian Franco Casula
 
Andy Hunt
Author
Posts: 55
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the idea.
As our friend Jim Highsmith says, it's not important to get it right the first time. It's vitally important to get it right the LAST time.
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Andy Hunt:
As our friend Jim Highsmith says, it's not important to get it right the first time. It's vitally important to get it right the LAST time.


But the culture of the developers is that they do not get it right the first time. Yes, they do get it right the LAST time... But, the program surpises them with the bugs in front of the System Analysts or functional testers.... That kind of problem is common in most of the projects, in which Unit Testing is ignored...
So here we can see the important point of the unit testing...
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ko Ko Naing:
But, the program surpises them with the bugs in front of the System Analysts or functional testers.... That kind of problem is common in most of the projects, in which Unit Testing is ignored...

Actually, such problems should not have much to do with unit testing but functional testing and requirements engineering. Of course, some problems could've been caught by unit tests but I would claim that the biggest problems coming up during the "late testing stages" are due to missing or misunderstood requirements and system-level integration issues.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
Actually, such problems should not have much to do with unit testing but functional testing and requirements engineering. Of course, some problems could've been caught by unit tests but I would claim that the biggest problems coming up during the "late testing stages" are due to missing or misunderstood requirements and system-level integration issues.


Thanks a lot, Lasse, for your explanation... I even sometimes have to face such kind of bugs and I can't imagine that a programmer's life is so tough like that... Just no way, but rush to find out the bugs... :roll:
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!