BIND 10 #466: duplicate code in xfrout

BIND 10 Development do-not-reply at isc.org
Tue Jan 11 09:17:14 UTC 2011


#466: duplicate code in xfrout
-------------------------------------+-------------------------------------
                 Reporter:  jinmei   |                Owner:  zzchen_pku
                     Type:  defect   |               Status:  reviewing
                 Priority:  minor    |            Milestone:  y2 12 month
                Component:  xfrout   |  milestone
                 Keywords:           |           Resolution:
Estimated Number of Hours:  0.0      |            Sensitive:  0
                Billable?:  1        |  Add Hours to Ticket:  0
                Internal?:  0        |          Total Hours:  0
-------------------------------------+-------------------------------------

Comment (by zzchen_pku):

 Replying to [comment:3 jinmei]:
 > First off, I made a minor style fix to the branch.
 Thanks.
 > '''xfrout.py.in'''
 >  - I think _zone_is_empty() is not intuitive in the context of how it is
 used and what it actually does.  What it actually does is to test if a
 specified zone has an SOA RR.  That is, it could return True even if a
 zone isn't "empty" (in that it has some RRs). I'd rename it to
 zone_has_soa(), and use it with "not".
 >  - I'd like to see more description for _zone_is_empty() and
 _zone_exist().  Specifically, I'd like to see an explanation how we use
 these two sets of functions.
 Done.
 > '''sqlite3_ds.py'''
 >  - zone_exist doesn't have a test.  This probably also means it wasn't
 developed in test driven, and if really not, it's not good (TDD is
 especially important when we introduce a new thing, because it would
 affect how we design it).  If my guess is correct, I'd suggest delete
 zone_exist once, and restart it from the scratch in TDD (of course it's a
 waste in some sense, but we need some redundant practice to change our
 mindset)
 >  - I'd like zone_exist (or whatever new result) to have more complete
 pydoc style documentation.  It would include description of param/return,
 and provide more detailed explanation (e.g. what "zone exists" means),
 explain in which case an exception can be raised and which exception.
 I noticed that sqlite3_ds doesn't have any unittests before, I think it is
 because:
 {{{
 Test-driven development is difficult to use in situations where full
 functional tests are
 required to determine success or failure. Examples of these are user
 interfaces, programs
 that work with databases, and some that depend on specific network
 configurations.
 }}}
 It's difficult to test database behaviors. I have updated zone_exist
 according to TDD, and found that we need to use too much fakes and mocks,
 so I wonder whether TDD applies to this specific situation?

-- 
Ticket URL: <http://bind10.isc.org/ticket/466#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list