forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcocomo_81_basic
More file actions
executable file
·62 lines (50 loc) · 1.54 KB
/
cocomo_81_basic
File metadata and controls
executable file
·62 lines (50 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
#
# Computes a basic constructive cost model (COCOMO 81).
#
# Notes:
#
# * COCOMO 81 is meant to include design, specification, review, and management overhead associated with producing quality software.
# * COCOMO 81 was created to model large institutional projects which may not reflect the nature of distributed open-source projects.
#
# References:
#
# * [COCOMO](https://en.wikipedia.org/wiki/COCOMO)
# Determine root directory:
root="$(git rev-parse --show-toplevel)"
# Define the path to a utility to compute the number of non-empty lines per file:
nonempty_lines_per_file="${root}/tools/git/scripts/nonempty_lines_per_file"
#
"${nonempty_lines_per_file}" | awk '
BEGIN {
# Model coefficients:
a_b = 2.4
b_b = 1.05
c_b = 2.5
d_b = 0.38
# Assume a ratio of 1:9 delivered code (pkgs) to support code (tests, examples, benchmarks):
loc_sf = 0.1;
# Average annual developer salary (USD):
salary = 55000
}
$1 ~ /JavaScript/ {
loc += $2
}
END {
sloc = loc * loc_sf
kloc = sloc / 1000
# Compute the required effort in "man-months":
effort_applied = a_b * kloc^b_b
# Compute the development time in months:
development_time = c_b * effort_applied^d_b
# Compute the number of people required:
people_required = effort_applied / development_time
# Compute the cost based on developer salary:
cost = people_required * salary * development_time/12
print "kloc" OFS kloc
print "development_time" OFS development_time
print "effort_applied" OFS effort_applied
print "people_required" OFS people_required
print "cost" OFS cost
}
'