;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file is part of "NOVA": NOVA = search + COCOMO tools ; Copyright, 2008, Tim Menzies tim@menzies.us ; ; NOVA is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; NOVA is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; You should have received a copy of the GNU General Public License ; a long with NOVA. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun defects () "Returns the total number of defects." (+ (stage-defects 'r) ; requirements (stage-defects 'd) ; design (stage-defects 'c))) ; coding (defun stage-defects (stage) "Returns the number of defects (introduced - removed) for the current stage." (* (defects-remaining-ratio stage) (defects-introduced stage))) (defun defects-introduced (stage) "Returns the number of defects introduced for the current stage." (let ((kloc (! 'kloc)) (stage-weight '((r . 10) (d . 20) (c . 30)))) (* (geta stage stage-weight) kloc (unweighted-defects-introduced stage)))) (defun em2xin (stage em) "Returns the defect introduction rate for an effort multiplier." (case stage ('r (em2rin em)) ('d (em2din em)) ('c (em2cin em)))) (defun sf2xin (stage sf) "Returns the defect introduction rate for a scale factor." (case stage ('r (sf2rin sf)) ('d (sf2din sf)) ('c (sf2cin sf)))) (defun unweighted-defects-introduced (stage) "Returns the product of all defect introduction rates." (macrolet ((f (x) `(em2xin stage ',x)) (s (x) `(sf2xin stage ',x))) ;; flex has no effect on defect introduction and is omitted (* (s prec) (s resl) (s team) (s pmat) (f time) (f stor) (f data) (f pvol) (f ruse) (f rely) (f docu) (f acap) (f pcap) (f pcon) (f aexp) (f plex) (f ltex) (f tool) (f cplx) (f site) (f sced)))) (defun dr2xout (stage dr) "Returns the defect removal rate for a defect remover." (case stage ('r (dr2rout dr)) ('d (dr2dout dr)) ('c (dr2cout dr)))) (defun defects-remaining-ratio (stage) "Returns the ratio of defects remaining for the current stage." (macrolet ((d (x) `(dr2xout stage ',x))) (* (- 1 (d aa)) (- 1 (d etat)) (- 1 (d pr)))))