;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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 . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar *strategies* '((do-nothing-strategy "Do nothing") (arch-risk-resl-strategy "Arch/risk resolution") (improve-pcap-strategy "Improve pcap") (improve-pcap-strategy-inc "Improve pcap*") (improve-pmat-strategy "Improve pmat") (improve-prec-flex-strategy "Improve prec/flex") (improve-team-strategy "Improve team") (improve-team-strategy-inc "Improve team*") (improve-tool-tech-plat-strategy "Improve tool/tech/plat") (improve-tool-tech-plat-strategy-inc "Improve tool/tech/plat*") (reduce-func-strategy "Reduce functionality") (reduce-func-strategy-inc "Reduce functionality*") (reduce-quality-strategy "Reduce quality") (reduce-quality-strategy-inc "Reduce quality*") (relax-schedule-strategy "Relax schedule"))) (defun do-nothing-strategy() "Returns the empty strategy." nil) (defun arch-risk-resl-strategy () "Returns 'Architecture and risk resolution' strategy." '((resl 5))) (defun improve-pcap-strategy () "Returns the 'Improve personnel capabilities' strategy." '((acap 5) (pcap 5) (pcon 5) (aexp 5) (plex 5) (ltex 5))) (defun improve-pcap-strategy-inc () "Returns the 'Improve personnal capabilities (incremental)' strategy." '((acap 4) (pcap 4) (pcon 4) (aexp 4) (plex 4) (ltex 4))) (defun improve-pmat-strategy () "Returns the 'Improve process maturity level' strategy." '((pmat 5))) (defun improve-prec-flex-strategy () "Returns the 'Improve precedentedness and development flexibility' strategy." '((prec 5) (flex 5))) (defun improve-team-strategy () "Returns the 'Improve coordination via teambuilding' strategy." '((team 5))) (defun improve-team-strategy-inc () "Returns the 'Improve coordination via teambuilding (incremental)' strategy." '((team 4))) (defun improve-tool-tech-plat-strategy () "Returns the 'Improve tools, techniques, or platform' strategy." '((time 3) (stor 3) (pvol 2) (tool 5) (site 6))) (defun improve-tool-tech-plat-strategy-inc () "Returns the 'Improve tools, techniques, or platform (incremental)' strategy." '((time 3) (stor 3) (pvol 2) (tool 4) (site 5))) (defun reduce-func-strategy () "Returns the 'Reduce/defer functionality' strategy." '((data 2) (kloc 0.5))) (defun reduce-func-strategy-inc () "Returns the 'Reduce/defer functionality (incremental)' strategy." '((data 2) (kloc 0.8))) (defun reduce-quality-strategy () "Returns the 'Reduce/defer quality' strategy." '((rely 1) (docu 1) (time 3) (cplx 1))) (defun reduce-quality-strategy-inc () "Returns the 'Reduce/defer quality (incremental)' strategy." '((rely 2) (docu 2))) (defun relax-schedule-strategy () "Returns the 'Relax the delivery schedule constraint' strategy." '((sced 5))) (defun apply-strategy-kloc (strategy) "Applies the given strategy's kloc multiplier to the *db*." (let ((kloc-mult (assoc 'kloc strategy))) (when kloc-mult (let ((kloc-min (num-min (kloc?))) (kloc-max (num-max (kloc?))) (factor (second kloc-mult))) (kloc! (* kloc-min factor) (* kloc-max factor)))))) (defun apply-strategy-treatments (strategy) "Applies the given strategy's treatments to the *db*." (let ((treatments (remove 'kloc strategy :key #'car))) (force-treatments (separate-treatments treatments)))) (defun score-strategy (strategy score-fn &key (num-runs 20) (case-study (default-case-study))) "Scores the given strategy num-runs times." (let* ((kloc (find 'kloc (complete-case-study case-study) :key #'car)) (kloc-min (second kloc)) (kloc-max (third kloc)) (treatments (remove 'kloc (complete-case-study case-study) :key #'car))) (init-db) (kloc! kloc-min kloc-max) (apply-treatments (separate-treatments treatments)) (apply-strategy-kloc strategy) (apply-strategy-treatments strategy) (let (output) (dotimes (i num-runs output) (push (first (monte-carlo :fn score-fn)) output))))) (defun score-strategies (score-fn &key (num-runs 20) (case-study (default-case-study))) "Scores all strategies for the given case study." (let (output) (dolist (strategy *strategies* (nreverse output)) (push (list (second strategy) (score-strategy (funcall (first strategy)) score-fn :num-runs num-runs :case-study case-study)) output))))