home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / ada / 4027 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.7 KB

  1. Path: sparky!uunet!usc!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!email.sp.paramax.com!email.sp.paramax.com!not-for-mail
  2. From: parkhill@email.sp.paramax.com (parkhill)
  3. Newsgroups: comp.lang.ada
  4. Subject: Re: Ada and 2167 Unit Testing
  5. Date: 21 Jan 1993 10:06:09 -0600
  6. Organization: Paramax -  Eagan, MN
  7. Lines: 42
  8. Distribution: usa
  9. Message-ID: <1jmhlhINNkmg@email.sp.paramax.com>
  10. References: <EACHUS.93Jan20201045@oddjob.mitre.org>
  11. NNTP-Posting-Host: email.sp.paramax.com
  12.  
  13. eachus@oddjob.mitre.org (Robert I. Eachus) writes:
  14. >     In any case, if a package has subunits beat anyone necessary over
  15. > the head with the fact that these are SUBunits, not subUNITS.  They
  16. > are separated out for the convenience of the developers, and usually
  17. > should not be regarded as separate units for test purposes.
  18. >      A rule of thumb, and it is only a rule of thumb, is that there
  19. > should be an average of unit for each 300 to 1000 SLOC, and most of
  20. > these units should be either package specifications or package bodies.
  21. > A 60 KSLOC project would be tracking about 100 units.  Again the right
  22. > answer for your project will depend on many factors.  (But if you
  23. > spend a lot of time testing ten line units...)
  24.  
  25. On our project, units are library level packages spec and body together.
  26. The subunits (separate subprograms) are treated as part of the package
  27. UNIT. This seemed to make sense since you can't test a subprogram 
  28. declared in a package specification without "withing" the specification.
  29. Meaning it can't really be tested alone (not a separately testable
  30. item). Subprograms declared in the package body present even more of
  31. a problem.
  32.  
  33. Actually, testing under 2167 is still a little fuzzy for me. How can
  34. testing be done in exclusion on the subprogram level? For instance,
  35. how could you test a semaphore seize unit without using the corresponding 
  36. inverse operation (unit) release?  How could you test putting something
  37. in a queue without taking it out?  By placing the operations in the 
  38. same unit logical testing seems possible. Perhaps I do not understand
  39. the restrictions of separately testing units under 2167.
  40.  
  41. Another fuzzy thing about the concept of unit on our project is that
  42. our coding style makes most if not all subprograms declared in the
  43. body of a package separates. The separate subprograms are all in
  44. separate files. Clearly this is not unusual, but then we run a utility
  45. that takes all the separates and puts them back into the parent 
  46. packages.  We do this because it reduces code size and link time in
  47. our system.  So for development (to make it easier on the humans) the
  48. code is in separate more understandable bite sized files, but for the
  49. computer the code is de-separatized so code generation is more
  50. efficient and linking takes much less time.
  51.  
  52. Robert Parkhill
  53.