In many areas of application, one searches within finite populations f
or items of interest, where the probability of sampling an item fs pro
portional to a random size attribute from an i.i.d. superpopulation of
attributes which may or may not be observable upon discovery. Here we
treat the problem of asymptotically optimal stopping rules for size-d
ependent searches of this type, as the size of the underlying populati
on grows, where the loss function includes an asymptotically smooth ti
me-dependent cost, a constant cost per item sampled and a cost per und
iscovered item which may depend on the size attribute of the undiscove
red item. Under some regularity and convexity conditions related to th
e asymptotic expected loss, we characterize asymptotically optimal rul
es even when the initial population size and the distribution of size
attributes are unknown. We direct especial attention to applications i
n software reliability, where the items of interest are software fault
s (''bugs''). In this setting, the size attributes will not be observa
ble when faults are found, and, in addition, our search model allows n
ew bugs to be introduced into the software when faults are detected ('
'imperfect debugging''). Our results extend those of Dalal and Mallows
and Kramer and Starr, and are illustrated in the perfect-debugging ca
se on a previously analyzed dataset of Musa.