;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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 . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :xomo.evaluation-methods) ;;TODO needs moved to treatments? (defun rating? (conf) (etypecase conf (sf (bag-range conf)) (em (bag-range conf)) (dr (bag-range conf)) (number conf))) ;;TODO move xomo force methods into coc-lib ;;TODO force methods for conf, should they only modify cache? (defun force-em-effort-helper-re (em-attribute rating) (let ((conf (get-current-attribute-configuration em-attribute))) (setf (bag-range conf) (list rating)))) ;;; ;;; Software Quality Investment Risk Exposure ;;; ;;FIXME handle inversly proportional attributes (defun size-curve (attribute) "alpha an beta were calculated from using excel with values from Huang06" (let ((x (rating? (! attribute)))) (* 1.7766 (exp (* -0.574 x))))) (defun size-coefficient () (* (size-curve 'rely))) (defun loss-size () (* (expt 3 (/ (- (rating? (! 'cplx)) 3) 2) ) ; range of mulitpler is 3 ^ (cplx-3)/2 so [1/3 5.196] (effort) (size-coefficient))) (defun loss-probability () (/ (defects) (with-new-db (zap 'rely) (force-em-effort-helper-re 'rely 1) (defects)))) (defun sofware-quality-risk-exposure () (* (loss-probability) (loss-size))) ;;; ;;; Market Share Erosion Risk Exposure ;;; ;;FIXME handle inversly proportional attributes (defun market-curve (attribute) "alpha an beta were calculated from using excel with values from Huang06" (let ((x (rating? (! attribute)))) (* 3.35 (exp (* -1.2065 (- 6 x)))))) (defun market-coefficient () (* (market-curve 'rely))) (defun market-erosion-risk-exposure () (* (effort) (market-coefficient))) ;;; ;;; Risk Exposure ;;; (defun risk-exposure () (+ (market-erosion-risk-exposure) (sofware-quality-risk-exposure))) ;;; ;;; register ;;; (register-evaluation-method-by-parameters 'risk-exposure "risk-exposure" (augment-evaluate-state-function-by-ids #'risk-exposure :store-evaluation-score :with-constraints :xomo-scores :ignore-state) #'<)