Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate person-months of effort in the package #62

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

mcdonnnj
Copy link
Contributor

@mcdonnnj mcdonnnj commented Aug 9, 2022

This pull request changes the calculation of person-months from relying on the tool located at http://softwarecost.org/tools/COCOMO/ to calculating it within the package using the same settings. The labor hours calculation is rounded to the tenths to be consistent with the output of the previous method.

If there is an issue with connecting to the above tool it will cause an unrecoverable failure when using this tool from the CLI. This is especially painful if working over a large number of projects. Since this is a relatively straightforward calculation I thought it prudent to just implement calculating person-months in the package to remove the need to query the tool entirely.

Note: There is a difference in the calculated labor hours value because the above tool rounds the person-months output to the tenths while we have the raw value when calculating it locally. PHP (what the tool appears to be written in) has a default of PHP_ROUND_HALF_UP in the round() function which has the following description:

Rounds num away from zero when it is half way there, making 1.5 into 2 and -1.5 into -2.

Using the CLOC of this branch:

$ cloc --json . | jq '.SUM.code'
3152

Old implementation:

>>> compute_labor_hours(3152)
1580.8

Person-months: 10.4

New implementation:

>>> compute_labor_hours(3152)
1579.4

Person-months: 10.390646842135041

@IanLee1521
Copy link
Member

This is awesome, thank you @mcdonnnj !

@mcdonnnj mcdonnnj force-pushed the improvement/use_local_cocomoii branch from 6f9b860 to f7cc3e3 Compare August 10, 2022 13:35
@mcdonnnj
Copy link
Contributor Author

@IanLee1521 Fixed that oversight on my part that caused tests to fail. Everything should pass now.

Migrate from querying the tool at http://softwarecost.org/tools/COCOMO/
to get person-months of effort to calculating it within the package.
The scale factor and cost driver values used represent the default of
"Nominal" that is used by the aforementioned tool. The value for
labor_hours is rounded to the tenths for consistency with output from
the previous version.
@mcdonnnj mcdonnnj force-pushed the improvement/use_local_cocomoii branch from f7cc3e3 to ce90585 Compare August 10, 2022 18:12
@IanLee1521 IanLee1521 merged commit 779f6a5 into LLNL:main Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants