| || |
Defining a Unit
How would I go about defining what a unit is?
I know it is a very general question but hopefully the example below will give an idea as to what I am after...
For example for testing a web front end, would the individual .asp pages be defined as units or does the unit need to include things that the asp code interacts with? (If it is the latter then how do you define boundaries between unit and integration testing?)
Re: Defining a Unit
Hi. This is a subject I have wrought over myself. I would hope that the definition of what a unit is would be independant of the development enviorment. I have heard arguments from developers that each and every function is a unit. I sort of understand where they ( as c developers) are comming from, but I think that a unit is actually broader than that. I am Object oreiented by nature and therefore I propopse the following therom: all turring complete programs have an object oriented analog. Therefore, as with oo projects you can save time without comprimising quality by only testing the public functions. However, you must be carefull to update your testing procedures with each change in the software, becuase a (private) function that was only called by other (public) functions might hide a bug that was not exposed in its use in the calling functions. So following this methodology you must not assume that all private functions are bug free. So when adding a new public function that calls a previously used private function, you must update your tests to test the new public function. I hope that was clear. I'm sure that sounds perfectly obvious to you all, but sometimes I am suprised by what people pretend they know( because everyone knows its obvious).
Re: Defining a Unit
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>How would I go about defining what a unit is?<HR></BLOCKQUOTE>
unit = a piece of a code that conducts a specific operation. (Often refered as function or method)
1.) Unit test tests all code paths
2.) Integration test tests to make sure all the units work together.
3.) Functioanl test makes sure that particular user operations works as defined, which is a collction of integrated units.
3.) System tests make sure that functional tests work in varius system configurations.
4.) Load tests make sure that system tests work under duress.
Does this make sense?